return (void *)pntr;
}
-static void *linux_wlan_malloc(uint32_t sz)
-{
- char *pntr = NULL;
-
- pntr = kmalloc(sz, GFP_KERNEL);
- PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", sz, pntr);
- return (void *)pntr;
-}
-
void linux_wlan_free(void *vp)
{
if (vp != NULL) {
nwi->os_func.os_sleep = linux_wlan_msleep;
nwi->os_func.os_atomic_sleep = linux_wlan_atomic_msleep;
nwi->os_func.os_debug = linux_wlan_dbg;
- nwi->os_func.os_malloc = linux_wlan_malloc;
nwi->os_func.os_malloc_atomic = linux_wlan_malloc_atomic;
nwi->os_func.os_free = linux_wlan_free;
nwi->os_func.os_lock = linux_wlan_lock;
}
#else
- buffer = p->os_func.os_malloc(size);
+ buffer = kmalloc(size, GFP_KERNEL);
if (buffer == NULL) {
wilc_debug(N_ERR, "[wilc isr]: fail alloc host memory...drop the packets (%d)\n", size);
usleep_range(100 * 1000, 100 * 1000);
/**
* add to rx queue
**/
- rqe = (struct rxq_entry_t *)p->os_func.os_malloc(sizeof(struct rxq_entry_t));
+ rqe = kmalloc(sizeof(struct rxq_entry_t), GFP_KERNEL);
if (rqe != NULL) {
rqe->buffer = buffer;
rqe->buffer_size = size;
blksz = (1ul << 12); /* Bug 4703: 4KB Good enough size for most platforms = PAGE_SIZE. */
/* Allocate a DMA coherent buffer. */
- dma_buffer = (uint8_t *)g_wlan.os_func.os_malloc(blksz);
+ dma_buffer = kmalloc(blksz, GFP_KERNEL);
if (dma_buffer == NULL) {
/*EIO 5*/
ret = -5;
* alloc tx, rx buffer
**/
if (g_wlan.tx_buffer == NULL)
- g_wlan.tx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.tx_buffer_size);
+ g_wlan.tx_buffer = kmalloc(g_wlan.tx_buffer_size, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);
if (g_wlan.tx_buffer == NULL) {
/* rx_buffer is not used unless we activate USE_MEM STATIC which is not applicable, allocating such memory is useless*/
#if defined (MEMORY_STATIC)
if (g_wlan.rx_buffer == NULL)
- g_wlan.rx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.rx_buffer_size);
+ g_wlan.rx_buffer = kmalloc(g_wlan.rx_buffer_size, GFP_KERNEL);
PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer);
if (g_wlan.rx_buffer == NULL) {
/* ENOBUFS 105 */