# otherwise please remove it.
CONFIG_BCMDHD := m
+CONFIG_DHD_USE_STATIC_BUF := y
DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \
-DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DBCMFILEIMAGE \
DHD_PREALLOC_MEMDUMP_RAM = 11,
DHD_PREALLOC_DHD_WLFC_HANGER = 12,
DHD_PREALLOC_PKTID_MAP = 13,
- DHD_PREALLOC_PKTID_MAP_IOCTL = 14
+ DHD_PREALLOC_PKTID_MAP_IOCTL = 14,
+ DHD_PREALLOC_DHD_LOG_DUMP_BUF = 15,
+ DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX = 16,
+ DHD_PREALLOC_DHD_PKTLOG_DUMP_BUF = 17,
+ DHD_PREALLOC_STAT_REPORT_BUF = 18,
+ DHD_PREALLOC_WL_ESCAN_INFO = 19,
+ DHD_PREALLOC_FW_VERBOSE_RING = 20,
+ DHD_PREALLOC_FW_EVENT_RING = 21,
+ DHD_PREALLOC_DHD_EVENT_RING = 22,
+ DHD_PREALLOC_NAN_EVENT_RING = 23
};
enum dhd_dongledump_mode {
static int
dhd_dbg_ring_init(dhd_pub_t *dhdp, dhd_dbg_ring_t *ring, uint16 id, uint8 *name,
- uint32 ring_sz)
+ uint32 ring_sz, int section)
{
void *buf;
unsigned long flags;
-
+#ifdef CONFIG_DHD_USE_STATIC_BUF
+ buf = dhd_wlan_mem_prealloc(section, ring_sz);
+#else
buf = MALLOCZ(dhdp->osh, ring_sz);
+#endif
if (!buf)
return BCME_NOMEM;
dhd_os_spin_unlock(ring->lock, flags);
dhd_os_spin_lock_deinit(dhdp->osh, ring->lock);
-
+#ifndef CONFIG_DHD_USE_STATIC_BUF
MFREE(dhdp->osh, buf, ring_sz);
+#endif
}
/*
return BCME_NOMEM;
ret = dhd_dbg_ring_init(dhdp, &dbg->dbg_rings[FW_VERBOSE_RING_ID], FW_VERBOSE_RING_ID,
- FW_VERBOSE_RING_NAME, FW_VERBOSE_RING_SIZE);
+ (uint8 *)FW_VERBOSE_RING_NAME, FW_VERBOSE_RING_SIZE, DHD_PREALLOC_FW_VERBOSE_RING);
if (ret)
goto error;
ret = dhd_dbg_ring_init(dhdp, &dbg->dbg_rings[FW_EVENT_RING_ID], FW_EVENT_RING_ID,
- FW_EVENT_RING_NAME, FW_EVENT_RING_SIZE);
+ (uint8 *)FW_EVENT_RING_NAME, FW_EVENT_RING_SIZE, DHD_PREALLOC_FW_EVENT_RING);
if (ret)
goto error;
ret = dhd_dbg_ring_init(dhdp, &dbg->dbg_rings[DHD_EVENT_RING_ID], DHD_EVENT_RING_ID,
- DHD_EVENT_RING_NAME, DHD_EVENT_RING_SIZE);
+ (uint8 *)DHD_EVENT_RING_NAME, DHD_EVENT_RING_SIZE, DHD_PREALLOC_DHD_EVENT_RING);
if (ret)
goto error;
ret = dhd_dbg_ring_init(dhdp, &dbg->dbg_rings[NAN_EVENT_RING_ID], NAN_EVENT_RING_ID,
- NAN_EVENT_RING_NAME, NAN_EVENT_RING_SIZE);
+ (uint8 *)NAN_EVENT_RING_NAME, NAN_EVENT_RING_SIZE, DHD_PREALLOC_NAN_EVENT_RING);
if (ret)
goto error;
#ifndef OR_REG
#define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v))
#endif /* !OR_REG */
-
+#ifdef CONFIG_DHD_USE_STATIC_BUF
+void* dhd_wlan_mem_prealloc(int section, unsigned long size);
+#endif
#if !defined(OSL_SYSUPTIME)
#define OSL_SYSUPTIME() (0)
#define OSL_SYSUPTIME_SUPPORT FALSE
#include <bcmendian.h>
#include <linuxver.h>
#include <bcmdefs.h>
-#include <asm-generic/pci-dma-compat.h>
#ifdef mips
#include <asm/paccess.h>
#include <asm/cache.h>
#include <bcmutils.h>
#include <linux/delay.h>
#include <pcicfg.h>
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 8, 0))
+#include <asm-generic/pci-dma-compat.h>
+#endif
#ifdef BCM_SECURE_DMA
kfree(escan->escan_ioctl_buf);
escan->escan_ioctl_buf = NULL;
}
-
+#ifndef CONFIG_DHD_USE_STATIC_BUF
kfree(escan);
+#endif
g_escan = NULL;
}
if (!dev)
return 0;
-
+#ifdef CONFIG_DHD_USE_STATIC_BUF
+ escan = dhd_wlan_mem_prealloc(DHD_PREALLOC_WL_ESCAN_INFO, sizeof(struct wl_escan_info));
+#else
escan = kmalloc(sizeof(struct wl_escan_info), GFP_KERNEL);
+#endif
if (!escan)
return -ENOMEM;
memset(escan, 0, sizeof(struct wl_escan_info));
DHD_GENERAL_LOCK(&dhd->pub, flags);
if (DHD_BUS_CHECK_SUSPEND_OR_SUSPEND_IN_PROGRESS(&dhd->pub)) {
- DHD_ERROR(("%s: bus is in suspend(%d) or suspending(0x%x) state!!\n",
- __FUNCTION__, dhd->pub.busstate, dhd->pub.dhd_bus_busy_state));
+ // DHD_ERROR(("%s: bus is in suspend(%d) or suspending(0x%x) state!!\n",
+ // __FUNCTION__, dhd->pub.busstate, dhd->pub.dhd_bus_busy_state));
DHD_BUS_BUSY_CLEAR_IN_TX(&dhd->pub);
#ifdef PCIE_FULL_DONGLE
/* Stop tx queues if suspend is in progress */
struct wl_bss_info *bi = NULL;
s32 i;
u32 channel;
-#if defined(DHD_DEBUG) && defined(DHD_FW_COREDUMP)
+/*#if defined(DHD_DEBUG) && defined(DHD_FW_COREDUMP)
dhd_pub_t *dhdp = (dhd_pub_t *)(cfg->pub);
uint32 prev_memdump_mode = dhdp->memdump_enabled;
-#endif /* DHD_DEBUG && DHD_FW_COREDUMP */
+#endif*/ /* DHD_DEBUG && DHD_FW_COREDUMP */
if (!(cfg->scan_request)) {
WL_ERR(("timer expired but no scan request\n"));
bzero(&msg, sizeof(wl_event_msg_t));
WL_ERR(("timer expired\n"));
-#if defined(DHD_DEBUG) && defined(DHD_FW_COREDUMP)
+/*#if defined(DHD_DEBUG) && defined(DHD_FW_COREDUMP)
if (dhdp->memdump_enabled) {
dhdp->memdump_enabled = DUMP_MEMFILE;
dhdp->memdump_type = DUMP_TYPE_SCAN_TIMEOUT;
dhd_bus_mem_dump(dhdp);
dhdp->memdump_enabled = prev_memdump_mode;
}
-#endif /* DHD_DEBUG && DHD_FW_COREDUMP */
+#endif*/
+ /* DHD_DEBUG && DHD_FW_COREDUMP */
msg.event_type = hton32(WLC_E_ESCAN_RESULT);
msg.status = hton32(WLC_E_STATUS_TIMEOUT);
msg.reason = 0xFFFFFFFF;
WL_DBG(("In\n"));
cfg->link_up = false;
- conn_info->req_ie_len = 0;
- conn_info->resp_ie_len = 0;
+ if (conn_info) {
+ conn_info->req_ie_len = 0;
+ conn_info->resp_ie_len = 0;
+ }
}
static unsigned long wl_lock_eq(struct bcm_cfg80211 *cfg)