Commit 786eeeb3 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: csr: remove CsrPmemAlloc

It's just a wrapper around kmalloc(, GFP_KERNEL) + a call to panic() if
we are out of memory, which is a very foolish thing to do (the panic
that is.)

So replace it with calls to kmalloc() and ignore the out-of-memory
casese for now, odds are it will not be hit, and if it does, hey, we
will end up panicing just the same as with the old code.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 55a27055
...@@ -69,7 +69,6 @@ csr_wifi-y := bh.o \ ...@@ -69,7 +69,6 @@ csr_wifi-y := bh.o \
csr_helper-y := csr_time.o \ csr_helper-y := csr_time.o \
csr_util.o \ csr_util.o \
csr_framework_ext.o \ csr_framework_ext.o \
csr_pmem.o \
csr_wifi_serialize_primitive_types.o \ csr_wifi_serialize_primitive_types.o \
csr_serialize_primitive_types.o \ csr_serialize_primitive_types.o \
csr_utf16.o \ csr_utf16.o \
......
...@@ -233,7 +233,7 @@ void CsrMsgConvInsert(u16 primType, const CsrMsgConvMsgEntry *ce) ...@@ -233,7 +233,7 @@ void CsrMsgConvInsert(u16 primType, const CsrMsgConvMsgEntry *ce)
} }
else else
{ {
pc = CsrPmemAlloc(sizeof(*pc)); pc = kmalloc(sizeof(*pc), GFP_KERNEL);
pc->primType = primType; pc->primType = primType;
pc->conv = ce; pc->conv = ce;
pc->lookupFunc = NULL; pc->lookupFunc = NULL;
...@@ -279,7 +279,7 @@ CsrMsgConvEntry *CsrMsgConvInit(void) ...@@ -279,7 +279,7 @@ CsrMsgConvEntry *CsrMsgConvInit(void)
{ {
if (!converter) if (!converter)
{ {
converter = (CsrMsgConvEntry *) CsrPmemAlloc(sizeof(CsrMsgConvEntry)); converter = kmalloc(sizeof(CsrMsgConvEntry), GFP_KERNEL);
converter->profile_converters = NULL; converter->profile_converters = NULL;
converter->free_message = free_message; converter->free_message = free_message;
......
/*****************************************************************************
(c) Cambridge Silicon Radio Limited 2010
All rights reserved and confidential information of CSR
Refer to LICENSE.txt included with this source for details
on the license terms.
*****************************************************************************/
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/module.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33)
#include <linux/autoconf.h>
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)
#include <linux/config.h>
#endif
#include <linux/slab.h>
#include "csr_panic.h"
#include "csr_pmem.h"
void *CsrPmemAlloc(size_t size)
{
void *ret;
ret = kmalloc(size, GFP_KERNEL);
if (!ret)
{
CsrPanic(CSR_TECH_FW, CSR_PANIC_FW_HEAP_EXHAUSTION,
"out of memory");
}
return ret;
}
EXPORT_SYMBOL_GPL(CsrPmemAlloc);
...@@ -17,36 +17,6 @@ ...@@ -17,36 +17,6 @@
extern "C" { extern "C" {
#endif #endif
#ifndef CSR_PMEM_DEBUG_ENABLE
/*****************************************************************************
NAME
CsrPmemAlloc
DESCRIPTION
This function will allocate a contiguous block of memory of at least
the specified size in bytes and return a pointer to the allocated
memory. This function is not allowed to return NULL. A size of 0 is a
valid request, and a unique and valid (not NULL) pointer must be
returned in this case.
PARAMETERS
size - Size of memory requested. Note that a size of 0 is valid.
RETURNS
Pointer to allocated memory.
*****************************************************************************/
#ifdef CSR_PMEM_DEBUG
void *CsrPmemAllocDebug(size_t size,
const char *file, u32 line);
#define CsrPmemAlloc(sz) CsrPmemAllocDebug((sz), __FILE__, __LINE__)
#else
void *CsrPmemAlloc(size_t size);
#endif
#endif
/***************************************************************************** /*****************************************************************************
NAME NAME
...@@ -114,7 +84,6 @@ typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocTyp ...@@ -114,7 +84,6 @@ typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocTyp
void CsrPmemDebugInstallHooks(u8 headSize, u8 endSize, CsrPmemDebugOnAlloc *onAllocCallback, CsrPmemDebugOnFree *onFreeCallback); void CsrPmemDebugInstallHooks(u8 headSize, u8 endSize, CsrPmemDebugOnAlloc *onAllocCallback, CsrPmemDebugOnFree *onFreeCallback);
void *CsrPmemDebugAlloc(size_t size, CsrPmemDebugAllocType type, const char* file, u32 line); void *CsrPmemDebugAlloc(size_t size, CsrPmemDebugAllocType type, const char* file, u32 line);
#define CsrPmemAlloc(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)
void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const char* file, u32 line); void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const char* file, u32 line);
......
...@@ -120,9 +120,9 @@ void CsrSchedBgintSet(CsrSchedBgint bgint); ...@@ -120,9 +120,9 @@ void CsrSchedBgintSet(CsrSchedBgint bgint);
* be null. * be null.
* *
* NOTE * NOTE
* If "mv" is not null then it will typically be a chunk of CsrPmemAlloc()ed * If "mv" is not null then it will typically be a chunk of kmalloc()ed
* memory, though there is no need for it to be so. Tasks should normally * memory, though there is no need for it to be so. Tasks should normally
* obey the convention that when a message built with CsrPmemAlloc()ed memory * obey the convention that when a message built with kmalloc()ed memory
* is given to CsrSchedMessagePut() then ownership of the memory is ceded to the * is given to CsrSchedMessagePut() then ownership of the memory is ceded to the
* scheduler - and eventually to the recipient task. I.e., the receiver of * scheduler - and eventually to the recipient task. I.e., the receiver of
* the message will be expected to kfree() the message storage. * the message will be expected to kfree() the message storage.
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*****************************************************************************/ *****************************************************************************/
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h>
#include "csr_prim_defs.h" #include "csr_prim_defs.h"
#include "csr_msgconv.h" #include "csr_msgconv.h"
#include "csr_macro.h" #include "csr_macro.h"
...@@ -66,7 +67,7 @@ void CsrUtf16StringDes(u16 **value, u8 *buffer, size_t *offset) ...@@ -66,7 +67,7 @@ void CsrUtf16StringDes(u16 **value, u8 *buffer, size_t *offset)
CsrUint32Des(&length, buffer, offset); CsrUint32Des(&length, buffer, offset);
*value = CsrPmemAlloc(length * sizeof(**value)); *value = kmalloc(length * sizeof(**value), GFP_KERNEL);
for (i = 0; i < length; i++) for (i = 0; i < length; i++)
{ {
CsrUint16Des(&(*value)[i], buffer, offset); CsrUint16Des(&(*value)[i], buffer, offset);
...@@ -224,7 +225,7 @@ u8 *CsrEventSer(u8 *ptr, size_t *len, void *msg) ...@@ -224,7 +225,7 @@ u8 *CsrEventSer(u8 *ptr, size_t *len, void *msg)
void *CsrEventDes(u8 *buffer, size_t length) void *CsrEventDes(u8 *buffer, size_t length)
{ {
CsrEvent *primitive = (CsrEvent *) CsrPmemAlloc(sizeof(CsrEvent)); CsrEvent *primitive = kmalloc(sizeof(CsrEvent), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -247,7 +248,7 @@ u8 *CsrEventCsrUint8Ser(u8 *ptr, size_t *len, void *msg) ...@@ -247,7 +248,7 @@ u8 *CsrEventCsrUint8Ser(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint8Des(u8 *buffer, size_t length) void *CsrEventCsrUint8Des(u8 *buffer, size_t length)
{ {
CsrEventCsrUint8 *primitive = (CsrEventCsrUint8 *) CsrPmemAlloc(sizeof(CsrEventCsrUint8)); CsrEventCsrUint8 *primitive = kmalloc(sizeof(CsrEventCsrUint8), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -272,7 +273,7 @@ u8 *CsrEventCsrUint16Ser(u8 *ptr, size_t *len, void *msg) ...@@ -272,7 +273,7 @@ u8 *CsrEventCsrUint16Ser(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint16Des(u8 *buffer, size_t length) void *CsrEventCsrUint16Des(u8 *buffer, size_t length)
{ {
CsrEventCsrUint16 *primitive = (CsrEventCsrUint16 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16)); CsrEventCsrUint16 *primitive = kmalloc(sizeof(CsrEventCsrUint16), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -297,7 +298,7 @@ u8 *CsrEventCsrUint32Ser(u8 *ptr, size_t *len, void *msg) ...@@ -297,7 +298,7 @@ u8 *CsrEventCsrUint32Ser(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint32Des(u8 *buffer, size_t length) void *CsrEventCsrUint32Des(u8 *buffer, size_t length)
{ {
CsrEventCsrUint32 *primitive = (CsrEventCsrUint32 *) CsrPmemAlloc(sizeof(CsrEventCsrUint32)); CsrEventCsrUint32 *primitive = kmalloc(sizeof(CsrEventCsrUint32), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -323,7 +324,7 @@ u8 *CsrEventCsrUint16CsrUint8Ser(u8 *ptr, size_t *len, void *msg) ...@@ -323,7 +324,7 @@ u8 *CsrEventCsrUint16CsrUint8Ser(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint16CsrUint8Des(u8 *buffer, size_t length) void *CsrEventCsrUint16CsrUint8Des(u8 *buffer, size_t length)
{ {
CsrEventCsrUint16CsrUint8 *primitive = (CsrEventCsrUint16CsrUint8 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrUint8)); CsrEventCsrUint16CsrUint8 *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrUint8), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -350,7 +351,7 @@ u8 *CsrEventCsrUint16CsrUint16Ser(u8 *ptr, size_t *len, void *msg) ...@@ -350,7 +351,7 @@ u8 *CsrEventCsrUint16CsrUint16Ser(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint16CsrUint16Des(u8 *buffer, size_t length) void *CsrEventCsrUint16CsrUint16Des(u8 *buffer, size_t length)
{ {
CsrEventCsrUint16CsrUint16 *primitive = (CsrEventCsrUint16CsrUint16 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrUint16)); CsrEventCsrUint16CsrUint16 *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrUint16), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -377,7 +378,7 @@ u8 *CsrEventCsrUint16CsrUint32Ser(u8 *ptr, size_t *len, void *msg) ...@@ -377,7 +378,7 @@ u8 *CsrEventCsrUint16CsrUint32Ser(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint16CsrUint32Des(u8 *buffer, size_t length) void *CsrEventCsrUint16CsrUint32Des(u8 *buffer, size_t length)
{ {
CsrEventCsrUint16CsrUint32 *primitive = (CsrEventCsrUint16CsrUint32 *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrUint32)); CsrEventCsrUint16CsrUint32 *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrUint32), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -405,7 +406,7 @@ u8 *CsrEventCsrUint16CsrCharStringSer(u8 *ptr, size_t *len, void *msg) ...@@ -405,7 +406,7 @@ u8 *CsrEventCsrUint16CsrCharStringSer(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint16CsrCharStringDes(u8 *buffer, size_t length) void *CsrEventCsrUint16CsrCharStringDes(u8 *buffer, size_t length)
{ {
CsrEventCsrUint16CsrCharString *primitive = (CsrEventCsrUint16CsrCharString *) CsrPmemAlloc(sizeof(CsrEventCsrUint16CsrCharString)); CsrEventCsrUint16CsrCharString *primitive = kmalloc(sizeof(CsrEventCsrUint16CsrCharString), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -432,7 +433,7 @@ u8 *CsrEventCsrUint32CsrUint16Ser(u8 *ptr, size_t *len, void *msg) ...@@ -432,7 +433,7 @@ u8 *CsrEventCsrUint32CsrUint16Ser(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint32CsrUint16Des(u8 *buffer, size_t length) void *CsrEventCsrUint32CsrUint16Des(u8 *buffer, size_t length)
{ {
CsrEventCsrUint32CsrUint16 *primitive = (CsrEventCsrUint32CsrUint16 *) CsrPmemAlloc(sizeof(CsrEventCsrUint32CsrUint16)); CsrEventCsrUint32CsrUint16 *primitive = kmalloc(sizeof(CsrEventCsrUint32CsrUint16), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -460,7 +461,7 @@ u8 *CsrEventCsrUint32CsrCharStringSer(u8 *ptr, size_t *len, void *msg) ...@@ -460,7 +461,7 @@ u8 *CsrEventCsrUint32CsrCharStringSer(u8 *ptr, size_t *len, void *msg)
void *CsrEventCsrUint32CsrCharStringDes(u8 *buffer, size_t length) void *CsrEventCsrUint32CsrCharStringDes(u8 *buffer, size_t length)
{ {
CsrEventCsrUint32CsrCharString *primitive = (CsrEventCsrUint32CsrCharString *) CsrPmemAlloc(sizeof(CsrEventCsrUint32CsrCharString)); CsrEventCsrUint32CsrCharString *primitive = kmalloc(sizeof(CsrEventCsrUint32CsrCharString), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
......
...@@ -88,7 +88,7 @@ u16 *CsrUint32ToUtf16String(u32 number) ...@@ -88,7 +88,7 @@ u16 *CsrUint32ToUtf16String(u32 number)
noOfDigits++; noOfDigits++;
} }
output = (u16 *) CsrPmemAlloc(sizeof(u16) * (noOfDigits + 1)); /*add space for 0-termination*/ output = kmalloc(sizeof(u16) * (noOfDigits + 1), GFP_KERNEL); /*add space for 0-termination*/
tempNumber = number; tempNumber = number;
for (count = noOfDigits; count > 0; count--) for (count = noOfDigits; count > 0; count--)
...@@ -185,7 +185,7 @@ u16 *CsrUtf16ConcatenateTexts(const u16 *inputText1, const u16 *inputText2, ...@@ -185,7 +185,7 @@ u16 *CsrUtf16ConcatenateTexts(const u16 *inputText1, const u16 *inputText2,
return NULL; return NULL;
} }
outputText = (u16 *) CsrPmemAlloc((textLen + 1) * sizeof(u16)); /* add space for 0-termination*/ outputText = kmalloc((textLen + 1) * sizeof(u16), GFP_KERNEL); /* add space for 0-termination*/
if (inputText1 != NULL) if (inputText1 != NULL)
...@@ -320,7 +320,7 @@ u8 *CsrUtf16String2Utf8(const u16 *source) ...@@ -320,7 +320,7 @@ u8 *CsrUtf16String2Utf8(const u16 *source)
} }
} }
dest = CsrPmemAlloc(length); dest = kmalloc(length, GFP_KERNEL);
destStart = dest; destStart = dest;
for (i = 0; i < sourceLength; i++) for (i = 0; i < sourceLength; i++)
...@@ -610,7 +610,7 @@ u16 *CsrUtf82Utf16String(const u8 *utf8String) ...@@ -610,7 +610,7 @@ u16 *CsrUtf82Utf16String(const u8 *utf8String)
} }
/* Create space for the null terminated character */ /* Create space for the null terminated character */
dest = (u16 *) CsrPmemAlloc((1 + length) * sizeof(u16)); dest = kmalloc((1 + length) * sizeof(u16), GFP_KERNEL);
destStart = dest; destStart = dest;
for (i = 0; i < sourceLength; i++) for (i = 0; i < sourceLength; i++)
...@@ -736,7 +736,7 @@ u16 *CsrUtf16StringDuplicate(const u16 *source) ...@@ -736,7 +736,7 @@ u16 *CsrUtf16StringDuplicate(const u16 *source)
if (source) /* if source is not NULL*/ if (source) /* if source is not NULL*/
{ {
length = (CsrUtf16StrLen(source) + 1) * sizeof(u16); length = (CsrUtf16StrLen(source) + 1) * sizeof(u16);
target = (u16 *) CsrPmemAlloc(length); target = kmalloc(length, GFP_KERNEL);
memcpy(target, source, length); memcpy(target, source, length);
} }
return target; return target;
...@@ -844,7 +844,7 @@ u16 *CsrUtf16String2XML(u16 *str) ...@@ -844,7 +844,7 @@ u16 *CsrUtf16String2XML(u16 *str)
if (encodeChars) if (encodeChars)
{ {
resultString = outputString = CsrPmemAlloc(stringLength * sizeof(u16)); resultString = outputString = kmalloc(stringLength * sizeof(u16), GFP_KERNEL);
scanString = str; scanString = str;
...@@ -958,7 +958,7 @@ u16 *CsrXML2Utf16String(u16 *str) ...@@ -958,7 +958,7 @@ u16 *CsrXML2Utf16String(u16 *str)
if (encodeChars) if (encodeChars)
{ {
resultString = outputString = CsrPmemAlloc(stringLength * sizeof(u16)); resultString = outputString = kmalloc(stringLength * sizeof(u16), GFP_KERNEL);
scanString = str; scanString = str;
......
...@@ -160,7 +160,7 @@ extern void CsrWifiFsmSendEventExternal(CsrWifiFsmContext *context, CsrWifiFsmEv ...@@ -160,7 +160,7 @@ extern void CsrWifiFsmSendEventExternal(CsrWifiFsmContext *context, CsrWifiFsmEv
*/ */
#define CsrWifiFsmSendAlienEventExternal(_context, _alienEvent, _source, _destination, _primtype, _id) \ #define CsrWifiFsmSendAlienEventExternal(_context, _alienEvent, _source, _destination, _primtype, _id) \
{ \ { \
CsrWifiFsmAlienEvent *_evt = (CsrWifiFsmAlienEvent *)CsrPmemAlloc(sizeof(CsrWifiFsmAlienEvent)); \ CsrWifiFsmAlienEvent *_evt = kmalloc(sizeof(CsrWifiFsmAlienEvent), GFP_KERNEL); \
_evt->alienEvent = _alienEvent; \ _evt->alienEvent = _alienEvent; \
CsrWifiFsmSendEventExternal(_context, (CsrWifiFsmEvent *)_evt, _source, _destination, _primtype, _id); \ CsrWifiFsmSendEventExternal(_context, (CsrWifiFsmEvent *)_evt, _source, _destination, _primtype, _id); \
} }
......
...@@ -1655,7 +1655,7 @@ static CsrResult card_allocate_memory_resources(card_t *card) ...@@ -1655,7 +1655,7 @@ static CsrResult card_allocate_memory_resources(card_t *card)
/* /*
* Allocate memory for the from-host and to-host bulk data slots. * Allocate memory for the from-host and to-host bulk data slots.
* This is done as separate CsrPmemAllocs because lots of smaller * This is done as separate kmallocs because lots of smaller
* allocations are more likely to succeed than one huge one. * allocations are more likely to succeed than one huge one.
*/ */
......
...@@ -95,7 +95,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -95,7 +95,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__) \ #define CsrWifiNmeApConfigSetReqCreate(msg__, dst__, src__, apConfig__, apMacConfig__) \
msg__ = (CsrWifiNmeApConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApConfigSetReq)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_REQ, dst__, src__); \
msg__->apConfig = (apConfig__); \ msg__->apConfig = (apConfig__); \
msg__->apMacConfig = (apMacConfig__); msg__->apMacConfig = (apMacConfig__);
...@@ -124,7 +124,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -124,7 +124,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__) \ #define CsrWifiNmeApConfigSetCfmCreate(msg__, dst__, src__, status__) \
msg__ = (CsrWifiNmeApConfigSetCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApConfigSetCfm)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApConfigSetCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_CONFIG_SET_CFM, dst__, src__); \
msg__->status = (status__); msg__->status = (status__);
...@@ -159,7 +159,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -159,7 +159,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \ #define CsrWifiNmeApStaRemoveReqCreate(msg__, dst__, src__, interfaceTag__, staMacAddress__, keepBlocking__) \
msg__ = (CsrWifiNmeApStaRemoveReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApStaRemoveReq)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApStaRemoveReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STA_REMOVE_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STA_REMOVE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->staMacAddress = (staMacAddress__); \ msg__->staMacAddress = (staMacAddress__); \
...@@ -199,7 +199,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -199,7 +199,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \ #define CsrWifiNmeApStartReqCreate(msg__, dst__, src__, interfaceTag__, apType__, cloakSsid__, ssid__, ifIndex__, channel__, apCredentials__, maxConnections__, p2pGoParam__, wpsEnabled__) \
msg__ = (CsrWifiNmeApStartReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApStartReq)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApStartReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->apType = (apType__); \ msg__->apType = (apType__); \
...@@ -238,7 +238,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -238,7 +238,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__) \ #define CsrWifiNmeApStartCfmCreate(msg__, dst__, src__, interfaceTag__, status__, ssid__) \
msg__ = (CsrWifiNmeApStartCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApStartCfm)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApStartCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_START_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); \ msg__->status = (status__); \
...@@ -273,7 +273,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -273,7 +273,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \ #define CsrWifiNmeApStationIndCreate(msg__, dst__, src__, interfaceTag__, mediaStatus__, peerMacAddress__, peerDeviceAddress__) \
msg__ = (CsrWifiNmeApStationInd *) CsrPmemAlloc(sizeof(CsrWifiNmeApStationInd)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApStationInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STATION_IND, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STATION_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->mediaStatus = (mediaStatus__); \ msg__->mediaStatus = (mediaStatus__); \
...@@ -304,7 +304,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -304,7 +304,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__) \ #define CsrWifiNmeApStopReqCreate(msg__, dst__, src__, interfaceTag__) \
msg__ = (CsrWifiNmeApStopReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApStopReq)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApStopReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); msg__->interfaceTag = (interfaceTag__);
...@@ -336,7 +336,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -336,7 +336,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__) \ #define CsrWifiNmeApStopIndCreate(msg__, dst__, src__, interfaceTag__, apType__, status__) \
msg__ = (CsrWifiNmeApStopInd *) CsrPmemAlloc(sizeof(CsrWifiNmeApStopInd)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApStopInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_IND, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->apType = (apType__); \ msg__->apType = (apType__); \
...@@ -369,7 +369,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -369,7 +369,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \ #define CsrWifiNmeApStopCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = (CsrWifiNmeApStopCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApStopCfm)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApStopCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_STOP_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); msg__->status = (status__);
...@@ -402,7 +402,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -402,7 +402,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__) \ #define CsrWifiNmeApWmmParamUpdateReqCreate(msg__, dst__, src__, wmmApParams__, wmmApBcParams__) \
msg__ = (CsrWifiNmeApWmmParamUpdateReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApWmmParamUpdateReq)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_REQ, dst__, src__); \
memcpy(msg__->wmmApParams, (wmmApParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); \ memcpy(msg__->wmmApParams, (wmmApParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); \
memcpy(msg__->wmmApBcParams, (wmmApBcParams__), sizeof(CsrWifiSmeWmmAcParams) * 4); memcpy(msg__->wmmApBcParams, (wmmApBcParams__), sizeof(CsrWifiSmeWmmAcParams) * 4);
...@@ -431,7 +431,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -431,7 +431,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__) \ #define CsrWifiNmeApWmmParamUpdateCfmCreate(msg__, dst__, src__, status__) \
msg__ = (CsrWifiNmeApWmmParamUpdateCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApWmmParamUpdateCfm)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WMM_PARAM_UPDATE_CFM, dst__, src__); \
msg__->status = (status__); msg__->status = (status__);
...@@ -469,7 +469,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -469,7 +469,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \ #define CsrWifiNmeApWpsRegisterReqCreate(msg__, dst__, src__, interfaceTag__, selectedDevicePasswordId__, selectedConfigMethod__, pin__) \
msg__ = (CsrWifiNmeApWpsRegisterReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApWpsRegisterReq)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->selectedDevicePasswordId = (selectedDevicePasswordId__); \ msg__->selectedDevicePasswordId = (selectedDevicePasswordId__); \
...@@ -501,7 +501,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE ...@@ -501,7 +501,7 @@ extern const char *CsrWifiNmeApDownstreamPrimNames[CSR_WIFI_NME_AP_PRIM_DOWNSTRE
*******************************************************************************/ *******************************************************************************/
#define CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \ #define CsrWifiNmeApWpsRegisterCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = (CsrWifiNmeApWpsRegisterCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApWpsRegisterCfm)); \ msg__ = kmalloc(sizeof(CsrWifiNmeApWpsRegisterCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_NME_AP_PRIM, CSR_WIFI_NME_AP_WPS_REGISTER_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); msg__->status = (status__);
......
...@@ -152,7 +152,7 @@ u8* CsrWifiNmeApConfigSetReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -152,7 +152,7 @@ u8* CsrWifiNmeApConfigSetReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t length) void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApConfigSetReq *primitive = (CsrWifiNmeApConfigSetReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApConfigSetReq)); CsrWifiNmeApConfigSetReq *primitive = kmalloc(sizeof(CsrWifiNmeApConfigSetReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -199,7 +199,7 @@ void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t length) ...@@ -199,7 +199,7 @@ void* CsrWifiNmeApConfigSetReqDes(u8 *buffer, size_t length)
primitive->apMacConfig.macAddressList = NULL; primitive->apMacConfig.macAddressList = NULL;
if (primitive->apMacConfig.macAddressListCount) if (primitive->apMacConfig.macAddressListCount)
{ {
primitive->apMacConfig.macAddressList = (CsrWifiMacAddress *)CsrPmemAlloc(sizeof(CsrWifiMacAddress) * primitive->apMacConfig.macAddressListCount); primitive->apMacConfig.macAddressList = kmalloc(sizeof(CsrWifiMacAddress) * primitive->apMacConfig.macAddressListCount, GFP_KERNEL);
} }
{ {
u16 i2; u16 i2;
...@@ -255,7 +255,7 @@ u8* CsrWifiNmeApWpsRegisterReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -255,7 +255,7 @@ u8* CsrWifiNmeApWpsRegisterReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApWpsRegisterReqDes(u8 *buffer, size_t length) void* CsrWifiNmeApWpsRegisterReqDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApWpsRegisterReq *primitive = (CsrWifiNmeApWpsRegisterReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApWpsRegisterReq)); CsrWifiNmeApWpsRegisterReq *primitive = kmalloc(sizeof(CsrWifiNmeApWpsRegisterReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -447,7 +447,7 @@ u8* CsrWifiNmeApStartReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -447,7 +447,7 @@ u8* CsrWifiNmeApStartReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length) void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApStartReq *primitive = (CsrWifiNmeApStartReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApStartReq)); CsrWifiNmeApStartReq *primitive = kmalloc(sizeof(CsrWifiNmeApStartReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -518,7 +518,7 @@ void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length) ...@@ -518,7 +518,7 @@ void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length)
primitive->p2pGoParam.operatingChanList.channelEntryList = NULL; primitive->p2pGoParam.operatingChanList.channelEntryList = NULL;
if (primitive->p2pGoParam.operatingChanList.channelEntryListCount) if (primitive->p2pGoParam.operatingChanList.channelEntryListCount)
{ {
primitive->p2pGoParam.operatingChanList.channelEntryList = (CsrWifiSmeApP2pOperatingChanEntry *)CsrPmemAlloc(sizeof(CsrWifiSmeApP2pOperatingChanEntry) * primitive->p2pGoParam.operatingChanList.channelEntryListCount); primitive->p2pGoParam.operatingChanList.channelEntryList = kmalloc(sizeof(CsrWifiSmeApP2pOperatingChanEntry) * primitive->p2pGoParam.operatingChanList.channelEntryListCount, GFP_KERNEL);
} }
{ {
u16 i3; u16 i3;
...@@ -528,7 +528,7 @@ void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length) ...@@ -528,7 +528,7 @@ void* CsrWifiNmeApStartReqDes(u8 *buffer, size_t length)
CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount, buffer, &offset); CsrUint8Des((u8 *) &primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount, buffer, &offset);
if (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount) if (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount)
{ {
primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = (u8 *)CsrPmemAlloc(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount); primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel = kmalloc(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount, GFP_KERNEL);
CsrMemCpyDes(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel, buffer, &offset, ((u16) (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount))); CsrMemCpyDes(primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannel, buffer, &offset, ((u16) (primitive->p2pGoParam.operatingChanList.channelEntryList[i3].operatingChannelCount)));
} }
else else
...@@ -641,7 +641,7 @@ u8* CsrWifiNmeApWmmParamUpdateReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -641,7 +641,7 @@ u8* CsrWifiNmeApWmmParamUpdateReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApWmmParamUpdateReqDes(u8 *buffer, size_t length) void* CsrWifiNmeApWmmParamUpdateReqDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApWmmParamUpdateReq *primitive = (CsrWifiNmeApWmmParamUpdateReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApWmmParamUpdateReq)); CsrWifiNmeApWmmParamUpdateReq *primitive = kmalloc(sizeof(CsrWifiNmeApWmmParamUpdateReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -699,7 +699,7 @@ u8* CsrWifiNmeApStaRemoveReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -699,7 +699,7 @@ u8* CsrWifiNmeApStaRemoveReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApStaRemoveReqDes(u8 *buffer, size_t length) void* CsrWifiNmeApStaRemoveReqDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApStaRemoveReq *primitive = (CsrWifiNmeApStaRemoveReq *) CsrPmemAlloc(sizeof(CsrWifiNmeApStaRemoveReq)); CsrWifiNmeApStaRemoveReq *primitive = kmalloc(sizeof(CsrWifiNmeApStaRemoveReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -736,7 +736,7 @@ u8* CsrWifiNmeApWpsRegisterCfmSer(u8 *ptr, size_t *len, void *msg) ...@@ -736,7 +736,7 @@ u8* CsrWifiNmeApWpsRegisterCfmSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApWpsRegisterCfmDes(u8 *buffer, size_t length) void* CsrWifiNmeApWpsRegisterCfmDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApWpsRegisterCfm *primitive = (CsrWifiNmeApWpsRegisterCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApWpsRegisterCfm)); CsrWifiNmeApWpsRegisterCfm *primitive = kmalloc(sizeof(CsrWifiNmeApWpsRegisterCfm), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -776,7 +776,7 @@ u8* CsrWifiNmeApStartCfmSer(u8 *ptr, size_t *len, void *msg) ...@@ -776,7 +776,7 @@ u8* CsrWifiNmeApStartCfmSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApStartCfmDes(u8 *buffer, size_t length) void* CsrWifiNmeApStartCfmDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApStartCfm *primitive = (CsrWifiNmeApStartCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApStartCfm)); CsrWifiNmeApStartCfm *primitive = kmalloc(sizeof(CsrWifiNmeApStartCfm), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -814,7 +814,7 @@ u8* CsrWifiNmeApStopCfmSer(u8 *ptr, size_t *len, void *msg) ...@@ -814,7 +814,7 @@ u8* CsrWifiNmeApStopCfmSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApStopCfmDes(u8 *buffer, size_t length) void* CsrWifiNmeApStopCfmDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApStopCfm *primitive = (CsrWifiNmeApStopCfm *) CsrPmemAlloc(sizeof(CsrWifiNmeApStopCfm)); CsrWifiNmeApStopCfm *primitive = kmalloc(sizeof(CsrWifiNmeApStopCfm), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -852,7 +852,7 @@ u8* CsrWifiNmeApStopIndSer(u8 *ptr, size_t *len, void *msg) ...@@ -852,7 +852,7 @@ u8* CsrWifiNmeApStopIndSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApStopIndDes(u8 *buffer, size_t length) void* CsrWifiNmeApStopIndDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApStopInd *primitive = (CsrWifiNmeApStopInd *) CsrPmemAlloc(sizeof(CsrWifiNmeApStopInd)); CsrWifiNmeApStopInd *primitive = kmalloc(sizeof(CsrWifiNmeApStopInd), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -893,7 +893,7 @@ u8* CsrWifiNmeApStationIndSer(u8 *ptr, size_t *len, void *msg) ...@@ -893,7 +893,7 @@ u8* CsrWifiNmeApStationIndSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiNmeApStationIndDes(u8 *buffer, size_t length) void* CsrWifiNmeApStationIndDes(u8 *buffer, size_t length)
{ {
CsrWifiNmeApStationInd *primitive = (CsrWifiNmeApStationInd *) CsrPmemAlloc(sizeof(CsrWifiNmeApStationInd)); CsrWifiNmeApStationInd *primitive = kmalloc(sizeof(CsrWifiNmeApStationInd), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
......
This diff is collapsed.
...@@ -99,7 +99,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -99,7 +99,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketCancelReqCreate(msg__, dst__, src__, interfaceTag__, hostTag__, priority__, peerMacAddress__) \ #define CsrWifiRouterMaPacketCancelReqCreate(msg__, dst__, src__, interfaceTag__, hostTag__, priority__, peerMacAddress__) \
msg__ = (CsrWifiRouterMaPacketCancelReq *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketCancelReq)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketCancelReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_CANCEL_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_CANCEL_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->hostTag = (hostTag__); \ msg__->hostTag = (hostTag__); \
...@@ -149,7 +149,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -149,7 +149,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, frameLength__, frame__, freeFunction__, priority__, hostTag__, cfmRequested__) \ #define CsrWifiRouterMaPacketReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, frameLength__, frame__, freeFunction__, priority__, hostTag__, cfmRequested__) \
msg__ = (CsrWifiRouterMaPacketReq *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketReq)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \ msg__->subscriptionHandle = (subscriptionHandle__); \
...@@ -193,7 +193,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -193,7 +193,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketIndCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__, frameLength__, frame__, freeFunction__, rssi__, snr__, rate__) \ #define CsrWifiRouterMaPacketIndCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__, frameLength__, frame__, freeFunction__, rssi__, snr__, rate__) \
msg__ = (CsrWifiRouterMaPacketInd *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketInd)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketInd), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_IND, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_IND, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \ msg__->subscriptionHandle = (subscriptionHandle__); \
...@@ -231,7 +231,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -231,7 +231,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketResCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__) \ #define CsrWifiRouterMaPacketResCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, result__) \
msg__ = (CsrWifiRouterMaPacketRes *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketRes)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketRes), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_RES, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_RES, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \ msg__->subscriptionHandle = (subscriptionHandle__); \
...@@ -265,7 +265,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -265,7 +265,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketCfmCreate(msg__, dst__, src__, interfaceTag__, result__, hostTag__, rate__) \ #define CsrWifiRouterMaPacketCfmCreate(msg__, dst__, src__, interfaceTag__, result__, hostTag__, rate__) \
msg__ = (CsrWifiRouterMaPacketCfm *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketCfm)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->result = (result__); \ msg__->result = (result__); \
...@@ -306,7 +306,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -306,7 +306,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketSubscribeReqCreate(msg__, dst__, src__, interfaceTag__, encapsulation__, protocol__, oui__) \ #define CsrWifiRouterMaPacketSubscribeReqCreate(msg__, dst__, src__, interfaceTag__, encapsulation__, protocol__, oui__) \
msg__ = (CsrWifiRouterMaPacketSubscribeReq *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketSubscribeReq)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->encapsulation = (encapsulation__); \ msg__->encapsulation = (encapsulation__); \
...@@ -342,7 +342,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -342,7 +342,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketSubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, status__, allocOffset__) \ #define CsrWifiRouterMaPacketSubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__, status__, allocOffset__) \
msg__ = (CsrWifiRouterMaPacketSubscribeCfm *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketSubscribeCfm)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_SUBSCRIBE_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); \ msg__->subscriptionHandle = (subscriptionHandle__); \
...@@ -374,7 +374,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -374,7 +374,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketUnsubscribeReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__) \ #define CsrWifiRouterMaPacketUnsubscribeReqCreate(msg__, dst__, src__, interfaceTag__, subscriptionHandle__) \
msg__ = (CsrWifiRouterMaPacketUnsubscribeReq *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketUnsubscribeReq)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketUnsubscribeReq), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_REQ, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_REQ, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->subscriptionHandle = (subscriptionHandle__); msg__->subscriptionHandle = (subscriptionHandle__);
...@@ -405,7 +405,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR ...@@ -405,7 +405,7 @@ extern const char *CsrWifiRouterDownstreamPrimNames[CSR_WIFI_ROUTER_PRIM_DOWNSTR
*******************************************************************************/ *******************************************************************************/
#define CsrWifiRouterMaPacketUnsubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \ #define CsrWifiRouterMaPacketUnsubscribeCfmCreate(msg__, dst__, src__, interfaceTag__, status__) \
msg__ = (CsrWifiRouterMaPacketUnsubscribeCfm *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketUnsubscribeCfm)); \ msg__ = kmalloc(sizeof(CsrWifiRouterMaPacketUnsubscribeCfm), GFP_KERNEL); \
CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_CFM, dst__, src__); \ CsrWifiFsmEventInit(&msg__->common, CSR_WIFI_ROUTER_PRIM, CSR_WIFI_ROUTER_MA_PACKET_UNSUBSCRIBE_CFM, dst__, src__); \
msg__->interfaceTag = (interfaceTag__); \ msg__->interfaceTag = (interfaceTag__); \
msg__->status = (status__); msg__->status = (status__);
......
...@@ -52,7 +52,7 @@ u8* CsrWifiRouterMaPacketSubscribeReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -52,7 +52,7 @@ u8* CsrWifiRouterMaPacketSubscribeReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketSubscribeReqDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketSubscribeReqDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketSubscribeReq *primitive = (CsrWifiRouterMaPacketSubscribeReq *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketSubscribeReq)); CsrWifiRouterMaPacketSubscribeReq *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -106,7 +106,7 @@ u8* CsrWifiRouterMaPacketReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -106,7 +106,7 @@ u8* CsrWifiRouterMaPacketReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketReqDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketReqDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketReq *primitive = (CsrWifiRouterMaPacketReq *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketReq)); CsrWifiRouterMaPacketReq *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -116,7 +116,7 @@ void* CsrWifiRouterMaPacketReqDes(u8 *buffer, size_t length) ...@@ -116,7 +116,7 @@ void* CsrWifiRouterMaPacketReqDes(u8 *buffer, size_t length)
CsrUint16Des((u16 *) &primitive->frameLength, buffer, &offset); CsrUint16Des((u16 *) &primitive->frameLength, buffer, &offset);
if (primitive->frameLength) if (primitive->frameLength)
{ {
primitive->frame = (u8 *)CsrPmemAlloc(primitive->frameLength); primitive->frame = kmalloc(primitive->frameLength, GFP_KERNEL);
CsrMemCpyDes(primitive->frame, buffer, &offset, ((u16) (primitive->frameLength))); CsrMemCpyDes(primitive->frame, buffer, &offset, ((u16) (primitive->frameLength)));
} }
else else
...@@ -167,7 +167,7 @@ u8* CsrWifiRouterMaPacketResSer(u8 *ptr, size_t *len, void *msg) ...@@ -167,7 +167,7 @@ u8* CsrWifiRouterMaPacketResSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketResDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketResDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketRes *primitive = (CsrWifiRouterMaPacketRes *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketRes)); CsrWifiRouterMaPacketRes *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketRes), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -208,7 +208,7 @@ u8* CsrWifiRouterMaPacketCancelReqSer(u8 *ptr, size_t *len, void *msg) ...@@ -208,7 +208,7 @@ u8* CsrWifiRouterMaPacketCancelReqSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketCancelReqDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketCancelReqDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketCancelReq *primitive = (CsrWifiRouterMaPacketCancelReq *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketCancelReq)); CsrWifiRouterMaPacketCancelReq *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketCancelReq), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -250,7 +250,7 @@ u8* CsrWifiRouterMaPacketSubscribeCfmSer(u8 *ptr, size_t *len, void *msg) ...@@ -250,7 +250,7 @@ u8* CsrWifiRouterMaPacketSubscribeCfmSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketSubscribeCfmDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketSubscribeCfmDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketSubscribeCfm *primitive = (CsrWifiRouterMaPacketSubscribeCfm *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketSubscribeCfm)); CsrWifiRouterMaPacketSubscribeCfm *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketSubscribeCfm), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -288,7 +288,7 @@ u8* CsrWifiRouterMaPacketUnsubscribeCfmSer(u8 *ptr, size_t *len, void *msg) ...@@ -288,7 +288,7 @@ u8* CsrWifiRouterMaPacketUnsubscribeCfmSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketUnsubscribeCfmDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketUnsubscribeCfmDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketUnsubscribeCfm *primitive = (CsrWifiRouterMaPacketUnsubscribeCfm *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketUnsubscribeCfm)); CsrWifiRouterMaPacketUnsubscribeCfm *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketUnsubscribeCfm), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -328,7 +328,7 @@ u8* CsrWifiRouterMaPacketCfmSer(u8 *ptr, size_t *len, void *msg) ...@@ -328,7 +328,7 @@ u8* CsrWifiRouterMaPacketCfmSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketCfmDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketCfmDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketCfm *primitive = (CsrWifiRouterMaPacketCfm *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketCfm)); CsrWifiRouterMaPacketCfm *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketCfm), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -384,7 +384,7 @@ u8* CsrWifiRouterMaPacketIndSer(u8 *ptr, size_t *len, void *msg) ...@@ -384,7 +384,7 @@ u8* CsrWifiRouterMaPacketIndSer(u8 *ptr, size_t *len, void *msg)
void* CsrWifiRouterMaPacketIndDes(u8 *buffer, size_t length) void* CsrWifiRouterMaPacketIndDes(u8 *buffer, size_t length)
{ {
CsrWifiRouterMaPacketInd *primitive = (CsrWifiRouterMaPacketInd *) CsrPmemAlloc(sizeof(CsrWifiRouterMaPacketInd)); CsrWifiRouterMaPacketInd *primitive = kmalloc(sizeof(CsrWifiRouterMaPacketInd), GFP_KERNEL);
size_t offset; size_t offset;
offset = 0; offset = 0;
...@@ -395,7 +395,7 @@ void* CsrWifiRouterMaPacketIndDes(u8 *buffer, size_t length) ...@@ -395,7 +395,7 @@ void* CsrWifiRouterMaPacketIndDes(u8 *buffer, size_t length)
CsrUint16Des((u16 *) &primitive->frameLength, buffer, &offset); CsrUint16Des((u16 *) &primitive->frameLength, buffer, &offset);
if (primitive->frameLength) if (primitive->frameLength)
{ {
primitive->frame = (u8 *)CsrPmemAlloc(primitive->frameLength); primitive->frame = kmalloc(primitive->frameLength, GFP_KERNEL);
CsrMemCpyDes(primitive->frame, buffer, &offset, ((u16) (primitive->frameLength))); CsrMemCpyDes(primitive->frame, buffer, &offset, ((u16) (primitive->frameLength)));
} }
else else
......
...@@ -180,7 +180,7 @@ static void CsrWifiRouterTransportSerialiseAndSend(u16 primType, void* msg) ...@@ -180,7 +180,7 @@ static void CsrWifiRouterTransportSerialiseAndSend(u16 primType, void* msg)
msgSize = 6 + (msgEntry->sizeofFunc)((void*)msg); msgSize = 6 + (msgEntry->sizeofFunc)((void*)msg);
encodeBuffer = CsrPmemAlloc(msgSize); encodeBuffer = kmalloc(msgSize, GFP_KERNEL);
/* Encode PrimType */ /* Encode PrimType */
CsrUint16Ser(encodeBuffer, &encodeBufferLen, primType); CsrUint16Ser(encodeBuffer, &encodeBufferLen, primType);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*****************************************************************************/ *****************************************************************************/
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h>
#include "csr_pmem.h" #include "csr_pmem.h"
#include "csr_macro.h" #include "csr_macro.h"
#include "csr_msgconv.h" #include "csr_msgconv.h"
...@@ -125,7 +126,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventSer); ...@@ -125,7 +126,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventSer);
void* CsrWifiEventDes(u8 *buffer, size_t length) void* CsrWifiEventDes(u8 *buffer, size_t length)
{ {
CsrWifiFsmEvent *primitive = (CsrWifiFsmEvent *) CsrPmemAlloc(sizeof(CsrWifiFsmEvent)); CsrWifiFsmEvent *primitive = kmalloc(sizeof(CsrWifiFsmEvent), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->type, buffer, &offset); CsrUint16Des(&primitive->type, buffer, &offset);
...@@ -152,7 +153,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint8Ser); ...@@ -152,7 +153,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint8Ser);
void* CsrWifiEventCsrUint8Des(u8 *buffer, size_t length) void* CsrWifiEventCsrUint8Des(u8 *buffer, size_t length)
{ {
CsrWifiEventCsrUint8 *primitive = (CsrWifiEventCsrUint8 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint8)); CsrWifiEventCsrUint8 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint8), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset); CsrUint16Des(&primitive->common.type, buffer, &offset);
...@@ -182,7 +183,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16Ser); ...@@ -182,7 +183,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16Ser);
void* CsrWifiEventCsrUint16Des(u8 *buffer, size_t length) void* CsrWifiEventCsrUint16Des(u8 *buffer, size_t length)
{ {
CsrWifiEventCsrUint16 *primitive = (CsrWifiEventCsrUint16 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint16)); CsrWifiEventCsrUint16 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint16), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset); CsrUint16Des(&primitive->common.type, buffer, &offset);
...@@ -212,7 +213,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint32Ser); ...@@ -212,7 +213,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint32Ser);
void* CsrWifiEventCsrUint32Des(u8 *buffer, size_t length) void* CsrWifiEventCsrUint32Des(u8 *buffer, size_t length)
{ {
CsrWifiEventCsrUint32 *primitive = (CsrWifiEventCsrUint32 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint32)); CsrWifiEventCsrUint32 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint32), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset); CsrUint16Des(&primitive->common.type, buffer, &offset);
...@@ -242,7 +243,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16CsrUint8Ser); ...@@ -242,7 +243,7 @@ EXPORT_SYMBOL_GPL(CsrWifiEventCsrUint16CsrUint8Ser);
void* CsrWifiEventCsrUint16CsrUint8Des(u8 *buffer, size_t length) void* CsrWifiEventCsrUint16CsrUint8Des(u8 *buffer, size_t length)
{ {
CsrWifiEventCsrUint16CsrUint8 *primitive = (CsrWifiEventCsrUint16CsrUint8 *) CsrPmemAlloc(sizeof(CsrWifiEventCsrUint16CsrUint8)); CsrWifiEventCsrUint16CsrUint8 *primitive = kmalloc(sizeof(CsrWifiEventCsrUint16CsrUint8), GFP_KERNEL);
size_t offset = 0; size_t offset = 0;
CsrUint16Des(&primitive->common.type, buffer, &offset); CsrUint16Des(&primitive->common.type, buffer, &offset);
......
This diff is collapsed.
This diff is collapsed.
...@@ -1483,7 +1483,7 @@ unifi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -1483,7 +1483,7 @@ unifi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
break; break;
} }
pcli->snap_filter.protocols = CsrPmemAlloc(snap_filter.count * sizeof(u16)); pcli->snap_filter.protocols = kmalloc(snap_filter.count * sizeof(u16), GFP_KERNEL);
if (!pcli->snap_filter.protocols) { if (!pcli->snap_filter.protocols) {
r = -ENOMEM; r = -ENOMEM;
goto out; goto out;
......
...@@ -489,7 +489,7 @@ int unifi_putest_dl_fw_buff(unifi_priv_t *priv, unsigned char *arg) ...@@ -489,7 +489,7 @@ int unifi_putest_dl_fw_buff(unifi_priv_t *priv, unsigned char *arg)
} }
/* Buffer for kernel copy of the f/w image */ /* Buffer for kernel copy of the f/w image */
fw_buf = CsrPmemAlloc(fw_length); fw_buf = kmalloc(fw_length, GFP_KERNEL);
if (!fw_buf) { if (!fw_buf) {
unifi_error(priv, "unifi_putest_dl_fw_buff: malloc fail\n"); unifi_error(priv, "unifi_putest_dl_fw_buff: malloc fail\n");
return -ENOMEM; return -ENOMEM;
......
...@@ -141,7 +141,7 @@ void CsrWifiSmeScanResultsGetCfmHandler(void* drvpriv, CsrWifiFsmEvent* msg) ...@@ -141,7 +141,7 @@ void CsrWifiSmeScanResultsGetCfmHandler(void* drvpriv, CsrWifiFsmEvent* msg)
} }
/* Take a Copy of the scan Results :-) */ /* Take a Copy of the scan Results :-) */
scanCopy = CsrPmemAlloc(bytesRequired); scanCopy = kmalloc(bytesRequired, GFP_KERNEL);
memcpy(scanCopy, cfm->scanResults, sizeof(CsrWifiSmeScanResult) * cfm->scanResultsCount); memcpy(scanCopy, cfm->scanResults, sizeof(CsrWifiSmeScanResult) * cfm->scanResultsCount);
/* Take a Copy of the Info Elements AND update the scan result pointers */ /* Take a Copy of the Info Elements AND update the scan result pointers */
......
...@@ -105,15 +105,14 @@ ul_register_client(unifi_priv_t *priv, unsigned int configuration, ...@@ -105,15 +105,14 @@ ul_register_client(unifi_priv_t *priv, unsigned int configuration,
ul_clients[id].configuration = configuration; ul_clients[id].configuration = configuration;
/* Allocate memory for the reply signal.. */ /* Allocate memory for the reply signal.. */
ul_clients[id].reply_signal = (CSR_SIGNAL*) CsrPmemAlloc(sizeof(CSR_SIGNAL)); ul_clients[id].reply_signal = kmalloc(sizeof(CSR_SIGNAL), GFP_KERNEL);
if (ul_clients[id].reply_signal == NULL) { if (ul_clients[id].reply_signal == NULL) {
unifi_error(priv, "Failed to allocate reply signal for client.\n"); unifi_error(priv, "Failed to allocate reply signal for client.\n");
return NULL; return NULL;
} }
/* .. and the bulk data of the reply signal. */ /* .. and the bulk data of the reply signal. */
for (ref = 0; ref < UNIFI_MAX_DATA_REFERENCES; ref ++) { for (ref = 0; ref < UNIFI_MAX_DATA_REFERENCES; ref ++) {
ul_clients[id].reply_bulkdata[ref] = ul_clients[id].reply_bulkdata[ref] = kmalloc(sizeof(bulk_data_t), GFP_KERNEL);
(bulk_data_t*) CsrPmemAlloc(sizeof(bulk_data_t));
/* If allocation fails, free allocated memory. */ /* If allocation fails, free allocated memory. */
if (ul_clients[id].reply_bulkdata[ref] == NULL) { if (ul_clients[id].reply_bulkdata[ref] == NULL) {
for (; ref > 0; ref --) { for (; ref > 0; ref --) {
......
...@@ -411,7 +411,7 @@ uf_multicast_list_wq(struct work_struct *work) ...@@ -411,7 +411,7 @@ uf_multicast_list_wq(struct work_struct *work)
* Allocate a new list, need to free it later * Allocate a new list, need to free it later
* in unifi_mgt_multicast_address_cfm(). * in unifi_mgt_multicast_address_cfm().
*/ */
multicast_address_list = CsrPmemAlloc(mc_count * sizeof(CsrWifiMacAddress)); multicast_address_list = kmalloc(mc_count * sizeof(CsrWifiMacAddress), GFP_KERNEL);
if (multicast_address_list == NULL) { if (multicast_address_list == NULL) {
return; return;
...@@ -590,7 +590,7 @@ int unifi_cfg_packet_filters(unifi_priv_t *priv, unsigned char *arg) ...@@ -590,7 +590,7 @@ int unifi_cfg_packet_filters(unifi_priv_t *priv, unsigned char *arg)
priv->packet_filters.tclas_ies_length += sizeof(tclas_t); priv->packet_filters.tclas_ies_length += sizeof(tclas_t);
} }
if (priv->packet_filters.tclas_ies_length > 0) { if (priv->packet_filters.tclas_ies_length > 0) {
priv->filter_tclas_ies = CsrPmemAlloc(priv->packet_filters.tclas_ies_length); priv->filter_tclas_ies = kmalloc(priv->packet_filters.tclas_ies_length, GFP_KERNEL);
if (priv->filter_tclas_ies == NULL) { if (priv->filter_tclas_ies == NULL) {
return -ENOMEM; return -ENOMEM;
} }
...@@ -671,7 +671,7 @@ int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg) ...@@ -671,7 +671,7 @@ int unifi_cfg_wmm_addts(unifi_priv_t *priv, unsigned char *arg)
unifi_trace(priv, UDBG4, "addts: tid = 0x%x ie_length = %d\n", unifi_trace(priv, UDBG4, "addts: tid = 0x%x ie_length = %d\n",
addts_tid, addts_ie_length); addts_tid, addts_ie_length);
addts_ie = CsrPmemAlloc(addts_ie_length); addts_ie = kmalloc(addts_ie_length, GFP_KERNEL);
if (addts_ie == NULL) { if (addts_ie == NULL) {
unifi_error(priv, unifi_error(priv,
"unifi_cfg_wmm_addts: Failed to malloc %d bytes for addts_ie buffer\n", "unifi_cfg_wmm_addts: Failed to malloc %d bytes for addts_ie buffer\n",
...@@ -1209,7 +1209,7 @@ void uf_send_pkt_to_encrypt(struct work_struct *work) ...@@ -1209,7 +1209,7 @@ void uf_send_pkt_to_encrypt(struct work_struct *work)
pktBulkDataLength = interfacePriv->wapi_unicast_bulk_data.data_length; pktBulkDataLength = interfacePriv->wapi_unicast_bulk_data.data_length;
if (pktBulkDataLength > 0) { if (pktBulkDataLength > 0) {
pktBulkData = (u8 *)CsrPmemAlloc(pktBulkDataLength); pktBulkData = kmalloc(pktBulkDataLength, GFP_KERNEL);
memset(pktBulkData, 0, pktBulkDataLength); memset(pktBulkData, 0, pktBulkDataLength);
} else { } else {
unifi_error(priv, "uf_send_pkt_to_encrypt() : invalid buffer\n"); unifi_error(priv, "uf_send_pkt_to_encrypt() : invalid buffer\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment