Commit 927ac9d5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

staging: wilc1000: remove wilc_exported_buf.c



The config option, CONFIG_WILC1000_PREALLOCATE_DURING_SYSTEM_BOOT, was
never able to be set, so this file was never being built.  Also, as
WILC_PREALLOC_AT_BOOT was never being set in the build system, remove
all code framed by that symbol.

Cc: Johnny Kim <johnny.kim@atmel.com>
Cc: Rachel Kim <rachel.kim@atmel.com>
Cc: Dean Lee <dean.lee@atmel.com>
Cc: Chris Park <chris.park@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b2952d62
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
obj-$(CONFIG_WILC1000) += wilc1000.o
obj-$(CONFIG_WILC1000_PREALLOCATE_DURING_SYSTEM_BOOT) += wilc_exported_buf.o


ccflags-$(CONFIG_WILC1000_SDIO) += -DWILC_SDIO -DCOMPLEMENT_BOOT
ccflags-$(CONFIG_WILC1000_HW_OOB_INTR) += -DWILC_SDIO_IRQ_GPIO
@@ -16,9 +14,6 @@ ccflags-y += -I$(src)/ -D__CHECK_ENDIAN__ -DWILC_ASIC_A0 \
		-Wno-unused-function -DUSE_WIRELESS -DWILC_DEBUGFS
#ccflags-y += -DTCP_ACK_FILTER

ccflags-$(CONFIG_WILC1000_PREALLOCATE_DURING_SYSTEM_BOOT) += -DMEMORY_STATIC \
								-DWILC_PREALLOC_AT_BOOT

ccflags-$(CONFIG_WILC1000_PREALLOCATE_AT_LOADING_DRIVER) += -DMEMORY_STATIC \
								-DWILC_PREALLOC_AT_INSMOD

+0 −79
Original line number Diff line number Diff line
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/slab.h>

#define LINUX_RX_SIZE	(96 * 1024)
#define LINUX_TX_SIZE	(64 * 1024)
#define WILC1000_FW_SIZE (4 * 1024)

/*
 * Add necessary buffer pointers
 */
void *exported_g_tx_buf;
void *exported_g_rx_buf;
void *exported_g_fw_buf;

void *get_tx_buffer(void)
{
	return exported_g_tx_buf;
}
EXPORT_SYMBOL(get_tx_buffer);

void *get_rx_buffer(void)
{
	return exported_g_rx_buf;
}
EXPORT_SYMBOL(get_rx_buffer);

void *get_fw_buffer(void)
{
	return exported_g_fw_buf;
}
EXPORT_SYMBOL(get_fw_buffer);

static int __init wilc_module_init(void)
{
	printk("wilc_module_init\n");
	/*
	 * alloc necessary memory
	 */
	exported_g_tx_buf = kmalloc(LINUX_TX_SIZE, GFP_KERNEL);
	if (!exported_g_tx_buf)
		return -ENOMEM;

	exported_g_rx_buf = kmalloc(LINUX_RX_SIZE, GFP_KERNEL);
	if (!exported_g_rx_buf)
		goto free_g_tx_buf;

	exported_g_fw_buf = kmalloc(WILC1000_FW_SIZE, GFP_KERNEL);
	if (!exported_g_fw_buf)
		goto free_g_rx_buf;

	return 0;

free_g_rx_buf:
	kfree(exported_g_rx_buf);
	exported_g_rx_buf = NULL;

free_g_tx_buf:
	kfree(exported_g_tx_buf);
	exported_g_tx_buf = NULL;

	return -ENOMEM;
}

static void __exit wilc_module_deinit(void)
{
	printk("wilc_module_deinit\n");
	kfree(exported_g_tx_buf);
	kfree(exported_g_rx_buf);
	kfree(exported_g_fw_buf);
}

MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Tony Cho");
MODULE_DESCRIPTION("WILC1xxx Memory Manager");
pure_initcall(wilc_module_init);
module_exit(wilc_module_deinit);
+0 −37
Original line number Diff line number Diff line
@@ -1517,15 +1517,7 @@ static int wilc_wlan_firmware_download(const uint8_t *buffer, uint32_t buffer_si
	blksz = (1ul << 12); /* Bug 4703: 4KB Good enough size for most platforms = PAGE_SIZE. */
	/* Allocate a DMA coherent  buffer. */

#if (defined WILC_PREALLOC_AT_BOOT)
	{
		extern void *get_fw_buffer(void);
		dma_buffer = (uint8_t *)get_fw_buffer();
		PRINT_D(TX_DBG, "fw_buffer = 0x%x\n", dma_buffer);
	}
#else
	dma_buffer = (uint8_t *)g_wlan.os_func.os_malloc(blksz);
#endif
	if (dma_buffer == NULL) {
		/*EIO	5*/
		ret = -5;
@@ -1575,12 +1567,8 @@ static int wilc_wlan_firmware_download(const uint8_t *buffer, uint32_t buffer_si

_fail_:

#if (defined WILC_PREALLOC_AT_BOOT)

#else
	if (dma_buffer)
		g_wlan.os_func.os_free(dma_buffer);
#endif

_fail_1:

@@ -1829,9 +1817,6 @@ static void wilc_wlan_cleanup(void)
	 *      clean up buffer
	 **/

#if (defined WILC_PREALLOC_AT_BOOT)

#else
	#ifdef MEMORY_STATIC
	if (p->rx_buffer) {
		p->os_func.os_free(p->rx_buffer);
@@ -1842,7 +1827,6 @@ static void wilc_wlan_cleanup(void)
		p->os_func.os_free(p->tx_buffer);
		p->tx_buffer = NULL;
	}
#endif

	acquire_bus(ACQUIRE_AND_WAKEUP);

@@ -2189,21 +2173,8 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
	/**
	 *      alloc tx, rx buffer
	 **/
#if (defined WILC_PREALLOC_AT_BOOT)
	extern void *get_tx_buffer(void);
	extern void *get_rx_buffer(void);

	PRINT_D(TX_DBG, "malloc before, g_wlan.tx_buffer = 0x%x, g_wlan.rx_buffer = 0x%x\n", g_wlan.tx_buffer, g_wlan.rx_buffer);
#endif



	if (g_wlan.tx_buffer == NULL)
#if (defined WILC_PREALLOC_AT_BOOT)
		g_wlan.tx_buffer = (uint8_t *)get_tx_buffer();
#else
		g_wlan.tx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.tx_buffer_size);
#endif
	PRINT_D(TX_DBG, "g_wlan.tx_buffer = %p\n", g_wlan.tx_buffer);

	if (g_wlan.tx_buffer == NULL) {
@@ -2216,11 +2187,7 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
/* 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)
  #if (defined WILC_PREALLOC_AT_BOOT)
		g_wlan.rx_buffer = (uint8_t *)get_rx_buffer();
  #else
		g_wlan.rx_buffer = (uint8_t *)g_wlan.os_func.os_malloc(g_wlan.rx_buffer_size);
  #endif
	PRINT_D(TX_DBG, "g_wlan.rx_buffer =%p\n", g_wlan.rx_buffer);
	if (g_wlan.rx_buffer == NULL) {
		/* ENOBUFS	105 */
@@ -2272,9 +2239,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)

_fail_:

#if (defined WILC_PREALLOC_AT_BOOT)

#else
  #ifdef MEMORY_STATIC
	if (g_wlan.rx_buffer) {
		g_wlan.os_func.os_free(g_wlan.rx_buffer);
@@ -2285,7 +2249,6 @@ int wilc_wlan_init(wilc_wlan_inp_t *inp, wilc_wlan_oup_t *oup)
		g_wlan.os_func.os_free(g_wlan.tx_buffer);
		g_wlan.tx_buffer = NULL;
	}
#endif

#if defined(PLAT_RK3026_TCHIP) /* AMR : 0422 RK3026 Crash issue */
	if (!g_wilc_initialized)