From 1d05fd79f6935863f4990a65441dcdadc83fd595 Mon Sep 17 00:00:00 2001 From: Jiamin Miao Date: Fri, 7 Aug 2015 14:49:00 +0800 Subject: [PATCH] PD#110330 :update broadcomw wifi driver to 1.201.59.5 Change-Id: I335a10cc9fc7585b933839af2bcf6c2c6604c772 --- bcmdhd_1_201_59_x/Makefile | 24 +- bcmdhd_1_201_59_x/bcmsdh_linux.c | 6 +- bcmdhd_1_201_59_x/bcmsdh_sdmmc_linux.c | 10 +- bcmdhd_1_201_59_x/bcmutils.c | 4 +- bcmdhd_1_201_59_x/dhd_common.c | 14 +- bcmdhd_1_201_59_x/dhd_config.c | 367 +++++++++++++++---------- bcmdhd_1_201_59_x/dhd_config.h | 6 +- bcmdhd_1_201_59_x/dhd_gpio.c | 22 +- bcmdhd_1_201_59_x/dhd_linux.c | 25 +- bcmdhd_1_201_59_x/dhd_pcie.c | 11 +- bcmdhd_1_201_59_x/dhd_sdio.c | 20 +- bcmdhd_1_201_59_x/dhd_static_buf.c | 338 ++++++++++++----------- bcmdhd_1_201_59_x/include/epivers.h | 2 +- bcmdhd_1_201_59_x/wl_android.c | 14 +- bcmdhd_1_201_59_x/wl_cfg80211.c | 43 +-- bcmdhd_1_201_59_x/wl_cfgp2p.c | 2 +- bcmdhd_1_201_59_x/wl_iw.c | 10 +- 17 files changed, 497 insertions(+), 421 deletions(-) diff --git a/bcmdhd_1_201_59_x/Makefile b/bcmdhd_1_201_59_x/Makefile index a706508..c29a649 100644 --- a/bcmdhd_1_201_59_x/Makefile +++ b/bcmdhd_1_201_59_x/Makefile @@ -8,18 +8,13 @@ CONFIG_BCMDHD_SDIO := y export CONFIG_BCMDHD = m export CONFIG_BCMDHD_OOB = y -DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \ +DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER -DSDTEST \ -DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DBCMFILEIMAGE \ - -DDHDTHREAD -DDHD_DEBUG -DSHOW_EVENTS -DBCMDBG \ - -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT \ - -DKEEP_ALIVE -DPKT_FILTER_SUPPORT -DDHD_USE_IDLECOUNT \ - -DEMBEDDED_PLATFORM -DPNO_SUPPORT -DVSDB \ - -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST \ - -DESCAN_RESULT_PATCH -DSUPPORT_PM2_ONLY -DWLTDLS \ + -DDHDTHREAD -DDHD_DEBUG -DSHOW_EVENTS -DBCMDBG -DGET_OTP_MAC_ENABLE \ + -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT -DSUPPORT_PM2_ONLY \ + -DKEEP_ALIVE -DPKT_FILTER_SUPPORT -DPNO_SUPPORT -DDHDTCPACK_SUPPRESS \ -DDHD_DONOT_FORWARD_BCMEVENT_AS_NETWORK_PKT -DRXFRAME_THREAD \ - -DMIRACAST_AMPDU_SIZE=8 -DDHDTCPACK_SUPPRESS \ - -DSDTEST -DBDC -DDHD_BCMEVENTS -DPROP_TXSTATUS_VSDB \ - -DGET_OTP_MAC_ENABLE -DSET_RANDOM_MAC_SOFTAP \ + -DSET_RANDOM_MAC_SOFTAP \ -DENABLE_INSMOD_NO_FW_LOAD \ -I$(src) -I$(src)/include @@ -31,9 +26,9 @@ DHDOFILES = aiutils.o siutils.o sbutils.o bcmutils.o bcmwifi_channels.o \ ifneq ($(CONFIG_BCMDHD_SDIO),) DHDCFLAGS += \ - -DMMC_SDIO_ABORT -DBCMSDIO -DBCMLXSDMMC -DSDIO_CRC_ERROR_FIX \ - -DCUSTOM_SDIO_F2_BLKSIZE=128 -DUSE_SDIOFIFO_IOVAR -DBCMSDIOH_TXGLOM \ - -DPROP_TXSTATUS + -DBCMSDIO -DMMC_SDIO_ABORT -DBCMLXSDMMC -DUSE_SDIOFIFO_IOVAR \ + -DBDC -DPROP_TXSTATUS -DDHD_USE_IDLECOUNT -DBCMSDIOH_TXGLOM \ + -DCUSTOM_SDIO_F2_BLKSIZE=128 DHDOFILES += bcmsdh.o bcmsdh_linux.o bcmsdh_sdmmc.o bcmsdh_sdmmc_linux.o \ dhd_sdio.o dhd_cdc.o dhd_wlfc.o @@ -91,6 +86,9 @@ DHDCFLAGS += -DCUSTOM_KEEP_ALIVE_SETTING=28000 DHDCFLAGS += -DCUSTOM_PNO_EVENT_LOCK_xTIME=7 DHDCFLAGS += -DWL_SUPPORT_AUTO_CHANNEL DHDCFLAGS += -DWL_SUPPORT_BACKPORTED_KPATCHES +DHDCFLAGS += -DESCAN_RESULT_PATCH +DHDCFLAGS += -DVSDB -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST +DHDCFLAGS += -DWLTDLS -DMIRACAST_AMPDU_SIZE=8 -DPROP_TXSTATUS_VSDB endif EXTRA_CFLAGS = $(DHDCFLAGS) ifeq ($(CONFIG_BCMDHD),m) diff --git a/bcmdhd_1_201_59_x/bcmsdh_linux.c b/bcmdhd_1_201_59_x/bcmsdh_linux.c index b4e6a8a..54ca0ed 100644 --- a/bcmdhd_1_201_59_x/bcmsdh_linux.c +++ b/bcmdhd_1_201_59_x/bcmsdh_linux.c @@ -346,11 +346,7 @@ int bcmsdh_oob_intr_register(bcmsdh_info_t *bcmsdh, bcmsdh_cb_fn_t oob_irq_handl #if defined(DISABLE_WOWLAN) SDLX_MSG(("%s: disable_irq_wake\n", __FUNCTION__)); - err = disable_irq_wake(bcmsdh_osinfo->oob_irq_num); - if (err) - SDLX_MSG(("%s: disable_irq_wake failed with %d\n", __FUNCTION__, err)); - else - bcmsdh_osinfo->oob_irq_wake_enabled = FALSE; + bcmsdh_osinfo->oob_irq_wake_enabled = FALSE; #else SDLX_MSG(("%s: enable_irq_wake\n", __FUNCTION__)); err = enable_irq_wake(bcmsdh_osinfo->oob_irq_num); diff --git a/bcmdhd_1_201_59_x/bcmsdh_sdmmc_linux.c b/bcmdhd_1_201_59_x/bcmsdh_sdmmc_linux.c index 0fe3284..19e0018 100644 --- a/bcmdhd_1_201_59_x/bcmsdh_sdmmc_linux.c +++ b/bcmdhd_1_201_59_x/bcmsdh_sdmmc_linux.c @@ -233,14 +233,14 @@ static int bcmsdh_sdmmc_suspend(struct device *pdev) struct sdio_func *func = dev_to_sdio_func(pdev); mmc_pm_flag_t sdio_flags; - printk("%s Enter func->num=%d\n", __FUNCTION__, func->num); + printf("%s Enter func->num=%d\n", __FUNCTION__, func->num); if (func->num != 2) return 0; sdioh = sdio_get_drvdata(func); err = bcmsdh_suspend(sdioh->bcmsdh); if (err) { - printk("%s bcmsdh_suspend err=%d\n", __FUNCTION__, err); + printf("%s bcmsdh_suspend err=%d\n", __FUNCTION__, err); return err; } @@ -262,7 +262,7 @@ static int bcmsdh_sdmmc_suspend(struct device *pdev) dhd_mmc_suspend = TRUE; smp_mb(); - printk("%s Exit\n", __FUNCTION__); + printf("%s Exit\n", __FUNCTION__); return 0; } @@ -273,7 +273,7 @@ static int bcmsdh_sdmmc_resume(struct device *pdev) #endif struct sdio_func *func = dev_to_sdio_func(pdev); - printk("%s Enter func->num=%d\n", __FUNCTION__, func->num); + printf("%s Enter func->num=%d\n", __FUNCTION__, func->num); if (func->num != 2) return 0; @@ -284,7 +284,7 @@ static int bcmsdh_sdmmc_resume(struct device *pdev) #endif smp_mb(); - printk("%s Exit\n", __FUNCTION__); + printf("%s Exit\n", __FUNCTION__); return 0; } diff --git a/bcmdhd_1_201_59_x/bcmutils.c b/bcmdhd_1_201_59_x/bcmutils.c index b0727e3..148fdee 100644 --- a/bcmdhd_1_201_59_x/bcmutils.c +++ b/bcmdhd_1_201_59_x/bcmutils.c @@ -2003,9 +2003,9 @@ process_nvram_vars(char *varbuf, unsigned int len) for (n=1; nm_mac_list_head) { for (i = 0; i < mac_list->count; i++) { if (mac_list->m_mac_list_head[i].mac) { @@ -257,13 +256,13 @@ dhd_conf_get_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, uint8 *mac) if (config_msg_level & CONFIG_TRACE_LEVEL) { printf("%s: tpl_code=0x%02x, tpl_link=0x%02x, tag=0x%02x\n", __FUNCTION__, tpl_code, tpl_link, *ptr); - printf("%s: value:", __FUNCTION__); + printk("%s: value:", __FUNCTION__); for (i=0; iconf->pkt_filter_add.count; i++) { + * All pkt: pkt_filter_add=99 0 0 0 0x000000000000 0x000000000000 + * Netbios pkt: 120 0 0 12 0xFFFF000000000000000000FF000000000000000000000000FFFF 0x0800000000000000000000110000000000000000000000000089 + */ + for(i=0; iconf->pkt_filter_add.count; i++) { dhd->pktfilter[i+dhd->pktfilter_count] = dhd->conf->pkt_filter_add.filter[i]; printf("%s: %s\n", __FUNCTION__, dhd->pktfilter[i+dhd->pktfilter_count]); } @@ -1125,15 +1132,21 @@ dhd_conf_set_disable_proptx(dhd_pub_t *dhd) } int -dhd_conf_get_pm(void *context) +dhd_conf_get_pm(dhd_pub_t *dhd) { - dhd_pub_t *dhd = context; - if (dhd && dhd->conf) return dhd->conf->pm; return -1; } +int +dhd_conf_get_tcpack_sup_mode(dhd_pub_t *dhd) +{ + if (dhd && dhd->conf) + return dhd->conf->tcpack_sup_mode; + return -1; +} + unsigned int process_config_vars(char *varbuf, unsigned int len, char *pickbuf, char *param) { @@ -1360,6 +1373,165 @@ dhd_conf_read_wme_ac_params(dhd_pub_t *dhd, char *bufp, uint len) } void +dhd_conf_read_fw_by_mac(dhd_pub_t *dhd, char *bufp, uint len) +{ + uint len_val; + int i, j; + char pick[MAXSZ_BUF]; + char *pch, *pick_tmp; + wl_mac_list_t *mac_list; + wl_mac_range_t *mac_range; + struct dhd_conf *conf = dhd->conf; + + /* Process fw_by_mac: + * fw_by_mac=[fw_mac_num] \ + * [fw_name1] [mac_num1] [oui1-1] [nic_start1-1] [nic_end1-1] \ + * [oui1-1] [nic_start1-1] [nic_end1-1]... \ + * [oui1-n] [nic_start1-n] [nic_end1-n] \ + * [fw_name2] [mac_num2] [oui2-1] [nic_start2-1] [nic_end2-1] \ + * [oui2-1] [nic_start2-1] [nic_end2-1]... \ + * [oui2-n] [nic_start2-n] [nic_end2-n] \ + * Ex: fw_by_mac=2 \ + * fw_bcmdhd1.bin 2 0x0022F4 0xE85408 0xE8549D 0x983B16 0x3557A9 0x35582A \ + * fw_bcmdhd2.bin 3 0x0022F4 0xE85408 0xE8549D 0x983B16 0x3557A9 0x35582A \ + * 0x983B16 0x916157 0x916487 + */ + memset(pick, 0, MAXSZ_BUF); + len_val = process_config_vars(bufp, len, pick, "fw_by_mac="); + if (len_val) { + pick_tmp = pick; + pch = bcmstrtok(&pick_tmp, " ", 0); + conf->fw_by_mac.count = (uint32)simple_strtol(pch, NULL, 0); + if (!(mac_list = kmalloc(sizeof(wl_mac_list_t)*conf->fw_by_mac.count, GFP_KERNEL))) { + conf->fw_by_mac.count = 0; + CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); + } + printf("%s: fw_count=%d\n", __FUNCTION__, conf->fw_by_mac.count); + conf->fw_by_mac.m_mac_list_head = mac_list; + for (i=0; ifw_by_mac.count; i++) { + pch = bcmstrtok(&pick_tmp, " ", 0); + strcpy(mac_list[i].name, pch); + pch = bcmstrtok(&pick_tmp, " ", 0); + mac_list[i].count = (uint32)simple_strtol(pch, NULL, 0); + printf("%s: name=%s, mac_count=%d\n", __FUNCTION__, + mac_list[i].name, mac_list[i].count); + if (!(mac_range = kmalloc(sizeof(wl_mac_range_t)*mac_list[i].count, GFP_KERNEL))) { + mac_list[i].count = 0; + CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); + break; + } + mac_list[i].mac = mac_range; + for (j=0; jconf; + + /* Process nv_by_mac: + * [nv_by_mac]: The same format as fw_by_mac + */ + memset(pick, 0, MAXSZ_BUF); + len_val = process_config_vars(bufp, len, pick, "nv_by_mac="); + if (len_val) { + pick_tmp = pick; + pch = bcmstrtok(&pick_tmp, " ", 0); + conf->nv_by_mac.count = (uint32)simple_strtol(pch, NULL, 0); + if (!(mac_list = kmalloc(sizeof(wl_mac_list_t)*conf->nv_by_mac.count, GFP_KERNEL))) { + conf->nv_by_mac.count = 0; + CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); + } + printf("%s: nv_count=%d\n", __FUNCTION__, conf->nv_by_mac.count); + conf->nv_by_mac.m_mac_list_head = mac_list; + for (i=0; inv_by_mac.count; i++) { + pch = bcmstrtok(&pick_tmp, " ", 0); + strcpy(mac_list[i].name, pch); + pch = bcmstrtok(&pick_tmp, " ", 0); + mac_list[i].count = (uint32)simple_strtol(pch, NULL, 0); + printf("%s: name=%s, mac_count=%d\n", __FUNCTION__, + mac_list[i].name, mac_list[i].count); + if (!(mac_range = kmalloc(sizeof(wl_mac_range_t)*mac_list[i].count, GFP_KERNEL))) { + mac_list[i].count = 0; + CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); + break; + } + mac_list[i].mac = mac_range; + for (j=0; jconf; + + /* Process nv_by_chip: + * nv_by_chip=[nv_chip_num] \ + * [chip1] [chiprev1] [nv_name1] [chip2] [chiprev2] [nv_name2] \ + * Ex: nv_by_chip=2 \ + * 43430 0 nvram_ap6212.txt 43430 1 nvram_ap6212a.txt \ + */ + memset(pick, 0, MAXSZ_BUF); + len_val = process_config_vars(bufp, len, pick, "nv_by_chip="); + if (len_val) { + pick_tmp = pick; + pch = bcmstrtok(&pick_tmp, " ", 0); + conf->nv_by_chip.count = (uint32)simple_strtol(pch, NULL, 0); + if (!(chip_nv_path = kmalloc(sizeof(wl_mac_list_t)*conf->nv_by_chip.count, GFP_KERNEL))) { + conf->nv_by_chip.count = 0; + CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); + } + printf("%s: nv_by_chip_count=%d\n", __FUNCTION__, conf->nv_by_chip.count); + conf->nv_by_chip.m_chip_nv_path_head = chip_nv_path; + for (i=0; inv_by_chip.count; i++) { + pch = bcmstrtok(&pick_tmp, " ", 0); + chip_nv_path[i].chip = (uint32)simple_strtol(pch, NULL, 0); + pch = bcmstrtok(&pick_tmp, " ", 0); + chip_nv_path[i].chiprev = (uint32)simple_strtol(pch, NULL, 0); + pch = bcmstrtok(&pick_tmp, " ", 0); + strcpy(chip_nv_path[i].name, pch); + printf("%s: chip=0x%x, chiprev=%d, name=%s\n", __FUNCTION__, + chip_nv_path[i].chip, chip_nv_path[i].chiprev, chip_nv_path[i].name); + } + } +} + +void dhd_conf_read_roam_params(dhd_pub_t *dhd, char *bufp, uint len) { uint len_val; @@ -1419,47 +1591,21 @@ dhd_conf_read_roam_params(dhd_pub_t *dhd, char *bufp, uint len) } -/* - * [fw_by_mac]: - * fw_by_mac=[fw_mac_num] \ - * [fw_name1] [mac_num1] [oui1-1] [nic_start1-1] [nic_end1-1] \ - * [oui1-1] [nic_start1-1] [nic_end1-1]... \ - * [oui1-n] [nic_start1-n] [nic_end1-n] \ - * [fw_name2] [mac_num2] [oui2-1] [nic_start2-1] [nic_end2-1] \ - * [oui2-1] [nic_start2-1] [nic_end2-1]... \ - * [oui2-n] [nic_start2-n] [nic_end2-n] \ - * Ex: fw_by_mac=2 \ - * fw_bcmdhd1.bin 2 0x0022F4 0xE85408 0xE8549D 0x983B16 0x3557A9 0x35582A \ - * fw_bcmdhd2.bin 3 0x0022F4 0xE85408 0xE8549D 0x983B16 0x3557A9 0x35582A \ - * 0x983B16 0x916157 0x916487 - * [nv_by_mac]: The same format as fw_by_mac - * -*/ int dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path) { - int bcmerror = -1, i, j; + int bcmerror = -1, i; uint len, len_val; void * image = NULL; char * memblock = NULL; - char *bufp, *pick=NULL, *pch, *pick_tmp; + char *bufp, pick[MAXSZ_BUF], *pch, *pick_tmp; bool conf_file_exists; - wl_mac_list_t *mac_list; - wl_mac_range_t *mac_range; - wl_chip_nv_path_t *chip_nv_path; struct dhd_conf *conf = dhd->conf; - pick = kmalloc(MAXSZ_BUF, GFP_KERNEL); - if (!pick) { - printk("kmalloc pick error \n"); - goto err; - } - memset(pick, 0, MAXSZ_BUF); - conf_file_exists = ((conf_path != NULL) && (conf_path[0] != '\0')); if (!conf_file_exists) { printk("%s: config path %s\n", __FUNCTION__, conf_path); - goto err; + return (0); } if (conf_file_exists) { @@ -1489,113 +1635,13 @@ dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path) dhd_conf_read_log_level(dhd, bufp, len); dhd_conf_read_roam_params(dhd, bufp, len); dhd_conf_read_wme_ac_params(dhd, bufp, len); + dhd_conf_read_fw_by_mac(dhd, bufp, len); + dhd_conf_read_nv_by_mac(dhd, bufp, len); + dhd_conf_read_nv_by_chip(dhd, bufp, len); - /* Process fw_by_mac */ - memset(pick, 0, MAXSZ_BUF); - len_val = process_config_vars(bufp, len, pick, "fw_by_mac="); - if (len_val) { - pick_tmp = pick; - pch = bcmstrtok(&pick_tmp, " ", 0); - conf->fw_by_mac.count = (uint32)simple_strtol(pch, NULL, 0); - if (!(mac_list = kmalloc(sizeof(wl_mac_list_t)*conf->fw_by_mac.count, GFP_KERNEL))) { - conf->fw_by_mac.count = 0; - CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); - } - printf("%s: fw_count=%d\n", __FUNCTION__, conf->fw_by_mac.count); - conf->fw_by_mac.m_mac_list_head = mac_list; - for (i=0; ifw_by_mac.count; i++) { - pch = bcmstrtok(&pick_tmp, " ", 0); - strcpy(mac_list[i].name, pch); - pch = bcmstrtok(&pick_tmp, " ", 0); - mac_list[i].count = (uint32)simple_strtol(pch, NULL, 0); - printf("%s: name=%s, mac_count=%d\n", __FUNCTION__, - mac_list[i].name, mac_list[i].count); - if (!(mac_range = kmalloc(sizeof(wl_mac_range_t)*mac_list[i].count, GFP_KERNEL))) { - mac_list[i].count = 0; - CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); - break; - } - mac_list[i].mac = mac_range; - for (j=0; jnv_by_mac.count = (uint32)simple_strtol(pch, NULL, 0); - if (!(mac_list = kmalloc(sizeof(wl_mac_list_t)*conf->nv_by_mac.count, GFP_KERNEL))) { - conf->nv_by_mac.count = 0; - CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); - } - printf("%s: nv_count=%d\n", __FUNCTION__, conf->nv_by_mac.count); - conf->nv_by_mac.m_mac_list_head = mac_list; - for (i=0; inv_by_mac.count; i++) { - pch = bcmstrtok(&pick_tmp, " ", 0); - strcpy(mac_list[i].name, pch); - pch = bcmstrtok(&pick_tmp, " ", 0); - mac_list[i].count = (uint32)simple_strtol(pch, NULL, 0); - printf("%s: name=%s, mac_count=%d\n", __FUNCTION__, - mac_list[i].name, mac_list[i].count); - if (!(mac_range = kmalloc(sizeof(wl_mac_range_t)*mac_list[i].count, GFP_KERNEL))) { - mac_list[i].count = 0; - CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); - break; - } - mac_list[i].mac = mac_range; - for (j=0; jnv_by_chip.count = (uint32)simple_strtol(pch, NULL, 0); - if (!(chip_nv_path = kmalloc(sizeof(wl_mac_list_t)*conf->nv_by_chip.count, GFP_KERNEL))) { - conf->nv_by_chip.count = 0; - CONFIG_ERROR(("%s: kmalloc failed\n", __FUNCTION__)); - } - printf("%s: nv_by_chip_count=%d\n", __FUNCTION__, conf->nv_by_chip.count); - conf->nv_by_chip.m_chip_nv_path_head = chip_nv_path; - for (i=0; inv_by_chip.count; i++) { - pch = bcmstrtok(&pick_tmp, " ", 0); - chip_nv_path[i].chip = (uint32)simple_strtol(pch, NULL, 0); - pch = bcmstrtok(&pick_tmp, " ", 0); - chip_nv_path[i].chiprev = (uint32)simple_strtol(pch, NULL, 0); - pch = bcmstrtok(&pick_tmp, " ", 0); - strcpy(chip_nv_path[i].name, pch); - printf("%s: chip=0x%x, chiprev=%d, name=%s\n", __FUNCTION__, - chip_nv_path[i].chip, chip_nv_path[i].chiprev, chip_nv_path[i].name); - } - } - - /* Process band */ + /* Process band: + * band=a for 5GHz only and band=b for 2.4GHz only + */ memset(pick, 0, MAXSZ_BUF); len_val = process_config_vars(bufp, len, pick, "band="); if (len_val) { @@ -1697,6 +1743,7 @@ dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path) printf("%s: dhd_master_mode = %d\n", __FUNCTION__, dhd_master_mode); } +#ifdef PKT_FILTER_SUPPORT /* Process pkt_filter_add: * All pkt: pkt_filter_add=99 0 0 0 0x000000000000 0x000000000000 */ @@ -1733,6 +1780,7 @@ dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path) printf("%d ", conf->pkt_filter_del.id[i]); printf("\n"); } +#endif /* Process srl parameters */ memset(pick, 0, MAXSZ_BUF); @@ -1879,6 +1927,14 @@ dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path) printf("%s: PM = %d\n", __FUNCTION__, conf->pm); } + /* Process tcpack_sup_mode parameters */ + memset(pick, 0, MAXSZ_BUF); + len_val = process_config_vars(bufp, len, pick, "tcpack_sup_mode="); + if (len_val) { + conf->tcpack_sup_mode = (int)simple_strtol(pick, NULL, 10); + printf("%s: tcpack_sup_mode = %d\n", __FUNCTION__, conf->tcpack_sup_mode); + } + bcmerror = 0; } else { CONFIG_ERROR(("%s: error reading config file: %d\n", __FUNCTION__, len)); @@ -1891,8 +1947,6 @@ err: if (image) dhd_os_close_image(image); - if (pick) - kfree(pick); return bcmerror; } @@ -1946,7 +2000,7 @@ dhd_conf_preinit(dhd_pub_t *dhd) conf->cspec.rev = 0; } else if (conf->chip == BCM4335_CHIP_ID || conf->chip == BCM4339_CHIP_ID || conf->chip == BCM4354_CHIP_ID || conf->chip == BCM4356_CHIP_ID || - conf->chip == BCM4345_CHIP_ID) { + conf->chip == BCM4345_CHIP_ID || conf->chip == BCM4371_CHIP_ID) { strcpy(conf->cspec.country_abbrev, "CN"); strcpy(conf->cspec.ccode, "CN"); conf->cspec.rev = 38; @@ -2006,6 +2060,7 @@ dhd_conf_preinit(dhd_pub_t *dhd) conf->frameburst = -1; conf->deepsleep = FALSE; conf->pm = -1; + conf->tcpack_sup_mode = TCPACK_SUP_OFF; if ((conf->chip == BCM43362_CHIP_ID) || (conf->chip == BCM4330_CHIP_ID)) { conf->disable_proptx = 1; conf->use_rxchain = 0; @@ -2026,6 +2081,18 @@ dhd_conf_preinit(dhd_pub_t *dhd) if (conf->chip == BCM4356_CHIP_ID) { conf->txbf = 1; } + if (conf->chip == BCM4371_CHIP_ID) { + conf->txbf = 1; + } +#ifdef BCMSDIO + if (conf->chip == BCM4356_CHIP_ID) { + conf->txbf = 1; + } +#elif defined(BCMPCIE) + if (conf->chip == BCM4356_CHIP_ID) { + conf->txbf = 1; + } +#endif return 0; } diff --git a/bcmdhd_1_201_59_x/dhd_config.h b/bcmdhd_1_201_59_x/dhd_config.h index af318e2..b2fe012 100644 --- a/bcmdhd_1_201_59_x/dhd_config.h +++ b/bcmdhd_1_201_59_x/dhd_config.h @@ -65,7 +65,7 @@ typedef struct wmes_param { #ifdef PKT_FILTER_SUPPORT #define DHD_CONF_FILTER_MAX 8 /* filter list */ -#define PKT_FILTER_LEN 150 +#define PKT_FILTER_LEN 300 typedef struct conf_pkt_filter_add { /* in - # of channels, out - # of entries */ uint32 count; @@ -124,6 +124,7 @@ typedef struct dhd_conf { int frameburst; bool deepsleep; int pm; + uint8 tcpack_sup_mode; } dhd_conf_t; #ifdef BCMSDIO @@ -166,7 +167,8 @@ int dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path); int dhd_conf_set_chiprev(dhd_pub_t *dhd, uint chip, uint chiprev); uint dhd_conf_get_chip(void *context); uint dhd_conf_get_chiprev(void *context); -int dhd_conf_get_pm(void *context); +int dhd_conf_get_pm(dhd_pub_t *dhd); +int dhd_conf_get_tcpack_sup_mode(dhd_pub_t *dhd); int dhd_conf_preinit(dhd_pub_t *dhd); int dhd_conf_reset(dhd_pub_t *dhd); int dhd_conf_attach(dhd_pub_t *dhd); diff --git a/bcmdhd_1_201_59_x/dhd_gpio.c b/bcmdhd_1_201_59_x/dhd_gpio.c index ea0be94..6955fe8 100644 --- a/bcmdhd_1_201_59_x/dhd_gpio.c +++ b/bcmdhd_1_201_59_x/dhd_gpio.c @@ -27,7 +27,7 @@ uint bcm_wlan_get_oob_irq(void) uint host_oob_irq = 0; #ifdef CONFIG_MACH_ODROID_4210 - printk("GPIO(WL_HOST_WAKE) = EXYNOS4_GPX0(7) = %d\n", EXYNOS4_GPX0(7)); + printf("GPIO(WL_HOST_WAKE) = EXYNOS4_GPX0(7) = %d\n", EXYNOS4_GPX0(7)); host_oob_irq = gpio_to_irq(EXYNOS4_GPX0(7)); gpio_direction_input(EXYNOS4_GPX0(7)); #endif @@ -38,7 +38,7 @@ uint bcm_wlan_get_oob_irq(void) host_oob_irq = wifi_irq_num(); #endif #endif - printk("host_oob_irq: %d \r\n", host_oob_irq); + printf("host_oob_irq: %d \r\n", host_oob_irq); return host_oob_irq; } @@ -52,7 +52,7 @@ uint bcm_wlan_get_oob_irq_flags(void) #else host_oob_irq_flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_SHAREABLE; #endif - printk("host_oob_irq_flags=%d\n", host_oob_irq_flags); + printf("host_oob_irq_flags=%d\n", host_oob_irq_flags); return host_oob_irq_flags; } @@ -63,7 +63,7 @@ int bcm_wlan_set_power(bool on) int err = 0; if (on) { - printk("======== PULL WL_REG_ON HIGH! ========\n"); + printf("======== PULL WL_REG_ON HIGH! ========\n"); #ifdef CONFIG_MACH_ODROID_4210 err = gpio_set_value(EXYNOS4_GPK1(0), 1); #endif @@ -77,7 +77,7 @@ int bcm_wlan_set_power(bool on) /* Lets customer power to get stable */ mdelay(100); } else { - printk("======== PULL WL_REG_ON LOW! ========\n"); + printf("======== PULL WL_REG_ON LOW! ========\n"); #ifdef CONFIG_MACH_ODROID_4210 err = gpio_set_value(EXYNOS4_GPK1(0), 0); #endif @@ -95,7 +95,7 @@ int bcm_wlan_set_carddetect(bool present) int err = 0; if (present) { - printk("======== Card detection to detect SDIO card! ========\n"); + printf("======== Card detection to detect SDIO card! ========\n"); #ifdef CONFIG_MACH_ODROID_4210 err = sdhci_s3c_force_presence_change(&sdmmc_channel, 1); #endif @@ -103,7 +103,7 @@ int bcm_wlan_set_carddetect(bool present) sdio_reinit(); #endif } else { - printk("======== Card detection to remove SDIO card! ========\n"); + printf("======== Card detection to remove SDIO card! ========\n"); #ifdef CONFIG_MACH_ODROID_4210 err = sdhci_s3c_force_presence_change(&sdmmc_channel, 0); #endif @@ -120,7 +120,7 @@ int bcm_wlan_get_mac_address(unsigned char *buf) { int err = 0; - printk("======== %s ========\n", __FUNCTION__); + printf("======== %s ========\n", __FUNCTION__); #ifdef EXAMPLE_GET_MAC /* EXAMPLE code */ { @@ -139,18 +139,18 @@ void* bcm_wlan_prealloc(int section, unsigned long size) void *alloc_ptr = NULL; alloc_ptr = bcmdhd_mem_prealloc(section, size); if (alloc_ptr) { - printk("success alloc section %d, size %ld\n", section, size); + printf("success alloc section %d, size %ld\n", section, size); if (size != 0L) bzero(alloc_ptr, size); return alloc_ptr; } - printk("can't alloc section %d\n", section); + printf("can't alloc section %d\n", section); return NULL; } #endif int bcm_wlan_set_plat_data(void) { - printk("======== %s ========\n", __FUNCTION__); + printf("======== %s ========\n", __FUNCTION__); dhd_wlan_control.set_power = bcm_wlan_set_power; dhd_wlan_control.set_carddetect = bcm_wlan_set_carddetect; dhd_wlan_control.get_mac_addr = bcm_wlan_get_mac_address; diff --git a/bcmdhd_1_201_59_x/dhd_linux.c b/bcmdhd_1_201_59_x/dhd_linux.c index 3933f14..8e08ce8 100644 --- a/bcmdhd_1_201_59_x/dhd_linux.c +++ b/bcmdhd_1_201_59_x/dhd_linux.c @@ -4227,7 +4227,7 @@ dhd_stop(struct net_device *net) dhd_info_t *dhd = DHD_DEV_INFO(net); DHD_OS_WAKE_LOCK(&dhd->pub); DHD_PERIM_LOCK(&dhd->pub); - printk("%s: Enter %p\n", __FUNCTION__, net); + printf("%s: Enter %p\n", __FUNCTION__, net); if (dhd->pub.up == 0) { goto exit; } @@ -4290,7 +4290,7 @@ exit: dhd->pub.dhd_cspec.ccode[0] = 0x00; } - printk("%s: Exit\n", __FUNCTION__); + printf("%s: Exit\n", __FUNCTION__); DHD_PERIM_UNLOCK(&dhd->pub); DHD_OS_WAKE_UNLOCK(&dhd->pub); return 0; @@ -4336,7 +4336,7 @@ dhd_open(struct net_device *net) int ifidx; int32 ret = 0; - printk("%s: Enter %p\n", __FUNCTION__, net); + printf("%s: Enter %p\n", __FUNCTION__, net); #if defined(MULTIPLE_SUPPLICANT) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1 if (mutex_is_locked(&_dhd_sdio_mutex_lock_) != 0) { @@ -4457,7 +4457,7 @@ exit: #endif #endif /* MULTIPLE_SUPPLICANT */ - printk("%s: Exit ret=%d\n", __FUNCTION__, ret); + printf("%s: Exit ret=%d\n", __FUNCTION__, ret); return ret; } @@ -6094,6 +6094,8 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) DHD_TRACE(("Enter %s\n", __FUNCTION__)); dhd_conf_set_band(dhd); + printf("%s: Set tcpack_sup_mode %d\n", __FUNCTION__, dhd->conf->tcpack_sup_mode); + dhd_tcpack_suppress_set(dhd, dhd->conf->tcpack_sup_mode); dhd->op_mode = 0; if ((!op_mode && dhd_get_fw_mode(dhd->info) == DHD_FLAG_MFG_MODE) || @@ -6114,7 +6116,8 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) bcm_mkiovar("cur_etheraddr", (void *)&ea_addr, ETHER_ADDR_LEN, buf, sizeof(buf)); ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, buf, sizeof(buf), TRUE, 0); if (ret < 0) { - DHD_ERROR(("%s: can't set MAC address , error=%d\n", __FUNCTION__, ret)); + DHD_ERROR(("%s: can't set MAC address MAC="MACDBG", error=%d\n", + __FUNCTION__, MAC2STRDBG(ea_addr.octet), ret)); ret = BCME_NOTUP; goto done; } @@ -6590,7 +6593,7 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) setbit(eventmask, WLC_E_TXFAIL); #endif setbit(eventmask, WLC_E_JOIN_START); - setbit(eventmask, WLC_E_SCAN_COMPLETE); +// setbit(eventmask, WLC_E_SCAN_COMPLETE); // terence 20150628: remove redundant event #ifdef WLMEDIA_HTSF setbit(eventmask, WLC_E_HTSFSYNC); #endif /* WLMEDIA_HTSF */ @@ -7595,7 +7598,7 @@ dhd_clear(dhd_pub_t *dhdp) static void dhd_module_cleanup(void) { - printk("%s: Enter\n", __FUNCTION__); + printf("%s: Enter\n", __FUNCTION__); dhd_bus_unregister(); @@ -7605,7 +7608,7 @@ dhd_module_cleanup(void) #ifdef CUSTOMER_HW_AMLOGIC wifi_teardown_dt(); #endif - printk("%s: Exit\n", __FUNCTION__); + printf("%s: Exit\n", __FUNCTION__); } static void __exit @@ -7621,10 +7624,10 @@ dhd_module_init(void) int err; int retry = POWERUP_MAX_RETRY; - printk("%s: in\n", __FUNCTION__); + printf("%s: in\n", __FUNCTION__); #ifdef CUSTOMER_HW_AMLOGIC if (wifi_setup_dt()) { - printk("wifi_dt : fail to setup dt\n"); + printf("wifi_dt : fail to setup dt\n"); } #endif @@ -7663,7 +7666,7 @@ dhd_module_init(void) DHD_ERROR(("%s: Failed to load driver max retry reached**\n", __FUNCTION__)); } - printk("%s: Exit err=%d\n", __FUNCTION__, err); + printf("%s: Exit err=%d\n", __FUNCTION__, err); return err; } diff --git a/bcmdhd_1_201_59_x/dhd_pcie.c b/bcmdhd_1_201_59_x/dhd_pcie.c index ed41c81..0d5ce7e 100644 --- a/bcmdhd_1_201_59_x/dhd_pcie.c +++ b/bcmdhd_1_201_59_x/dhd_pcie.c @@ -857,10 +857,11 @@ dhdpcie_download_firmware(struct dhd_bus *bus, osl_t *osh) dhd_conf_preinit(bus->dhd); dhd_conf_read_config(bus->dhd, bus->dhd->conf_path); dhd_conf_set_fw_name_by_chip(bus->dhd, bus->fw_path); + dhd_conf_set_nv_name_by_chip(bus->dhd, bus->nv_path); - printk("Final fw_path=%s\n", bus->fw_path); - printk("Final nv_path=%s\n", bus->nv_path); - printk("Final conf_path=%s\n", bus->dhd->conf_path); + printf("Final fw_path=%s\n", bus->fw_path); + printf("Final nv_path=%s\n", bus->nv_path); + printf("Final conf_path=%s\n", bus->dhd->conf_path); ret = _dhdpcie_download_firmware(bus); @@ -884,7 +885,7 @@ dhdpcie_download_code_file(struct dhd_bus *bus, char *pfw_path) */ image = dhd_os_open_image(pfw_path); if (image == NULL) { - printk("%s: Open firmware file failed %s\n", __FUNCTION__, pfw_path); + printf("%s: Open firmware file failed %s\n", __FUNCTION__, pfw_path); goto err; } @@ -955,7 +956,7 @@ dhdpcie_download_nvram(struct dhd_bus *bus) if (nvram_file_exists) { image = dhd_os_open_image(pnv_path); if (image == NULL) { - printk("%s: Open nvram file failed %s\n", __FUNCTION__, pnv_path); + printf("%s: Open nvram file failed %s\n", __FUNCTION__, pnv_path); goto err; } } diff --git a/bcmdhd_1_201_59_x/dhd_sdio.c b/bcmdhd_1_201_59_x/dhd_sdio.c index 7b4476c..1efa3f8 100644 --- a/bcmdhd_1_201_59_x/dhd_sdio.c +++ b/bcmdhd_1_201_59_x/dhd_sdio.c @@ -4314,7 +4314,7 @@ dhd_txglom_enable(dhd_pub_t *dhdp, bool enable) } else #endif /* BCMSDIOH_TXGLOM */ bus->txglom_enable = FALSE; - printk("%s: enable %d\n", __FUNCTION__, bus->txglom_enable); + printf("%s: enable %d\n", __FUNCTION__, bus->txglom_enable); } int @@ -7663,9 +7663,9 @@ dhdsdio_download_firmware(struct dhd_bus *bus, osl_t *osh, void *sdh) dhd_conf_set_fw_name_by_mac(bus->dhd, bus->sdh, bus->fw_path); dhd_conf_set_nv_name_by_mac(bus->dhd, bus->sdh, bus->nv_path); - printk("Final fw_path=%s\n", bus->fw_path); - printk("Final nv_path=%s\n", bus->nv_path); - printk("Final conf_path=%s\n", bus->dhd->conf_path); + printf("Final fw_path=%s\n", bus->fw_path); + printf("Final nv_path=%s\n", bus->nv_path); + printf("Final conf_path=%s\n", bus->dhd->conf_path); ret = _dhdsdio_download_firmware(bus); @@ -7996,7 +7996,7 @@ dhdsdio_download_code_file(struct dhd_bus *bus, char *pfw_path) image = dhd_os_open_image(pfw_path); if (image == NULL) { - printk("%s: Open firmware file failed %s\n", __FUNCTION__, pfw_path); + printf("%s: Open firmware file failed %s\n", __FUNCTION__, pfw_path); goto err; } @@ -8118,7 +8118,7 @@ dhdsdio_download_nvram(struct dhd_bus *bus) if (nvram_file_exists) { image = dhd_os_open_image(pnv_path); if (image == NULL) { - printk("%s: Open nvram file failed %s\n", __FUNCTION__, pnv_path); + printf("%s: Open nvram file failed %s\n", __FUNCTION__, pnv_path); goto err; } } @@ -8396,14 +8396,14 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag) dhd_txglom_enable(dhdp, FALSE); dhd_os_sdunlock(dhdp); - printk("%s: WLAN OFF DONE\n", __FUNCTION__); + printf("%s: WLAN OFF DONE\n", __FUNCTION__); /* App can now remove power from device */ } else bcmerror = BCME_SDIO_ERROR; } else { /* App must have restored power to device before calling */ - printk("\n\n%s: == WLAN ON ==\n", __FUNCTION__); + printf("\n\n%s: == WLAN ON ==\n", __FUNCTION__); if (bus->dhd->dongle_reset) { /* Turn on WLAN */ @@ -8452,9 +8452,9 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag) dhd_os_sdunlock(dhdp); } else { bcmerror = BCME_SDIO_ERROR; - printk("%s called when dongle is not in reset\n", + printf("%s called when dongle is not in reset\n", __FUNCTION__); - printk("Will call dhd_bus_start instead\n"); + printf("Will call dhd_bus_start instead\n"); dhd_bus_resume(dhdp, 1); #if defined(HW_OOB) dhd_conf_set_hw_oob_intr(bus->sdh, bus->sih->chip); // terence 20120615: fix for OOB initial issue diff --git a/bcmdhd_1_201_59_x/dhd_static_buf.c b/bcmdhd_1_201_59_x/dhd_static_buf.c index 131a808..1ebd3ee 100644 --- a/bcmdhd_1_201_59_x/dhd_static_buf.c +++ b/bcmdhd_1_201_59_x/dhd_static_buf.c @@ -1,171 +1,179 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#define CONFIG_BROADCOM_WIFI_RESERVED_MEM - -#ifdef CONFIG_BROADCOM_WIFI_RESERVED_MEM - -#define WLAN_STATIC_PKT_BUF 4 -#define WLAN_STATIC_SCAN_BUF0 5 -#define WLAN_STATIC_SCAN_BUF1 6 -#define WLAN_STATIC_DHD_INFO 7 -#define PREALLOC_WLAN_SEC_NUM 5 -#define PREALLOC_WLAN_BUF_NUM 160 -#define PREALLOC_WLAN_SECTION_HEADER 24 - -#define WLAN_SECTION_SIZE_0 (PREALLOC_WLAN_BUF_NUM * 128) -#define WLAN_SECTION_SIZE_1 (PREALLOC_WLAN_BUF_NUM * 128) -#define WLAN_SECTION_SIZE_2 (PREALLOC_WLAN_BUF_NUM * 512) -#define WLAN_SECTION_SIZE_3 (PREALLOC_WLAN_BUF_NUM * 1024) -#define WLAN_SECTION_SIZE_7 (PREALLOC_WLAN_BUF_NUM * 128) - -#define DHD_SKB_HDRSIZE 336 -#define DHD_SKB_1PAGE_BUFSIZE ((PAGE_SIZE*1)-DHD_SKB_HDRSIZE) -#define DHD_SKB_2PAGE_BUFSIZE ((PAGE_SIZE*2)-DHD_SKB_HDRSIZE) -#define DHD_SKB_4PAGE_BUFSIZE ((PAGE_SIZE*4)-DHD_SKB_HDRSIZE) - -#define WLAN_SKB_BUF_NUM 17 - -static struct sk_buff *wlan_static_skb[WLAN_SKB_BUF_NUM]; - -struct wlan_mem_prealloc { - void *mem_ptr; - unsigned long size; -}; - -static struct wlan_mem_prealloc wlan_mem_array[PREALLOC_WLAN_SEC_NUM] = { - {NULL, (WLAN_SECTION_SIZE_0 + PREALLOC_WLAN_SECTION_HEADER)}, - {NULL, (WLAN_SECTION_SIZE_1 + PREALLOC_WLAN_SECTION_HEADER)}, - {NULL, (WLAN_SECTION_SIZE_2 + PREALLOC_WLAN_SECTION_HEADER)}, - {NULL, (WLAN_SECTION_SIZE_3 + PREALLOC_WLAN_SECTION_HEADER)}, - {NULL, (WLAN_SECTION_SIZE_7 + PREALLOC_WLAN_SECTION_HEADER)} -}; - -void *wlan_static_scan_buf0; -void *wlan_static_scan_buf1; -void *bcmdhd_mem_prealloc(int section, unsigned long size) -{ - if (section == WLAN_STATIC_PKT_BUF) { - printk("1 %s: section=%d, wlan_static_skb=%p\n", - __FUNCTION__, section, wlan_static_skb); - return wlan_static_skb; - } - if (section == WLAN_STATIC_SCAN_BUF0) { - printk("2 %s: section=%d, wlan_static_scan_buf0=%p\n", - __FUNCTION__, section, wlan_static_scan_buf0); - return wlan_static_scan_buf0; - } - if (section == WLAN_STATIC_SCAN_BUF1) { - printk("3 %s: section=%d, wlan_static_scan_buf1=%p\n", - __FUNCTION__, section, wlan_static_scan_buf1); - return wlan_static_scan_buf1; - } - if (section == WLAN_STATIC_DHD_INFO) { - printk("4 %s: section=%d, wlan_mem_array[4]=%p\n", - __FUNCTION__, section, wlan_mem_array[4].mem_ptr); - return wlan_mem_array[4].mem_ptr; - } - if ((section < 0) || (section > PREALLOC_WLAN_SEC_NUM)) { - printk("5 %s: out of section %d\n", __FUNCTION__, section); - return NULL; - } - - if (wlan_mem_array[section].size < size) { - printk("6 %s: wlan_mem_array[section].size=%lu, size=%lu\n", - __FUNCTION__, wlan_mem_array[section].size, size); - return NULL; - } - printk("7 %s: wlan_mem_array[section].mem_ptr=%p, size=%lu\n", - __FUNCTION__, &wlan_mem_array[section], size); - - return wlan_mem_array[section].mem_ptr; -} - -EXPORT_SYMBOL(bcmdhd_mem_prealloc); - +#include +#include +#include +#include +#include +#include +#include +#include + +#define CONFIG_BROADCOM_WIFI_RESERVED_MEM + +#ifdef CONFIG_BROADCOM_WIFI_RESERVED_MEM + +#define WLAN_STATIC_PKT_BUF 4 +#define WLAN_STATIC_SCAN_BUF0 5 +#define WLAN_STATIC_SCAN_BUF1 6 +#define WLAN_STATIC_DHD_INFO 7 +#define WLAN_STATIC_DHD_WLFC_INFO 8 +#define PREALLOC_WLAN_SEC_NUM 6 +#define PREALLOC_WLAN_BUF_NUM 160 +#define PREALLOC_WLAN_SECTION_HEADER 24 + +#define WLAN_SECTION_SIZE_0 (PREALLOC_WLAN_BUF_NUM * 128) +#define WLAN_SECTION_SIZE_1 (PREALLOC_WLAN_BUF_NUM * 128) +#define WLAN_SECTION_SIZE_2 (PREALLOC_WLAN_BUF_NUM * 512) +#define WLAN_SECTION_SIZE_3 (PREALLOC_WLAN_BUF_NUM * 1024) +#define WLAN_SECTION_SIZE_7 (PREALLOC_WLAN_BUF_NUM * 128) +#define WLAN_SECTION_SIZE_8 (PREALLOC_WLAN_BUF_NUM * 512) + +#define DHD_SKB_HDRSIZE 336 +#define DHD_SKB_1PAGE_BUFSIZE ((PAGE_SIZE*1)-DHD_SKB_HDRSIZE) +#define DHD_SKB_2PAGE_BUFSIZE ((PAGE_SIZE*2)-DHD_SKB_HDRSIZE) +#define DHD_SKB_4PAGE_BUFSIZE ((PAGE_SIZE*4)-DHD_SKB_HDRSIZE) + +#define WLAN_SKB_BUF_NUM 17 + +static struct sk_buff *wlan_static_skb[WLAN_SKB_BUF_NUM]; + +struct wlan_mem_prealloc { + void *mem_ptr; + unsigned long size; +}; + +static struct wlan_mem_prealloc wlan_mem_array[PREALLOC_WLAN_SEC_NUM] = { + {NULL, (WLAN_SECTION_SIZE_0 + PREALLOC_WLAN_SECTION_HEADER)}, + {NULL, (WLAN_SECTION_SIZE_1 + PREALLOC_WLAN_SECTION_HEADER)}, + {NULL, (WLAN_SECTION_SIZE_2 + PREALLOC_WLAN_SECTION_HEADER)}, + {NULL, (WLAN_SECTION_SIZE_3 + PREALLOC_WLAN_SECTION_HEADER)}, + {NULL, (WLAN_SECTION_SIZE_7 + PREALLOC_WLAN_SECTION_HEADER)}, + {NULL, (WLAN_SECTION_SIZE_8 + PREALLOC_WLAN_SECTION_HEADER)} +}; + +void *wlan_static_scan_buf0; +void *wlan_static_scan_buf1; +void *bcmdhd_mem_prealloc(int section, unsigned long size) +{ + if (section == WLAN_STATIC_PKT_BUF) { + printk("1 %s: section=%d, wlan_static_skb=%p\n", + __FUNCTION__, section, wlan_static_skb); + return wlan_static_skb; + } + if (section == WLAN_STATIC_SCAN_BUF0) { + printk("2 %s: section=%d, wlan_static_scan_buf0=%p\n", + __FUNCTION__, section, wlan_static_scan_buf0); + return wlan_static_scan_buf0; + } + if (section == WLAN_STATIC_SCAN_BUF1) { + printk("3 %s: section=%d, wlan_static_scan_buf1=%p\n", + __FUNCTION__, section, wlan_static_scan_buf1); + return wlan_static_scan_buf1; + } + if (section == WLAN_STATIC_DHD_INFO) { + printk("4 %s: section=%d, wlan_mem_array[4]=%p\n", + __FUNCTION__, section, wlan_mem_array[4].mem_ptr); + return wlan_mem_array[4].mem_ptr; + } + if (section == WLAN_STATIC_DHD_WLFC_INFO) { + printk("5 %s: section=%d, wlan_mem_array[5]=%p\n", + __FUNCTION__, section, wlan_mem_array[5].mem_ptr); + return wlan_mem_array[5].mem_ptr; + } + if ((section < 0) || (section > PREALLOC_WLAN_SEC_NUM)) { + printk("6 %s: out of section %d\n", __FUNCTION__, section); + return NULL; + } + + if (wlan_mem_array[section].size < size) { + printk("7 %s: wlan_mem_array[section].size=%lu, size=%lu\n", + __FUNCTION__, wlan_mem_array[section].size, size); + return NULL; + } + printk("8 %s: wlan_mem_array[section].mem_ptr=%p, size=%lu\n", + __FUNCTION__, &wlan_mem_array[section], size); + + return wlan_mem_array[section].mem_ptr; +} + +EXPORT_SYMBOL(bcmdhd_mem_prealloc); + int bcmdhd_init_wlan_mem(void) -{ - int i; - int j; - - for (i=0; i<8; i++) { - wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE); - if (!wlan_static_skb[i]) +{ + int i; + int j; + + for (i=0; i<8; i++) { + wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_1PAGE_BUFSIZE); + if (!wlan_static_skb[i]) goto err_skb_alloc; - printk("1 %s: wlan_static_skb[%d]=%p, size=%lu\n", - __FUNCTION__, i, wlan_static_skb[i], DHD_SKB_1PAGE_BUFSIZE); - } - - for (; i<16; i++) { - wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_2PAGE_BUFSIZE); - if (!wlan_static_skb[i]) + printk("1 %s: wlan_static_skb[%d]=%p, size=%lu\n", + __FUNCTION__, i, wlan_static_skb[i], DHD_SKB_1PAGE_BUFSIZE); + } + + for (; i<16; i++) { + wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_2PAGE_BUFSIZE); + if (!wlan_static_skb[i]) goto err_skb_alloc; - printk("2 %s: wlan_static_skb[%d]=%p, size=%lu\n", - __FUNCTION__, i, wlan_static_skb[i], DHD_SKB_2PAGE_BUFSIZE); - } - - wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_4PAGE_BUFSIZE); - if (!wlan_static_skb[i]) + printk("2 %s: wlan_static_skb[%d]=%p, size=%lu\n", + __FUNCTION__, i, wlan_static_skb[i], DHD_SKB_2PAGE_BUFSIZE); + } + + wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_4PAGE_BUFSIZE); + if (!wlan_static_skb[i]) goto err_skb_alloc; - printk("3 %s: wlan_static_skb[%d]=%p, size=%lu\n", - __FUNCTION__, i, wlan_static_skb[i], DHD_SKB_4PAGE_BUFSIZE); - - for (i=0; iname, ap, infra, type); wl_set_p2p_status(cfg, IF_CHANGING); wl_clr_p2p_status(cfg, IF_CHANGED); @@ -4507,7 +4507,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev, err = wldev_iovar_setbuf_bsscfg(dev, "join", ext_join_params, join_params_size, cfg->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &cfg->ioctl_buf_sync); - printk("Connectting with " MACDBG " channel (%d) ssid \"%s\", len (%d)\n\n", + printf("Connectting with " MACDBG " channel (%d) ssid \"%s\", len (%d)\n\n", MAC2STRDBG((u8*)(&ext_join_params->assoc.bssid)), cfg->channel, ext_join_params->ssid.SSID, ext_join_params->ssid.SSID_len); @@ -6615,7 +6615,7 @@ wl_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, dev = ndev_to_wlc_ndev(dev, cfg); #endif _chan = ieee80211_frequency_to_channel(chan->center_freq); - printk("netdev_ifidx(%d), chan_type(%d) target channel(%d) \n", + printf("netdev_ifidx(%d), chan_type(%d) target channel(%d) \n", dev->ifindex, channel_type, _chan); #ifdef CUSTOM_PLATFORM_NV_TEGRA @@ -7887,7 +7887,7 @@ wl_cfg80211_del_station( sizeof(scb_val_t), true); if (err < 0) WL_ERR(("WLC_SCB_DEAUTHENTICATE_FOR_REASON err %d\n", err)); - printk("Disconnect STA : %s scb_val.val %d\n", + printf("Disconnect STA : %s scb_val.val %d\n", bcm_ether_ntoa((const struct ether_addr *)mac_addr, eabuf), scb_val.val); @@ -9135,16 +9135,16 @@ static s32 wl_inform_single_bss(struct bcm_cfg80211 *cfg, struct wl_bss_info *bi return -EINVAL; } channel = ieee80211_get_channel(wiphy, freq); + WL_SCAN(("BSSID %pM, channel %d, rssi %d, capa 0x04%x, mgmt_type %d, " + "frame_len %d, SSID \"%s\"\n", &bi->BSSID, notif_bss_info->channel, + notif_bss_info->rssi, mgmt->u.beacon.capab_info, mgmt_type, + notif_bss_info->frame_len, bi->SSID)); if (unlikely(!channel)) { WL_ERR(("ieee80211_get_channel error, freq=%d, channel=%d\n", freq, notif_bss_info->channel)); kfree(notif_bss_info); return -EINVAL; } - WL_SCAN(("BSSID %pM, channel %d, rssi %d, capa 0x04%x, mgmt_type %d, " - "frame_len %d, SSID \"%s\"\n", &bi->BSSID, notif_bss_info->channel, - notif_bss_info->rssi, mgmt->u.beacon.capab_info, mgmt_type, - notif_bss_info->frame_len, bi->SSID)); signal = notif_bss_info->rssi * 100; if (!mgmt->u.probe_resp.timestamp) { @@ -9414,13 +9414,13 @@ exit: } sinfo.assoc_req_ies = data; sinfo.assoc_req_ies_len = len; - printk("%s: connected device "MACDBG"\n", __FUNCTION__, MAC2STRDBG(e->addr.octet)); + printf("%s: connected device "MACDBG"\n", __FUNCTION__, MAC2STRDBG(e->addr.octet)); cfg80211_new_sta(ndev, e->addr.octet, &sinfo, GFP_ATOMIC); } else if (event == WLC_E_DISASSOC_IND) { - printk("%s: disassociated device "MACDBG"\n", __FUNCTION__, MAC2STRDBG(e->addr.octet)); + printf("%s: disassociated device "MACDBG"\n", __FUNCTION__, MAC2STRDBG(e->addr.octet)); cfg80211_del_sta(ndev, e->addr.octet, GFP_ATOMIC); } else if ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH)) { - printk("%s: deauthenticated device "MACDBG"\n", __FUNCTION__, MAC2STRDBG(e->addr.octet)); + printf("%s: deauthenticated device "MACDBG"\n", __FUNCTION__, MAC2STRDBG(e->addr.octet)); cfg80211_del_sta(ndev, e->addr.octet, GFP_ATOMIC); } #endif /* LINUX_VERSION < VERSION(3,2,0) && !WL_CFG80211_STA_EVENT && !WL_COMPAT_WIRELESS */ @@ -9559,7 +9559,7 @@ wl_notify_connect_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, wl_link_up(cfg); act = true; if (!wl_get_drv_status(cfg, DISCONNECTING, ndev)) { - printk("wl_bss_connect_done succeeded with " MACDBG "\n", + printf("wl_bss_connect_done succeeded with " MACDBG "\n", MAC2STRDBG((u8*)(&e->addr))); wl_bss_connect_done(cfg, ndev, e, data, true); dhd_conf_set_phyoclscdenable((dhd_pub_t *)cfg->pub); @@ -9591,7 +9591,7 @@ wl_notify_connect_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, /* WLAN_REASON_UNSPECIFIED is used for hang up event in Android */ reason = (reason == WLAN_REASON_UNSPECIFIED)? 0 : reason; - printk("link down if %s may call cfg80211_disconnected. " + printf("link down if %s may call cfg80211_disconnected. " "event : %d, reason=%d from " MACDBG "\n", ndev->name, event, ntoh32(e->reason), MAC2STRDBG((u8*)(&e->addr))); @@ -9628,7 +9628,7 @@ wl_notify_connect_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, } } else if (wl_get_drv_status(cfg, CONNECTING, ndev)) { - printk("link down, during connecting\n"); + printf("link down, during connecting\n"); #ifdef ESCAN_RESULT_PATCH if ((memcmp(connect_req_bssid, broad_bssid, ETHER_ADDR_LEN) == 0) || (memcmp(&e->addr, broad_bssid, ETHER_ADDR_LEN) == 0) || @@ -9644,7 +9644,7 @@ wl_notify_connect_status(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev, complete(&cfg->iface_disable); } else if (wl_is_nonetwork(cfg, e)) { - printk("connect failed event=%d e->status %d e->reason %d \n", + printf("connect failed event=%d e->status %d e->reason %d \n", event, (int)ntoh32(e->status), (int)ntoh32(e->reason)); /* Clean up any pending scan request */ if (cfg->scan_request) @@ -10007,7 +10007,7 @@ wl_bss_roaming_done(struct bcm_cfg80211 *cfg, struct net_device *ndev, memcpy(cfg->fbt_key, data, FBT_KEYLEN); } #endif /* WLFBT */ - printk("wl_bss_roaming_done succeeded to " MACDBG "\n", + printf("wl_bss_roaming_done succeeded to " MACDBG "\n", MAC2STRDBG((u8*)(&e->addr))); dhd_conf_set_wme((dhd_pub_t *)cfg->pub); @@ -10956,6 +10956,7 @@ wl_cfg80211_netdev_notifier_call(struct notifier_block * nb, #if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0)) struct net_device *dev = ptr; #else + // terence 20150701: fix for p2p connection issue struct net_device *dev = netdev_notifier_info_to_dev(ptr); #endif struct wireless_dev *wdev = dev->ieee80211_ptr; @@ -11628,7 +11629,7 @@ static void wl_cfg80211_determine_vsdb_mode(struct bcm_cfg80211 *cfg) } } } - printk("%s concurrency is enabled\n", cfg->vsdb_mode ? "Multi Channel" : "Same Channel"); + printf("%s concurrency is enabled\n", cfg->vsdb_mode ? "Multi Channel" : "Same Channel"); return; } @@ -11963,7 +11964,7 @@ s32 wl_cfg80211_attach_post(struct net_device *ndev) /* Update MAC addr for p2p0 interface here. */ memcpy(cfg->p2p_net->dev_addr, ndev->dev_addr, ETH_ALEN); cfg->p2p_net->dev_addr[0] |= 0x02; - printk("%s: p2p_dev_addr="MACDBG "\n", + printf("%s: p2p_dev_addr="MACDBG "\n", cfg->p2p_net->name, MAC2STRDBG(cfg->p2p_net->dev_addr)); } else { @@ -12200,7 +12201,7 @@ static s32 wl_event_handler(void *data) cfg = (struct bcm_cfg80211 *)tsk->parent; - printk("tsk Enter, tsk = 0x%p\n", tsk); + printf("tsk Enter, tsk = 0x%p\n", tsk); while (down_interruptible (&tsk->sema) == 0) { SMP_RD_BARRIER_DEPENDS(); @@ -12270,7 +12271,7 @@ static s32 wl_event_handler(void *data) } DHD_OS_WAKE_UNLOCK(cfg->pub); } - printk("%s: was terminated\n", __FUNCTION__); + printf("%s: was terminated\n", __FUNCTION__); complete_and_exit(&tsk->completed, 0); return 0; } @@ -15060,7 +15061,7 @@ int wl_cfg80211_do_driver_init(struct net_device *net) void wl_cfg80211_enable_trace(u32 level) { wl_dbg_level = level; - printk("%s: wl_dbg_level = 0x%x\n", __FUNCTION__, wl_dbg_level); + printf("%s: wl_dbg_level = 0x%x\n", __FUNCTION__, wl_dbg_level); } #if defined(WL_SUPPORT_BACKPORTED_KPATCHES) || (LINUX_VERSION_CODE >= KERNEL_VERSION(3, \ diff --git a/bcmdhd_1_201_59_x/wl_cfgp2p.c b/bcmdhd_1_201_59_x/wl_cfgp2p.c index 5823541..f2133d1 100644 --- a/bcmdhd_1_201_59_x/wl_cfgp2p.c +++ b/bcmdhd_1_201_59_x/wl_cfgp2p.c @@ -2659,7 +2659,7 @@ wl_cfgp2p_register_ndev(struct bcm_cfg80211 *cfg) #endif /* WL_NEWCFG_PRIVCMD_SUPPORT */ cfg->p2p_net = net; - printk("%s: P2P Interface Registered\n", net->name); + printf("%s: P2P Interface Registered\n", net->name); return ret; } diff --git a/bcmdhd_1_201_59_x/wl_iw.c b/bcmdhd_1_201_59_x/wl_iw.c index 219c1df..2f826a5 100644 --- a/bcmdhd_1_201_59_x/wl_iw.c +++ b/bcmdhd_1_201_59_x/wl_iw.c @@ -3418,12 +3418,12 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data) cmd = SIOCGIWAP; wrqu.data.length = strlen(extra); if (!(flags & WLC_EVENT_MSG_LINK)) { - printk("%s: Link Down with BSSID="MACSTR"\n", __FUNCTION__, + printf("%s: Link Down with BSSID="MACSTR"\n", __FUNCTION__, MAC2STR((u8 *)wrqu.addr.sa_data)); bzero(wrqu.addr.sa_data, ETHER_ADDR_LEN); bzero(&extra, ETHER_ADDR_LEN); } else { - printk("%s: Link UP with BSSID="MACSTR"\n", __FUNCTION__, + printf("%s: Link UP with BSSID="MACSTR"\n", __FUNCTION__, MAC2STR((u8 *)wrqu.addr.sa_data)); } break; @@ -3783,7 +3783,7 @@ _iscan_sysioc_thread(void *data) uint32 status; iscan_info_t *iscan = (iscan_info_t *)data; - printk("%s: thread Enter\n", __FUNCTION__); + printf("%s: thread Enter\n", __FUNCTION__); DAEMONIZE("iscan_sysioc"); status = WL_SCAN_RESULTS_PARTIAL; @@ -3839,7 +3839,7 @@ _iscan_sysioc_thread(void *data) break; } } - printk("%s: was terminated\n", __FUNCTION__); + printf("%s: was terminated\n", __FUNCTION__); complete_and_exit(&iscan->sysioc_exited, 0); } @@ -3848,7 +3848,7 @@ wl_iw_attach(struct net_device *dev, void * dhdp) { iscan_info_t *iscan = NULL; - printk("%s: Enter\n", __FUNCTION__); + printf("%s: Enter\n", __FUNCTION__); if (!dev) return 0; -- 2.20.1