From: jiabin.chen Date: Tue, 6 Dec 2022 06:10:10 +0000 (+0800) Subject: wifi: update drive to load fw relative path [2/2] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68ce7f4a4f8cd9099f4907b39d8e18d44e3fff4a;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_dhd-driver.git wifi: update drive to load fw relative path [2/2] 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 --- diff --git a/bcmdhd.101.10.361.x/Makefile b/bcmdhd.101.10.361.x/Makefile index 4967652..1597855 100755 --- a/bcmdhd.101.10.361.x/Makefile +++ b/bcmdhd.101.10.361.x/Makefile @@ -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\"" diff --git a/bcmdhd.101.10.361.x/dhd_config.c b/bcmdhd.101.10.361.x/dhd_config.c index 05008d2..457e29b 100755 --- a/bcmdhd.101.10.361.x/dhd_config.c +++ b/bcmdhd.101.10.361.x/dhd_config.c @@ -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); diff --git a/bcmdhd.101.10.361.x/dhd_debug.c b/bcmdhd.101.10.361.x/dhd_debug.c index f8f6c92..6ab2326 100755 --- a/bcmdhd.101.10.361.x/dhd_debug.c +++ b/bcmdhd.101.10.361.x/dhd_debug.c @@ -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; } diff --git a/bcmdhd.101.10.361.x/dhd_gpio.c b/bcmdhd.101.10.361.x/dhd_gpio.c index 85bb68d..594afbb 100755 --- a/bcmdhd.101.10.361.x/dhd_gpio.c +++ b/bcmdhd.101.10.361.x/dhd_gpio.c @@ -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 diff --git a/bcmdhd.101.10.361.x/dhd_pcie.c b/bcmdhd.101.10.361.x/dhd_pcie.c index 5c10144..c5f687a 100755 --- a/bcmdhd.101.10.361.x/dhd_pcie.c +++ b/bcmdhd.101.10.361.x/dhd_pcie.c @@ -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 */ diff --git a/bcmdhd.101.10.361.x/dhd_static_buf.c b/bcmdhd.101.10.361.x/dhd_static_buf.c index 3d6662d..9bc63bf 100755 --- a/bcmdhd.101.10.361.x/dhd_static_buf.c +++ b/bcmdhd.101.10.361.x/dhd_static_buf.c @@ -10,33 +10,33 @@ #include #include #include -#include +#include #include -#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 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= 11) DEBUG_ATTRIBUTE_FW_ERR_CODE, +#endif DEBUG_ATTRIBUTE_RING_DATA, DEBUG_ATTRIBUTE_RING_STATUS, DEBUG_ATTRIBUTE_RING_NUM, diff --git a/bcmdhd.101.10.361.x/wl_cfgvif.c b/bcmdhd.101.10.361.x/wl_cfgvif.c index 4980e82..0af2e0f 100755 --- a/bcmdhd.101.10.361.x/wl_cfgvif.c +++ b/bcmdhd.101.10.361.x/wl_cfgvif.c @@ -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) { diff --git a/bcmdhd.101.10.361.x/wl_cfgvif.h b/bcmdhd.101.10.361.x/wl_cfgvif.h index a988547..a81df9f 100755 --- a/bcmdhd.101.10.361.x/wl_cfgvif.h +++ b/bcmdhd.101.10.361.x/wl_cfgvif.h @@ -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); diff --git a/bcmdhd.101.10.361.x/wl_iapsta.c b/bcmdhd.101.10.361.x/wl_iapsta.c index 4e82539..06053e6 100755 --- a/bcmdhd.101.10.361.x/wl_iapsta.c +++ b/bcmdhd.101.10.361.x/wl_iapsta.c @@ -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;