wifi: update drive to load fw relative path [2/2]
authorjiabin.chen <jiabin.chen@amlogic.com>
Tue, 6 Dec 2022 06:10:10 +0000 (14:10 +0800)
committerBruno Martins <bgcngm@gmail.com>
Thu, 25 Apr 2024 17:39:34 +0000 (18:39 +0100)
PD#SWPL-101570

Problem:
dhd dirve load fw path is driver write to death

Solution:
update driver firmware path is insmod specified
the path is relative path

Verify:
t7

Change-Id: I51392f3df4236342889235cb9a3153771af7a373
Signed-off-by: jiabin.chen <jiabin.chen@amlogic.com>
12 files changed:
bcmdhd.101.10.361.x/Makefile
bcmdhd.101.10.361.x/dhd_config.c
bcmdhd.101.10.361.x/dhd_debug.c
bcmdhd.101.10.361.x/dhd_gpio.c
bcmdhd.101.10.361.x/dhd_pcie.c
bcmdhd.101.10.361.x/dhd_static_buf.c
bcmdhd.101.10.361.x/include/epivers.h
bcmdhd.101.10.361.x/wl_cfgvendor.c
bcmdhd.101.10.361.x/wl_cfgvendor.h
bcmdhd.101.10.361.x/wl_cfgvif.c
bcmdhd.101.10.361.x/wl_cfgvif.h
bcmdhd.101.10.361.x/wl_iapsta.c

index 49676525318d707efebfc3d18d001f7f5051fb43..1597855a3a63c2115ad3b8f3d397792a7b25e4b3 100755 (executable)
@@ -105,25 +105,25 @@ ifneq ($(CONFIG_CFG80211),)
        DHDCFLAGS += -DSPECIFIC_MAC_GEN_SCHEME
        DHDCFLAGS += -DWL_IFACE_MGMT
        DHDCFLAGS += -DSUPPORT_RSSI_SUM_REPORT
-       DHDCFLAGS += -DWLFBT -DWL_GCMP_SUPPORT
+       DHDCFLAGS += -DWLFBT -DWL_GCMP_SUPPORT -DWL_OWE
        DHDCFLAGS += -DROAM_CHANNEL_CACHE -DDHD_LOSSLESS_ROAMING -DWL_ROAM_WAR
 #      DHDCFLAGS += -DVNDR_IE_WAR -DGET_FW_IE_DATA
+#      DHDCFLAGS += -DWL_CFGVENDOR_SEND_HANG_EVENT
        DHDCFLAGS += -DGTK_OFFLOAD_SUPPORT
        DHDCFLAGS += -DRESTART_AP_WAR
        DHDCFLAGS += -DWL_STATIC_IF
-       DHDCFLAGS += -DWL_CLIENT_SAE -DWL_OWE
+       DHDCFLAGS += -DWL_CLIENT_SAE
 endif
 
 #BCMDHD_SDIO
 ifneq ($(CONFIG_BCMDHD_SDIO),)
 BUS_TYPE := sdio
-DHDCFLAGS += -DBCMSDIO -DMMC_SDIO_ABORT -DMMC_SW_RESET -DBCMLXSDMMC       \
-       -DUSE_SDIOFIFO_IOVAR -DSDTEST                                         \
-       -DBDC -DDHD_USE_IDLECOUNT -DCUSTOM_SDIO_F2_BLKSIZE=256                \
+DHDCFLAGS += -DBCMSDIO -DMMC_SDIO_ABORT -DUSE_SDIOFIFO_IOVAR -DBCMLXSDMMC \
+       -DSDTEST -DBDC -DDHD_USE_IDLECOUNT -DCUSTOM_SDIO_F2_BLKSIZE=256       \
        -DBCMSDIOH_TXGLOM -DBCMSDIOH_TXGLOM_EXT -DBCMSDIOH_STATIC_COPY_BUF    \
        -DRXFRAME_THREAD -DDHDENABLE_TAILPAD -DSUPPORT_P2P_GO_PS              \
        -DBCMSDIO_RXLIM_POST -DBCMSDIO_TXSEQ_SYNC -DCONSOLE_DPC               \
-       -DBCMSDIO_INTSTATUS_WAR
+       -DBCMSDIO_INTSTATUS_WAR -DMMC_SW_RESET -DMMC_HW_RESET
 ifeq ($(CONFIG_BCMDHD_OOB),y)
        DHDCFLAGS += -DOOB_INTR_ONLY -DCUSTOMER_OOB -DHW_OOB
 ifeq ($(CONFIG_BCMDHD_DISABLE_WOWLAN),y)
@@ -363,7 +363,7 @@ ifeq ($(CONFIG_BCMDHD_AUTO_SELECT),y)
        DHDCFLAGS += -DUPDATE_MODULE_NAME
 ifeq ($(CONFIG_BCMDHD_REQUEST_FW),y)
 #      DHDCFLAGS += -DFW_AMPAK_PATH="\"ampak\""
-       DHDCFLAGS += -DMODULE_PATH
+#      DHDCFLAGS += -DMODULE_PATH
 endif
 ifneq ($(CONFIG_BCMDHD_SDIO),)
        DHDCFLAGS += -DGET_OTP_MODULE_NAME -DCOMPAT_OLD_MODULE
@@ -395,6 +395,7 @@ endif
 
 ifeq ($(CONFIG_BCMDHD_REQUEST_FW),y)
        DHDCFLAGS += -DDHD_LINUX_STD_FW_API
+#      DHDCFLAGS += -DDHD_REQUEST_FW_PATH
        DHDCFLAGS += -DDHD_FW_NAME="\"fw_bcmdhd.bin\""
        DHDCFLAGS += -DDHD_NVRAM_NAME="\"nvram.txt\""
        DHDCFLAGS += -DDHD_CLM_NAME="\"clm_bcmdhd.blob\""
index 05008d2fa3c541617e1300749a1c891197861fe4..457e29bc60198ae2e1dd60626fb2f04bb722f981 100755 (executable)
@@ -1061,14 +1061,26 @@ dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *nv_path, int ag_type)
                strcat(name_ptr, ".txt");
 #ifdef COMPAT_OLD_MODULE
                if (dhd->conf->chip == BCM4359_CHIP_ID) {
-                       struct file *fp;
                        // compatible for AP6398S and AP6398SA
+#ifdef DHD_LINUX_STD_FW_API
+                       const struct firmware *nv = NULL;
+                       int ret = BCME_ERROR;
+                       ret = dhd_os_get_img_fwreq(&nv, nv_path);
+                       if (ret < 0) {
+                               strcpy(name_ptr, nv_name);
+                       }
+                       if (nv) {
+                               dhd_os_close_img_fwreq(nv);
+                       }
+#else
+                       struct file *fp;
                        fp = dhd_filp_open(nv_path, O_RDONLY, 0);
                        if (IS_ERR(fp) || (fp == NULL)) {
                                strcpy(name_ptr, nv_name);
                        } else {
                                dhd_filp_close((struct file *)fp, NULL);
                        }
+#endif
                }
 #endif
        }
@@ -1314,7 +1326,7 @@ dhd_conf_dump_tput_patch(dhd_pub_t *dhd)
 }
 #endif /* DHD_TPUT_PATCH */
 
-#ifdef DHD_LINUX_STD_FW_API
+#ifdef DHD_REQUEST_FW_PATH
 #define FIRMWARE_CLASS_PATH "/sys/module/firmware_class/parameters/path"
 static void
 dhd_conf_get_filename(char *pFilename)
@@ -1355,14 +1367,7 @@ dhd_conf_add_filepath(dhd_pub_t *dhd, char *pFilename)
                strcat(name_ptr, FW_AMPAK_PATH);
 #endif
 #ifdef MODULE_PATH
-#if defined(BCMSDIO) && defined(GET_OTP_MODULE_NAME)
-               if (strlen(dhd->conf->module_name))
-                       module_name = dhd->conf->module_name;
-               else
-#endif
-               {
-                       module_name = dhd_conf_get_module_name(dhd, DONT_CARE);
-               }
+               module_name = dhd_conf_get_module_name(dhd, DONT_CARE);
 #endif
                if (module_name) {
                        strcat(name_ptr, "/");
@@ -1375,7 +1380,7 @@ dhd_conf_add_filepath(dhd_pub_t *dhd, char *pFilename)
 
        return;
 }
-#endif /* DHD_LINUX_STD_FW_API */
+#endif /* DHD_REQUEST_FW_PATH */
 
 void
 dhd_conf_set_path_params(dhd_pub_t *dhd, char *fw_path, char *nv_path)
@@ -1385,7 +1390,7 @@ dhd_conf_set_path_params(dhd_pub_t *dhd, char *fw_path, char *nv_path)
        /* External conf takes precedence if specified */
        dhd_conf_preinit(dhd);
 
-#ifdef DHD_LINUX_STD_FW_API
+#ifdef DHD_REQUEST_FW_PATH
        // preprocess the filename to only left 'name'
        dhd_conf_get_filename(fw_path);
        dhd_conf_get_filename(nv_path);
@@ -1411,7 +1416,7 @@ dhd_conf_set_path_params(dhd_pub_t *dhd, char *fw_path, char *nv_path)
        dhd_conf_set_nv_name_by_mac(dhd, nv_path);
 #endif
 
-#ifdef DHD_LINUX_STD_FW_API
+#ifdef DHD_REQUEST_FW_PATH
        dhd_conf_add_filepath(dhd, fw_path);
        dhd_conf_add_filepath(dhd, nv_path);
        dhd_conf_add_filepath(dhd, dhd->clm_path);
index f8f6c92eedfda75821a283e2b5878a88c3cdf2f6..6ab232699f896e96ac68f6c7680f6b96734d287f 100755 (executable)
@@ -2049,6 +2049,7 @@ dhd_dbg_monitor_get_tx_pkts(dhd_pub_t *dhdp, void __user *user_buf,
        tx_report = dhdp->dbg->pkt_mon.tx_report;
        tx_pkt = tx_report->tx_pkts;
        pkt_count = MIN(req_count, tx_report->status_pos);
+       DHD_PKT_MON_UNLOCK(dhdp->dbg->pkt_mon_lock, flags);
 
 #ifdef CONFIG_COMPAT
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
@@ -2099,7 +2100,6 @@ dhd_dbg_monitor_get_tx_pkts(dhd_pub_t *dhdp, void __user *user_buf,
        }
        *resp_count = pkt_count;
 
-       DHD_PKT_MON_UNLOCK(dhdp->dbg->pkt_mon_lock, flags);
        if (!pkt_count) {
                DHD_ERROR(("%s(): no tx_status in tx completion messages, "
                        "make sure that 'd11status' is enabled in firmware, "
@@ -2143,6 +2143,7 @@ dhd_dbg_monitor_get_rx_pkts(dhd_pub_t *dhdp, void __user *user_buf,
        rx_report = dhdp->dbg->pkt_mon.rx_report;
        rx_pkt = rx_report->rx_pkts;
        pkt_count = MIN(req_count, rx_report->pkt_pos);
+       DHD_PKT_MON_UNLOCK(dhdp->dbg->pkt_mon_lock, flags);
 
 #ifdef CONFIG_COMPAT
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
@@ -2194,7 +2195,6 @@ dhd_dbg_monitor_get_rx_pkts(dhd_pub_t *dhdp, void __user *user_buf,
        }
 
        *resp_count = pkt_count;
-       DHD_PKT_MON_UNLOCK(dhdp->dbg->pkt_mon_lock, flags);
 
        return BCME_OK;
 }
index 85bb68dcef4320af44fd1be3d37c56107e694711..594afbb0155892083eaa7451c90eca52e4dfe658 100755 (executable)
@@ -58,9 +58,11 @@ extern void pci_remove_reinit(unsigned int vid, unsigned int pid, int delBus);
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
 extern int wifi_irq_num(void);
 #endif
+#ifdef BCMDBUS
 int dhd_pwr_ctrl = 1;
 module_param(dhd_pwr_ctrl, int, 0);
 #endif
+#endif
 
 static int
 dhd_wlan_set_power(int on, wifi_adapter_info_t *adapter)
@@ -69,7 +71,9 @@ dhd_wlan_set_power(int on, wifi_adapter_info_t *adapter)
        int err = 0;
 
 #ifdef CUSTOMER_HW_AMLOGIC
+#ifdef BCMDBUS
     printf("######### dhd_pwr_ctrl=%d #########\n", dhd_pwr_ctrl);
+#endif
 #endif
 
        if (on) {
@@ -125,7 +129,6 @@ dhd_wlan_set_power(int on, wifi_adapter_info_t *adapter)
 #endif /* BCMPCIE */
 #endif /* BUS_POWER_RESTORE */
                /* Lets customer power to get stable */
-               mdelay(100);
        } else {
 #ifdef BUS_POWER_RESTORE
 #ifdef BCMSDIO
index 5c1014449ba561b9cb77aeb784eba4e0c6825a70..c5f687a5f4f36e65e4860be7bf51d58185e8486d 100755 (executable)
@@ -1508,13 +1508,13 @@ dhdpcie_bus_isr(dhd_bus_t *bus)
                        }
                }
 
+#ifndef DHD_READ_INTSTATUS_IN_DPC
                if (bus->d2h_intr_method == PCIE_MSI &&
                                !dhd_conf_legacy_msi_chip(bus->dhd)) {
                        /* For MSI, as intstatus is cleared by firmware, no need to read */
                        goto skip_intstatus_read;
                }
 
-#ifndef DHD_READ_INTSTATUS_IN_DPC
                intstatus = dhdpcie_bus_intstatus(bus);
 
                /* Check if the interrupt is ours or not */
index 3d6662deea126b4bdf9ab13701427f43f94234e9..9bc63bfd5dd80ba0224e841be908eb7ae864c729 100755 (executable)
 #include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/skbuff.h>
-#include <linux/wlan_plat.h>
+#include <linux/amlogic/wlan_plat.h>
 #include <linux/amlogic/dhd_buf.h>
 
-#define        DHD_STATIC_VERSION_STR          "101.10.361.26 (wlan=r892223-20221011-1)"
+#define        DHD_STATIC_VERSION_STR          "101.10.361.28 (wlan=r892223-20221018-1)"
 #define STATIC_ERROR_LEVEL     BIT(0)
 #define STATIC_TRACE_LEVEL     BIT(1)
 #define STATIC_MSG_LEVEL       BIT(0)
 uint static_msg_level = STATIC_ERROR_LEVEL | STATIC_MSG_LEVEL;
 
 #define DHD_STATIC_MSG(x, args...) \
-       do { \
-               if (static_msg_level & STATIC_MSG_LEVEL) { \
-                       pr_err("[dhd] STATIC-MSG) %s : " x, __func__, ## args); \
-               } \
-       } while (0)
+do { \
+       if (static_msg_level & STATIC_MSG_LEVEL) { \
+               pr_err("[dhd] STATIC-MSG) %s : " x, __func__, ## args); \
+       } \
+} while (0)
 #define DHD_STATIC_ERROR(x, args...) \
-       do { \
-               if (static_msg_level & STATIC_ERROR_LEVEL) { \
-                       pr_err("[dhd] STATIC-ERROR) %s : " x, __func__, ## args); \
-               } \
-       } while (0)
+do { \
+       if (static_msg_level & STATIC_ERROR_LEVEL) { \
+               pr_err("[dhd] STATIC-ERROR) %s : " x, __func__, ## args); \
+       } \
+} while (0)
 #define DHD_STATIC_TRACE(x, args...) \
-       do { \
-               if (static_msg_level & STATIC_TRACE_LEVEL) { \
-                       pr_err("[dhd] STATIC-TRACE) %s : " x, __func__, ## args); \
-               } \
-       } while (0)
+do { \
+       if (static_msg_level & STATIC_TRACE_LEVEL) { \
+               pr_err("[dhd] STATIC-TRACE) %s : " x, __func__, ## args); \
+       } \
+} while (0)
 
 #ifdef DHD_STATIC_IN_DRIVER
 #if ANDROID_VERSION > 0
@@ -49,6 +49,7 @@ uint static_msg_level = STATIC_ERROR_LEVEL | STATIC_MSG_LEVEL;
 //#define BCMDBUS
 #define CONFIG_BCMDHD_VTS { : = y}
 #define CONFIG_BCMDHD_DEBUG { : = y}
+#define DHD_USE_STATIC_MEMDUMP { : = y}
 //#define BCMDHD_UNUSE_MEM
 #endif
 
@@ -82,10 +83,10 @@ enum dhd_prealloc_index {
 #endif /* BCMSDIO | BCMDBUS */
        DHD_PREALLOC_PKTID_MAP = 13,
        DHD_PREALLOC_PKTID_MAP_IOCTL = 14,
-#if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
+#ifdef DHD_USE_STATIC_MEMDUMP
        DHD_PREALLOC_DHD_LOG_DUMP_BUF = 15,
        DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX = 16,
-#endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
+#endif /* DHD_USE_STATIC_MEMDUMP */
        DHD_PREALLOC_DHD_PKTLOG_DUMP_BUF = 17,
        DHD_PREALLOC_STAT_REPORT_BUF = 18,
        DHD_PREALLOC_WL_ESCAN = 19,
@@ -116,10 +117,11 @@ enum dhd_prealloc_index {
 #define DHD_PREALLOC_MEMDUMP_RAM_SIZE  (1290 * 1024)
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
 #define DHD_PREALLOC_DHD_WLFC_HANGER_SIZE      (73 * 1024)
-#if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
-#define DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE (1024 * 1024 * CUSTOM_LOG_DUMP_BUFSIZE_MB)
+#ifdef DHD_USE_STATIC_MEMDUMP
+#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)
-#endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
+#endif /* DHD_USE_STATIC_MEMDUMP */
 #define DHD_PREALLOC_WL_ESCAN_SIZE     (70 * 1024)
 #ifdef CONFIG_64BIT
 #define DHD_PREALLOC_IF_FLOW_LKUP_SIZE (20 * 1024 * 2)
@@ -176,10 +178,10 @@ void *wlan_static_dhd_wlfc_info_buf[MAX_NUM_ADAPTERS] = {};
 void *wlan_static_if_flow_lkup[MAX_NUM_ADAPTERS] = {};
 void *wlan_static_dhd_memdump_ram_buf[MAX_NUM_ADAPTERS] = {};
 void *wlan_static_dhd_wlfc_hanger_buf[MAX_NUM_ADAPTERS] = {};
-#if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
+#ifdef DHD_USE_STATIC_MEMDUMP
 void *wlan_static_dhd_log_dump_buf[MAX_NUM_ADAPTERS] = {};
 void *wlan_static_dhd_log_dump_buf_ex[MAX_NUM_ADAPTERS] = {};
-#endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
+#endif /* DHD_USE_STATIC_MEMDUMP */
 void *wlan_static_wl_escan_info_buf[MAX_NUM_ADAPTERS] = {};
 void *wlan_static_fw_verbose_ring_buf[MAX_NUM_ADAPTERS] = {};
 void *wlan_static_fw_event_ring_buf[MAX_NUM_ADAPTERS] = {};
@@ -190,12 +192,11 @@ void *wlan_static_nan_event_ring_buf[MAX_NUM_ADAPTERS] = {};
 static struct sk_buff *wlan_static_skb[MAX_NUM_ADAPTERS][WLAN_SKB_BUF_NUM] = {};
 #endif /* BCMSDIO | BCMPCIE */
 
-void *
-bcmdhd_mem_prealloc(
 #if defined(BCMDHD_MDRIVER) && !defined(DHD_STATIC_IN_DRIVER)
-       uint bus_type, int index,
+void *bcmdhd_mem_prealloc(uint bus_type, int index, int section, unsigned long size)
+#else
+void *bcmdhd_mem_prealloc(int section, unsigned long size)
 #endif
-       int section, unsigned long size)
 {
 #if !defined(BCMDHD_MDRIVER) || defined(DHD_STATIC_IN_DRIVER)
        int index = 0;
@@ -287,7 +288,7 @@ bcmdhd_mem_prealloc(
                return wlan_static_dhd_wlfc_hanger_buf[index];
        }
 #endif /* BCMSDIO | BCMDBUS */
-#if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
+#ifdef DHD_USE_STATIC_MEMDUMP
        if (section == DHD_PREALLOC_DHD_LOG_DUMP_BUF) {
                if (size > DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE) {
                        DHD_STATIC_ERROR("request DHD_PREALLOC_DHD_LOG_DUMP_BUF(%lu) > %d\n",
@@ -304,7 +305,7 @@ bcmdhd_mem_prealloc(
                }
                return wlan_static_dhd_log_dump_buf_ex[index];
        }
-#endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
+#endif /* DHD_USE_STATIC_MEMDUMP */
        if (section == DHD_PREALLOC_WL_ESCAN) {
                if (size > DHD_PREALLOC_WL_ESCAN_SIZE) {
                        DHD_STATIC_ERROR("request DHD_PREALLOC_WL_ESCAN(%lu) > %d\n",
@@ -347,7 +348,7 @@ bcmdhd_mem_prealloc(
                return wlan_static_nan_event_ring_buf[index];
        }
 #endif /* BCMDHD_UNUSE_MEM */
-       if ((section < 0) || (section > DHD_PREALLOC_MAX))
+       if (section < 0 || section > DHD_PREALLOC_MAX)
                DHD_STATIC_ERROR("request section id(%d) is out of max index %d\n",
                        section, DHD_PREALLOC_MAX);
 
@@ -356,6 +357,7 @@ bcmdhd_mem_prealloc(
 
        return NULL;
 }
+
 #ifndef DHD_STATIC_IN_DRIVER
 EXPORT_SYMBOL(bcmdhd_mem_prealloc);
 #endif
@@ -367,59 +369,41 @@ dhd_deinit_wlan_mem(int index)
        int i;
 #endif /* BCMSDIO | BCMPCIE */
 
-       if (wlan_static_prot[index])
-               kfree(wlan_static_prot[index]);
+       kfree(wlan_static_prot[index]);
 #if defined(BCMSDIO)
-       if (wlan_static_rxbuf[index])
-               kfree(wlan_static_rxbuf[index]);
-       if (wlan_static_databuf[index])
-               kfree(wlan_static_databuf[index]);
+       kfree(wlan_static_rxbuf[index]);
+       kfree(wlan_static_databuf[index]);
 #endif /* BCMSDIO */
-       if (wlan_static_osl_buf[index])
-               kfree(wlan_static_osl_buf[index]);
-       if (wlan_static_scan_buf0[index])
-               kfree(wlan_static_scan_buf0[index]);
-       if (wlan_static_scan_buf1[index])
-               kfree(wlan_static_scan_buf1[index]);
-       if (wlan_static_dhd_info_buf[index])
-               kfree(wlan_static_dhd_info_buf[index]);
+       kfree(wlan_static_osl_buf[index]);
+       kfree(wlan_static_scan_buf0[index]);
+       kfree(wlan_static_scan_buf1[index]);
+       kfree(wlan_static_dhd_info_buf[index]);
 #if defined(BCMSDIO) || defined(BCMDBUS)
-       if (wlan_static_dhd_wlfc_info_buf[index])
-               kfree(wlan_static_dhd_wlfc_info_buf[index]);
+       kfree(wlan_static_dhd_wlfc_info_buf[index]);
 #endif /* BCMSDIO | BCMDBUS */
 #ifdef BCMPCIE
-       if (wlan_static_if_flow_lkup[index])
-               kfree(wlan_static_if_flow_lkup[index]);
+       kfree(wlan_static_if_flow_lkup[index]);
 #endif /* BCMPCIE */
 #if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
-       if (wlan_static_dhd_memdump_ram_buf[index])
-               kfree(wlan_static_dhd_memdump_ram_buf[index]);
+       kfree(wlan_static_dhd_memdump_ram_buf[index]);
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
 #if defined(BCMSDIO) || defined(BCMDBUS)
-       if (wlan_static_dhd_wlfc_hanger_buf[index])
-               kfree(wlan_static_dhd_wlfc_hanger_buf[index]);
+       kfree(wlan_static_dhd_wlfc_hanger_buf[index]);
 #endif /* BCMSDIO | BCMDBUS */
-#if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
-       if (wlan_static_dhd_log_dump_buf[index])
-               kfree(wlan_static_dhd_log_dump_buf[index]);
-       if (wlan_static_dhd_log_dump_buf_ex[index])
-               kfree(wlan_static_dhd_log_dump_buf_ex[index]);
-#endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
-       if (wlan_static_wl_escan_info_buf[index])
-               kfree(wlan_static_wl_escan_info_buf[index]);
-       if (wlan_static_fw_verbose_ring_buf[index])
-               kfree(wlan_static_fw_verbose_ring_buf[index]);
-       if (wlan_static_fw_event_ring_buf[index])
-               kfree(wlan_static_fw_event_ring_buf[index]);
-       if (wlan_static_dhd_event_ring_buf[index])
-               kfree(wlan_static_dhd_event_ring_buf[index]);
+#ifdef DHD_USE_STATIC_MEMDUMP
+       kfree(wlan_static_dhd_log_dump_buf[index]);
+       kfree(wlan_static_dhd_log_dump_buf_ex[index]);
+#endif /* DHD_USE_STATIC_MEMDUMP */
+       kfree(wlan_static_wl_escan_info_buf[index]);
+       kfree(wlan_static_fw_verbose_ring_buf[index]);
+       kfree(wlan_static_fw_event_ring_buf[index]);
+       kfree(wlan_static_dhd_event_ring_buf[index]);
 #if defined(BCMDHD_UNUSE_MEM)
-       if (wlan_static_nan_event_ring_buf[index])
-               kfree(wlan_static_nan_event_ring_buf[index]);
+       kfree(wlan_static_nan_event_ring_buf[index]);
 #endif /* BCMDHD_UNUSE_MEM */
 
 #if defined(BCMSDIO) || defined(BCMPCIE)
-       for (i=0; i<WLAN_SKB_BUF_NUM; i++) {
+       for (i = 0; i < WLAN_SKB_BUF_NUM; i++) {
                if (wlan_static_skb[index][i])
                        dev_kfree_skb(wlan_static_skb[index][i]);
        }
@@ -429,37 +413,37 @@ dhd_deinit_wlan_mem(int index)
 }
 
 static int
-dhd_init_wlan_mem(int index, unsigned int all_buf)
+dhd_init_wlan_mem(int index, unsigned int buf_level)
 {
 #if defined(BCMSDIO) || defined(BCMPCIE)
        int i;
 #endif
        unsigned long size = 0;
 
+       if (buf_level > 0) {
 #if defined(BCMSDIO) || defined(BCMPCIE)
-       for (i = 0; i < WLAN_SKB_BUF_NUM; i++)
-               wlan_static_skb[index][i] = NULL;
-
-       for (i = 0; i < DHD_SKB_1PAGE_BUF_NUM; i++) {
-               wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE);
-               if (!wlan_static_skb[index][i])
-                       goto err_mem_alloc;
-               size += DHD_SKB_1PAGE_BUFSIZE;
-               DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
-                       DHD_PREALLOC_SKB_BUF, i, DHD_SKB_1PAGE_BUFSIZE);
-       }
-
-       for (i = DHD_SKB_1PAGE_BUF_NUM; i < WLAN_SKB_1_2PAGE_BUF_NUM; i++) {
-               wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_2PAGE_BUFSIZE);
-               if (!wlan_static_skb[index][i])
-                       goto err_mem_alloc;
-               size += DHD_SKB_2PAGE_BUFSIZE;
-               DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
-                       DHD_PREALLOC_SKB_BUF, i, DHD_SKB_2PAGE_BUFSIZE);
-       }
+               for (i = 0; i < WLAN_SKB_BUF_NUM; i++)
+                       wlan_static_skb[index][i] = NULL;
+#if DHD_SKB_1PAGE_BUF_NUM > 0
+               for (i = 0; i < DHD_SKB_1PAGE_BUF_NUM; i++) {
+                       wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE);
+                       if (!wlan_static_skb[index][i])
+                               goto err_mem_alloc;
+                       size += DHD_SKB_1PAGE_BUFSIZE;
+                       DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
+                               DHD_PREALLOC_SKB_BUF, i, DHD_SKB_1PAGE_BUFSIZE);
+               }
+#endif
+               for (i = DHD_SKB_1PAGE_BUF_NUM; i < WLAN_SKB_1_2PAGE_BUF_NUM; i++) {
+                       wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_2PAGE_BUFSIZE);
+                       if (!wlan_static_skb[index][i])
+                               goto err_mem_alloc;
+                       size += DHD_SKB_2PAGE_BUFSIZE;
+                       DHD_STATIC_TRACE("section %d skb[%d], size=%ld\n",
+                               DHD_PREALLOC_SKB_BUF, i, DHD_SKB_2PAGE_BUFSIZE);
+               }
 #endif /* BCMSDIO | BCMPCIE */
 
-       if (all_buf == 1) {
 #if defined(BCMSDIO)
                wlan_static_skb[index][i] = dev_alloc_skb(DHD_SKB_4PAGE_BUFSIZE);
                if (!wlan_static_skb[index][i])
@@ -523,7 +507,8 @@ dhd_init_wlan_mem(int index, unsigned int all_buf)
 #endif /* BCMSDIO | BCMDBUS */
 
 #ifdef BCMPCIE
-               wlan_static_if_flow_lkup[index] = kmalloc(DHD_PREALLOC_IF_FLOW_LKUP_SIZE, GFP_KERNEL);
+               wlan_static_if_flow_lkup[index] =
+                       kmalloc(DHD_PREALLOC_IF_FLOW_LKUP_SIZE, GFP_KERNEL);
                if (!wlan_static_if_flow_lkup[index])
                        goto err_mem_alloc;
                size += DHD_PREALLOC_IF_FLOW_LKUP_SIZE;
@@ -541,9 +526,10 @@ dhd_init_wlan_mem(int index, unsigned int all_buf)
                DHD_PREALLOC_MEMDUMP_RAM, DHD_PREALLOC_MEMDUMP_RAM_SIZE);
 #endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
 
-       if (all_buf == 1) {
+       if (buf_level > 0) {
 #if defined(BCMSDIO) || defined(BCMDBUS)
-               wlan_static_dhd_wlfc_hanger_buf[index] = kmalloc(DHD_PREALLOC_DHD_WLFC_HANGER_SIZE, GFP_KERNEL);
+               wlan_static_dhd_wlfc_hanger_buf[index] =
+                       kmalloc(DHD_PREALLOC_DHD_WLFC_HANGER_SIZE, GFP_KERNEL);
                if (!wlan_static_dhd_wlfc_hanger_buf[index])
                        goto err_mem_alloc;
                size += DHD_PREALLOC_DHD_WLFC_HANGER_SIZE;
@@ -551,23 +537,29 @@ dhd_init_wlan_mem(int index, unsigned int all_buf)
                        DHD_PREALLOC_DHD_WLFC_HANGER, DHD_PREALLOC_DHD_WLFC_HANGER_SIZE);
 #endif /* BCMSDIO | BCMDBUS */
 
-#if defined(CONFIG_BCMDHD_VTS) || defined(CONFIG_BCMDHD_DEBUG)
-               wlan_static_dhd_log_dump_buf[index] = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE, GFP_KERNEL);
-               if (!wlan_static_dhd_log_dump_buf[index])
-                       goto err_mem_alloc;
-               size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE;
-               DHD_STATIC_TRACE("section %d, size=%d\n",
-                       DHD_PREALLOC_DHD_LOG_DUMP_BUF, DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE);
-
-               wlan_static_dhd_log_dump_buf_ex[index] = kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE, GFP_KERNEL);
-               if (!wlan_static_dhd_log_dump_buf_ex[index])
-                       goto err_mem_alloc;
-               size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE;
-               DHD_STATIC_TRACE("section %d, size=%d\n",
-                       DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX, DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE);
-#endif /* CONFIG_BCMDHD_VTS | CONFIG_BCMDHD_DEBUG */
+               if (buf_level > 1) {
+#ifdef DHD_USE_STATIC_MEMDUMP
+                       wlan_static_dhd_log_dump_buf[index] =
+                               kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE, GFP_KERNEL);
+                       if (!wlan_static_dhd_log_dump_buf[index])
+                               goto err_mem_alloc;
+                       size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE;
+                       DHD_STATIC_TRACE("section %d, size=%d\n",
+                               DHD_PREALLOC_DHD_LOG_DUMP_BUF, DHD_PREALLOC_DHD_LOG_DUMP_BUF_SIZE);
+
+                       wlan_static_dhd_log_dump_buf_ex[index] =
+                               kmalloc(DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE, GFP_KERNEL);
+                       if (!wlan_static_dhd_log_dump_buf_ex[index])
+                               goto err_mem_alloc;
+                       size += DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE;
+                       DHD_STATIC_TRACE("section %d, size=%d\n",
+                               DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX,
+                               DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX_SIZE);
+#endif /* DHD_USE_STATIC_MEMDUMP */
+               }
 
-               wlan_static_wl_escan_info_buf[index] = kmalloc(DHD_PREALLOC_WL_ESCAN_SIZE, GFP_KERNEL);
+               wlan_static_wl_escan_info_buf[index] =
+                       kmalloc(DHD_PREALLOC_WL_ESCAN_SIZE, GFP_KERNEL);
                if (!wlan_static_wl_escan_info_buf[index])
                        goto err_mem_alloc;
                size += DHD_PREALLOC_WL_ESCAN_SIZE;
@@ -582,7 +574,7 @@ dhd_init_wlan_mem(int index, unsigned int all_buf)
        DHD_STATIC_TRACE("section %d, size=%d\n",
                DHD_PREALLOC_FW_VERBOSE_RING, FW_VERBOSE_RING_SIZE);
 
-       if (all_buf == 1) {
+       if (buf_level > 0) {
                wlan_static_fw_event_ring_buf[index] = kmalloc(FW_EVENT_RING_SIZE, GFP_KERNEL);
                if (!wlan_static_fw_event_ring_buf[index])
                        goto err_mem_alloc;
@@ -625,23 +617,23 @@ bcmdhd_init_wlan_mem(unsigned int all_buf)
 {
        int i, ret = 0;
 
-       DHD_STATIC_MSG("%s\n", DHD_STATIC_VERSION_STR);
+       DHD_STATIC_MSG("%s\n", DHD_STATIC_VERSION_STR);
 
-       for (i=0; i<MAX_NUM_ADAPTERS; i++) {
+       for (i = 0; i < MAX_NUM_ADAPTERS; i++) {
                ret = dhd_init_wlan_mem(i, all_buf);
                if (ret)
                        break;
        }
 
        if (ret) {
-               for (i=0; i<MAX_NUM_ADAPTERS; i++)
+               for (i = 0; i < MAX_NUM_ADAPTERS; i++)
                        dhd_deinit_wlan_mem(i);
        }
 
        return ret;
 }
 
-#if 0
+#ifdef DHD_STATIC_USE_DEINIT
 #ifdef DHD_STATIC_IN_DRIVER
 void
 #else
@@ -651,9 +643,9 @@ dhd_static_buf_exit(void)
 {
        int i;
 
-       DHD_STATIC_MSG("Enter\n");
+       DHD_STATIC_MSG("Enter\n");
 
-       for (i=0; i<MAX_NUM_ADAPTERS; i++)
+       for (i = 0; i < MAX_NUM_ADAPTERS; i++)
                dhd_deinit_wlan_mem(i);
 }
 #endif
index 3d26fc920553d38f2a6aca5e88f4bf7b04898f7e..d09f7e26a243da9ad67c87c7a2f51b34dc42d1f0 100755 (executable)
@@ -45,7 +45,7 @@
 #elif (defined (BCMDBG_ASSERT) && !defined (BCMDBG_ASSERT_DISABLED))
 #define EPI_VERSION_STR                "101.10.361 (wlan=r892223 ASSRT)"
 #else
-#define EPI_VERSION_STR                "101.10.361.28 (wlan=r892223-20221116-5)"
+#define EPI_VERSION_STR                "101.10.361.28 (wlan=r892223-20221202-3)"
 #endif /* BCMINTERNAL */
 
 #endif /* _epivers_h_ */
index 480dc1faf0a0a7e94c5b0c71a2c882f3f0785c39..efba80fb5bd62ace6119b0a3948a90277ca9ef30 100755 (executable)
@@ -8470,15 +8470,15 @@ static int __wl_cfgvendor_dbg_get_pkt_fates(struct wiphy *wiphy,
                                user_buf = (void __user *)(unsigned long) nla_get_u64(iter);
                                break;
                        default:
-                               WL_ERR(("%s: no such attribute %d\n", __FUNCTION__, type));
+                               WL_ERR(("no such attribute %d\n", type));
                                ret = -EINVAL;
                                goto exit;
                }
        }
 
        if (!req_count || !user_buf) {
-               WL_ERR(("%s: invalid request, user_buf=%p, req_count=%u\n",
-                       __FUNCTION__, user_buf, req_count));
+               WL_ERR(("invalid request, user_buf=%p, req_count=%u\n",
+                       user_buf, req_count));
                ret = -EINVAL;
                goto exit;
        }
index 8826e6d69163230a790c9963b64a5fee176c331a..c66c6d5db952964d2984e5f0efe7ad40e169b799 100755 (executable)
@@ -456,7 +456,9 @@ enum debug_attributes {
        DEBUG_ATTRIBUTE_LOG_MIN_DATA_SIZE,
        DEBUG_ATTRIBUTE_FW_DUMP_LEN,
        DEBUG_ATTRIBUTE_FW_DUMP_DATA,
+#if (ANDROID_VERSION >= 11)
        DEBUG_ATTRIBUTE_FW_ERR_CODE,
+#endif
        DEBUG_ATTRIBUTE_RING_DATA,
        DEBUG_ATTRIBUTE_RING_STATUS,
        DEBUG_ATTRIBUTE_RING_NUM,
index 4980e82c8a9a6bfd06e9bd90db0c7962dc9d7432..0af2e0ffc284f7da01db960255755dd7cdf26cd2 100755 (executable)
@@ -5085,7 +5085,7 @@ wl_cfg80211_dfs_ap_move(struct net_device *ndev, char *data, char *command, int
 }
 
 #ifdef WL_CFG80211_ACL
-static int
+int
 wl_cfg80211_set_mac_acl(struct wiphy *wiphy, struct net_device *cfgdev,
        const struct cfg80211_acl_data *acl)
 {
index a9885478a6cfcacb2118e7c1d41b0738ea7439b7..a81df9fb9f1742336a35fcd9965a645719f5e15f 100755 (executable)
@@ -213,6 +213,10 @@ extern s32 wl_cfg80211_add_set_beacon(struct wiphy *wiphy, struct net_device *de
        struct beacon_parameters *info);
 extern s32 wl_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev);
 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)  || WL_COMPAT_WIRELESS */
+#ifdef WL_CFG80211_ACL
+extern int wl_cfg80211_set_mac_acl(struct wiphy *wiphy, struct net_device *cfgdev,
+       const struct cfg80211_acl_data *acl);
+#endif /* WL_CFG80211_ACL */
 
 extern s32 wl_ap_start_ind(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
        const wl_event_msg_t *e, void *data);
index 4e82539ccc642b51afce3b1855ef77e466490920..06053e6d1a7cc102fa78421f5c3e681da3390509 100755 (executable)
@@ -4620,7 +4620,6 @@ wl_cur_if_tput_dump(struct wl_apsta_params *apsta_params, struct wl_if_info *cur
 {
 #ifdef WLDWDS
        struct wl_dwds_info *dwds_if;
-       int i;
 #endif /* WLDWDS */
        struct ether_addr bssid;
        int ret = 0;