mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
wifi: chang the static buf to support ap6356 [2/2]
PD#SWPL-12561 Problem: ap6356 open fail Solution: update static buf to fix it Verify: ampere Change-Id: Iec415b0dcf46b3e5574bcb3673d5129b4f35c802 Signed-off-by: Rongjun Chen <rongjun.chen@amlogic.com>
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
#include <linux/wlan_plat.h>
|
||||
#include <linux/amlogic/dhd_buf.h>
|
||||
|
||||
#define DHD_STATIC_VERSION_STR "1.579.77.41.9"
|
||||
#define DHD_STATIC_VERSION_STR "100.10.545.3"
|
||||
|
||||
#define BCMDHD_SDIO
|
||||
#define BCMDHD_PCIE
|
||||
@@ -56,7 +56,7 @@ enum dhd_prealloc_index {
|
||||
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_WL_WEXT_INFO = 19,
|
||||
DHD_PREALLOC_FW_VERBOSE_RING = 20,
|
||||
DHD_PREALLOC_FW_EVENT_RING = 21,
|
||||
DHD_PREALLOC_DHD_EVENT_RING = 22,
|
||||
@@ -66,16 +66,18 @@ enum dhd_prealloc_index {
|
||||
|
||||
#define STATIC_BUF_MAX_NUM 20
|
||||
#define STATIC_BUF_SIZE (PAGE_SIZE*2)
|
||||
|
||||
#define CUSTOM_LOG_DUMP_BUFSIZE_MB 4
|
||||
#define DHD_PREALLOC_PROT_SIZE (16 * 1024)
|
||||
#define DHD_PREALLOC_RXBUF_SIZE (24 * 1024)
|
||||
#define DHD_PREALLOC_DATABUF_SIZE (64 * 1024)
|
||||
#define DHD_PREALLOC_OSL_BUF_SIZE (STATIC_BUF_MAX_NUM * STATIC_BUF_SIZE)
|
||||
#define DHD_PREALLOC_WIPHY_ESCAN0_SIZE (64 * 1024)
|
||||
#define DHD_PREALLOC_DHD_INFO_SIZE (32 * 1024)
|
||||
#define DHD_PREALLOC_MEMDUMP_RAM_SIZE (1280 * 1024)
|
||||
#define DHD_PREALLOC_MEMDUMP_RAM_SIZE (1290 * 1024)
|
||||
#define DHD_PREALLOC_DHD_WLFC_HANGER_SIZE (73 * 1024)
|
||||
#define DHD_PREALLOC_WL_ESCAN_INFO_SIZE (67 * 1024)
|
||||
#define DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE (1024 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
|
||||
#define DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE (8 * 1024)
|
||||
#define DHD_PREALLOC_WL_WEXT_INFO_SIZE (70 * 1024)
|
||||
#ifdef CONFIG_64BIT
|
||||
#define DHD_PREALLOC_IF_FLOW_LKUP_SIZE (20 * 1024 * 2)
|
||||
#else
|
||||
@@ -92,7 +94,7 @@ enum dhd_prealloc_index {
|
||||
#define WLAN_DHD_IF_FLOW_LKUP_SIZE (64 * 1024)
|
||||
#else
|
||||
#define WLAN_DHD_INFO_BUF_SIZE (16 * 1024)
|
||||
#define WLAN_DHD_WLFC_BUF_SIZE (29 * 1024)
|
||||
#define WLAN_DHD_WLFC_BUF_SIZE (64 * 1024)
|
||||
#define WLAN_DHD_IF_FLOW_LKUP_SIZE (20 * 1024)
|
||||
#endif /* CONFIG_64BIT */
|
||||
#define WLAN_DHD_MEMDUMP_SIZE (800 * 1024)
|
||||
@@ -124,6 +126,8 @@ void *wlan_static_dhd_wlfc_info_buf;
|
||||
void *wlan_static_if_flow_lkup;
|
||||
void *wlan_static_dhd_memdump_ram_buf;
|
||||
void *wlan_static_dhd_wlfc_hanger_buf;
|
||||
void *wlan_static_dhd_log_dump_buf;
|
||||
void *wlan_static_dhd_log_dump_buf_ex;
|
||||
void *wlan_static_wl_escan_info_buf;
|
||||
void *wlan_static_fw_verbose_ring_buf;
|
||||
void *wlan_static_fw_event_ring_buf;
|
||||
@@ -208,10 +212,28 @@ void *bcmdhd_mem_prealloc(int section, unsigned long size)
|
||||
}
|
||||
return wlan_static_dhd_wlfc_hanger_buf;
|
||||
}
|
||||
if (section == DHD_PREALLOC_WL_ESCAN_INFO) {
|
||||
if (size > DHD_PREALLOC_WL_ESCAN_INFO_SIZE) {
|
||||
pr_err("request DHD_PREALLOC_WL_ESCAN_INFO_SIZE(%lu) > %d\n",
|
||||
size, DHD_PREALLOC_WL_ESCAN_INFO_SIZE);
|
||||
if (section == DHD_PREALLOC_DHD_LOG_DUMP_BUF) {
|
||||
if (size > DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE) {
|
||||
pr_err("request DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE(%lu) > %d\n",
|
||||
size, DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return wlan_static_dhd_log_dump_buf;
|
||||
}
|
||||
if (section == DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX) {
|
||||
if (size > DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE) {
|
||||
pr_err("request DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE(%lu) > %d\n",
|
||||
size, DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return wlan_static_dhd_log_dump_buf_ex;
|
||||
}
|
||||
if (section == DHD_PREALLOC_WL_WEXT_INFO) {
|
||||
if (size > DHD_PREALLOC_WL_WEXT_INFO_SIZE) {
|
||||
pr_err("request DHD_PREALLOC_WL_WEXT_INFO_SIZE(%lu) > %d\n",
|
||||
size, DHD_PREALLOC_WL_WEXT_INFO_SIZE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -257,8 +279,8 @@ void *bcmdhd_mem_prealloc(int section, unsigned long size)
|
||||
pr_err("request section id(%d) is out of max index %d\n",
|
||||
section, DHD_PREALLOC_MAX);
|
||||
|
||||
pr_err("failed to alloc section %d, size=%ld\n",
|
||||
section, size);
|
||||
pr_err("%s: failed to alloc section %d, size=%ld\n",
|
||||
__func__, section, size);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -268,8 +290,7 @@ int bcmdhd_init_wlan_mem(void)
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
|
||||
pr_info("bcmdhd_init_wlan_mem %s\n", DHD_STATIC_VERSION_STR);
|
||||
pr_info("%s(): %s\n", __func__, DHD_STATIC_VERSION_STR);
|
||||
|
||||
for (i = 0; i < DHD_SKB_1PAGE_BUF_NUM; i++) {
|
||||
wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE);
|
||||
@@ -307,62 +328,57 @@ int bcmdhd_init_wlan_mem(void)
|
||||
if (!wlan_static_osl_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_scan_buf0 = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_scan_buf0 = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_scan_buf0)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_dhd_info_buf = kmalloc(DHD_PREALLOC_DHD_INFO_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_dhd_info_buf = kmalloc(DHD_PREALLOC_DHD_INFO_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_dhd_info_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_dhd_wlfc_info_buf = kmalloc(WLAN_DHD_WLFC_BUF_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_dhd_wlfc_info_buf = kmalloc(WLAN_DHD_WLFC_BUF_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_dhd_wlfc_info_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
#ifdef BCMDHD_PCIE
|
||||
wlan_static_if_flow_lkup = kmalloc(DHD_PREALLOC_IF_FLOW_LKUP_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_if_flow_lkup = kmalloc(DHD_PREALLOC_IF_FLOW_LKUP_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_if_flow_lkup)
|
||||
goto err_mem_alloc;
|
||||
#endif /* BCMDHD_PCIE */
|
||||
|
||||
wlan_static_dhd_memdump_ram_buf = kmalloc(DHD_PREALLOC_MEMDUMP_RAM_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_dhd_memdump_ram_buf = kmalloc(DHD_PREALLOC_MEMDUMP_RAM_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_dhd_memdump_ram_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_dhd_wlfc_hanger_buf = kmalloc(
|
||||
DHD_PREALLOC_DHD_WLFC_HANGER_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_dhd_wlfc_hanger_buf = kmalloc(DHD_PREALLOC_DHD_WLFC_HANGER_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_dhd_wlfc_hanger_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_wl_escan_info_buf = kmalloc(DHD_PREALLOC_WL_ESCAN_INFO_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_dhd_log_dump_buf = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_dhd_log_dump_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_dhd_log_dump_buf_ex = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_dhd_log_dump_buf_ex)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_wl_escan_info_buf = kmalloc(DHD_PREALLOC_WL_WEXT_INFO_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_wl_escan_info_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_fw_verbose_ring_buf = kmalloc(
|
||||
FW_VERBOSE_RING_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_fw_verbose_ring_buf = kmalloc(FW_VERBOSE_RING_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_fw_verbose_ring_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_fw_event_ring_buf = kmalloc(FW_EVENT_RING_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_fw_event_ring_buf = kmalloc(FW_EVENT_RING_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_fw_event_ring_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_dhd_event_ring_buf = kmalloc(DHD_EVENT_RING_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_dhd_event_ring_buf = kmalloc(DHD_EVENT_RING_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_dhd_event_ring_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
wlan_static_nan_event_ring_buf = kmalloc(NAN_EVENT_RING_SIZE,
|
||||
GFP_KERNEL);
|
||||
wlan_static_nan_event_ring_buf = kmalloc(NAN_EVENT_RING_SIZE, GFP_KERNEL);
|
||||
if (!wlan_static_nan_event_ring_buf)
|
||||
goto err_mem_alloc;
|
||||
|
||||
@@ -371,35 +387,72 @@ int bcmdhd_init_wlan_mem(void)
|
||||
|
||||
err_mem_alloc:
|
||||
|
||||
kfree(wlan_static_prot);
|
||||
if (wlan_static_prot)
|
||||
kfree(wlan_static_prot);
|
||||
|
||||
#if defined(BCMDHD_SDIO)
|
||||
kfree(wlan_static_rxbuf);
|
||||
kfree(wlan_static_databuf);
|
||||
if (wlan_static_rxbuf)
|
||||
kfree(wlan_static_rxbuf);
|
||||
|
||||
if (wlan_static_databuf)
|
||||
kfree(wlan_static_databuf);
|
||||
#endif /* BCMDHD_SDIO */
|
||||
kfree(wlan_static_osl_buf);
|
||||
kfree(wlan_static_scan_buf0);
|
||||
kfree(wlan_static_scan_buf1);
|
||||
kfree(wlan_static_dhd_info_buf);
|
||||
kfree(wlan_static_dhd_wlfc_info_buf);
|
||||
|
||||
if (wlan_static_osl_buf)
|
||||
kfree(wlan_static_osl_buf);
|
||||
|
||||
if (wlan_static_scan_buf0)
|
||||
kfree(wlan_static_scan_buf0);
|
||||
|
||||
if (wlan_static_scan_buf1)
|
||||
kfree(wlan_static_scan_buf1);
|
||||
|
||||
if (wlan_static_dhd_info_buf)
|
||||
kfree(wlan_static_dhd_info_buf);
|
||||
|
||||
if (wlan_static_dhd_wlfc_info_buf)
|
||||
kfree(wlan_static_dhd_wlfc_info_buf);
|
||||
|
||||
#ifdef BCMDHD_PCIE
|
||||
kfree(wlan_static_if_flow_lkup);
|
||||
#endif /* BCMDHD_PCIE */
|
||||
kfree(wlan_static_dhd_memdump_ram_buf);
|
||||
kfree(wlan_static_dhd_wlfc_hanger_buf);
|
||||
kfree(wlan_static_wl_escan_info_buf);
|
||||
#ifdef BCMDHD_PCIE
|
||||
kfree(wlan_static_fw_verbose_ring_buf);
|
||||
kfree(wlan_static_fw_event_ring_buf);
|
||||
kfree(wlan_static_dhd_event_ring_buf);
|
||||
kfree(wlan_static_nan_event_ring_buf);
|
||||
if (wlan_static_if_flow_lkup)
|
||||
kfree(wlan_static_if_flow_lkup);
|
||||
#endif /* BCMDHD_PCIE */
|
||||
|
||||
pr_err("Failed to mem_alloc for WLAN\n");
|
||||
if (wlan_static_dhd_memdump_ram_buf)
|
||||
kfree(wlan_static_dhd_memdump_ram_buf);
|
||||
|
||||
if (wlan_static_dhd_wlfc_hanger_buf)
|
||||
kfree(wlan_static_dhd_wlfc_hanger_buf);
|
||||
|
||||
if (wlan_static_dhd_log_dump_buf)
|
||||
kfree(wlan_static_dhd_log_dump_buf);
|
||||
|
||||
if (wlan_static_dhd_log_dump_buf_ex)
|
||||
kfree(wlan_static_dhd_log_dump_buf_ex);
|
||||
|
||||
if (wlan_static_wl_escan_info_buf)
|
||||
kfree(wlan_static_wl_escan_info_buf);
|
||||
|
||||
#ifdef BCMDHD_PCIE
|
||||
if (wlan_static_fw_verbose_ring_buf)
|
||||
kfree(wlan_static_fw_verbose_ring_buf);
|
||||
|
||||
if (wlan_static_fw_event_ring_buf)
|
||||
kfree(wlan_static_fw_event_ring_buf);
|
||||
|
||||
if (wlan_static_dhd_event_ring_buf)
|
||||
kfree(wlan_static_dhd_event_ring_buf);
|
||||
|
||||
if (wlan_static_nan_event_ring_buf)
|
||||
kfree(wlan_static_nan_event_ring_buf);
|
||||
#endif /* BCMDHD_PCIE */
|
||||
|
||||
pr_err("%s: Failed to mem_alloc for WLAN\n", __func__);
|
||||
|
||||
i = WLAN_SKB_BUF_NUM;
|
||||
|
||||
err_skb_alloc:
|
||||
pr_err("Failed to skb_alloc for WLAN\n");
|
||||
pr_err("%s: Failed to skb_alloc for WLAN\n", __func__);
|
||||
for (j = 0; j < i; j++)
|
||||
dev_kfree_skb(wlan_static_skb[j]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user