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_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 {
#endif /* MACOSX_DHD */
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 = bcm_wlan_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
}
uint8
return BCME_NOMEM;
ret = dhd_dbg_ring_init(dhdp, &dbg->dbg_rings[FW_VERBOSE_RING_ID], FW_VERBOSE_RING_ID,
- (uint8 *)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,
- (uint8 *)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,
- (uint8 *)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,
- (uint8 *)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* bcm_wlan_prealloc(int section, unsigned long size);
+#endif
#if !defined(OSL_SYSUPTIME)
#define OSL_SYSUPTIME() (0)
#define OSL_SYSUPTIME_SUPPORT FALSE
#include <typedefs.h>
#include <linuxver.h>
#include <osl.h>
-
#include <bcmutils.h>
#include <bcmendian.h>
#include <ethernet.h>
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 = bcm_wlan_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));