diff options
author | merge <null@invalid> | 2009-01-22 13:55:32 +0000 |
---|---|---|
committer | Andy Green <agreen@octopus.localdomain> | 2009-01-22 13:55:32 +0000 |
commit | aa6f5ffbdba45aa8e19e5048648fc6c7b25376d3 (patch) | |
tree | fbb786d0ac6f8a774fd834e9ce951197e60fbffa /drivers/staging/otus/wrap_mem.c | |
parent | f2d78193eae5dccd3d588d2c8ea0866efc368332 (diff) |
MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141
pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040
stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage:
From: merge <null@invalid>
MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch
mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage:
From: Andy Green <andy@openmoko.com>
fix-stray-endmenu.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/staging/otus/wrap_mem.c')
-rw-r--r-- | drivers/staging/otus/wrap_mem.c | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/drivers/staging/otus/wrap_mem.c b/drivers/staging/otus/wrap_mem.c new file mode 100644 index 00000000000..8081bb2f887 --- /dev/null +++ b/drivers/staging/otus/wrap_mem.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2007-2008 Atheros Communications Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ +/* Module Name : wrap_mem.c */ +/* */ +/* Abstract */ +/* This module contains wrapper functions for memory management */ +/* */ +/* NOTES */ +/* Platform dependent. */ +/* */ +/************************************************************************/ + +#include "oal_dt.h" +#include "usbdrv.h" + +#include <linux/netlink.h> + +#if WIRELESS_EXT > 12 +#include <net/iw_handler.h> +#endif + +/* Memory management */ +/* Called to allocate uncached memory, allocated memory must */ +/* in 4-byte boundary */ +void* zfwMemAllocate(zdev_t* dev, u32_t size) +{ + void* mem = NULL; + mem = kmalloc(size, GFP_ATOMIC); + return mem; +} + + +/* Called to free allocated memory */ +void zfwMemFree(zdev_t* dev, void* mem, u32_t size) +{ + kfree(mem); + return; +} + +void zfwMemoryCopy(u8_t* dst, u8_t* src, u16_t length) +{ + //u16_t i; + + memcpy(dst, src, length); + //for(i=0; i<length; i++) + //{ + // dst[i] = src[i]; + //} + return; +} + +void zfwZeroMemory(u8_t* va, u16_t length) +{ + //u16_t i; + memset(va, 0, length); + //for(i=0; i<length; i++) + //{ + // va[i] = 0; + //} + return; +} + +void zfwMemoryMove(u8_t* dst, u8_t* src, u16_t length) +{ + memcpy(dst, src, length); + return; +} + +u8_t zfwMemoryIsEqual(u8_t* m1, u8_t* m2, u16_t length) +{ + //u16_t i; + int ret; + + ret = memcmp(m1, m2, length); + + return ((ret==0)?TRUE:FALSE); + //for(i=0; i<length; i++) + //{ + // if ( m1[i] != m2[i] ) + // { + // return FALSE; + // } + //} + + //return TRUE; +} + +/* Leave an empty line below to remove warning message on some compiler */ |