added 2.6.29.6 aldebaran kernel
[nao-ulib.git] / kernel / 2.6.29.6-aldebaran-rt / drivers / staging / otus / wrap_mem.c
blob8081bb2f8878956be24d1dba8f2424228bbda79e
1 /*
2 * Copyright (c) 2007-2008 Atheros Communications Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 /* Module Name : wrap_mem.c */
17 /* */
18 /* Abstract */
19 /* This module contains wrapper functions for memory management */
20 /* */
21 /* NOTES */
22 /* Platform dependent. */
23 /* */
24 /************************************************************************/
26 #include "oal_dt.h"
27 #include "usbdrv.h"
29 #include <linux/netlink.h>
31 #if WIRELESS_EXT > 12
32 #include <net/iw_handler.h>
33 #endif
35 /* Memory management */
36 /* Called to allocate uncached memory, allocated memory must */
37 /* in 4-byte boundary */
38 void* zfwMemAllocate(zdev_t* dev, u32_t size)
40 void* mem = NULL;
41 mem = kmalloc(size, GFP_ATOMIC);
42 return mem;
46 /* Called to free allocated memory */
47 void zfwMemFree(zdev_t* dev, void* mem, u32_t size)
49 kfree(mem);
50 return;
53 void zfwMemoryCopy(u8_t* dst, u8_t* src, u16_t length)
55 //u16_t i;
57 memcpy(dst, src, length);
58 //for(i=0; i<length; i++)
59 //{
60 // dst[i] = src[i];
61 //}
62 return;
65 void zfwZeroMemory(u8_t* va, u16_t length)
67 //u16_t i;
68 memset(va, 0, length);
69 //for(i=0; i<length; i++)
70 //{
71 // va[i] = 0;
72 //}
73 return;
76 void zfwMemoryMove(u8_t* dst, u8_t* src, u16_t length)
78 memcpy(dst, src, length);
79 return;
82 u8_t zfwMemoryIsEqual(u8_t* m1, u8_t* m2, u16_t length)
84 //u16_t i;
85 int ret;
87 ret = memcmp(m1, m2, length);
89 return ((ret==0)?TRUE:FALSE);
90 //for(i=0; i<length; i++)
91 //{
92 // if ( m1[i] != m2[i] )
93 // {
94 // return FALSE;
95 // }
96 //}
98 //return TRUE;
101 /* Leave an empty line below to remove warning message on some compiler */