-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 \
- -DTSQ_MULTIPLIER -DMFP \
- -DBCMSDIOH_TXGLOM_EXT -DWL_EXT_IAPSTA \
+ -DTSQ_MULTIPLIER -DMFP \
+ -DBCMSDIOH_TXGLOM_EXT -DWL_EXT_IAPSTA \
-DENABLE_INSMOD_NO_FW_LOAD \
-I$(src) -I$(src)/include
DHDCFLAGS += -DESCAN_RESULT_PATCH
DHDCFLAGS += -DVSDB -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST
DHDCFLAGS += -DWLTDLS -DMIRACAST_AMPDU_SIZE=8
+DHDCFLAGS += -DWL_VIRTUAL_APSTA
endif
EXTRA_CFLAGS = $(DHDCFLAGS)
ifeq ($(CONFIG_BCMDHD),m)
err_ret = sdio_enable_func(sd->func[1]);
sdio_release_host(sd->func[1]);
if (err_ret) {
- sd_err(("bcmsdh_sdmmc: Failed to enable F1 Err: 0x%08x", err_ret));
+ sd_err(("bcmsdh_sdmmc: Failed to enable F1 Err: 0x%08x\n", err_ret));
}
return FALSE;
return (((err_ret == 0)&&(err_ret2 == 0)) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
}
+#ifdef BCMSDIOH_TXGLOM
static SDIOH_API_RC
sdioh_request_packet_chain(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
uint addr, void *pkt)
uint32 sg_count;
struct sdio_func *sdio_func = sd->func[func];
struct mmc_host *host = sdio_func->card->host;
-#ifdef BCMSDIOH_TXGLOM
uint8 *localbuf = NULL;
uint local_plen = 0;
uint pkt_len = 0;
-#endif /* BCMSDIOH_TXGLOM */
struct timespec now, before;
sd_trace(("%s: Enter\n", __FUNCTION__));
pkt_offset = 0;
pnext = pkt;
-#ifdef BCMSDIOH_TXGLOM
ttl_len = 0;
sg_count = 0;
if(sd->txglom_mode == SDPCM_TXGLOM_MDESC) {
-#endif
while (pnext != NULL) {
ttl_len = 0;
sg_count = 0;
return SDIOH_API_RC_FAIL;
}
}
-#ifdef BCMSDIOH_TXGLOM
} else if(sd->txglom_mode == SDPCM_TXGLOM_CPY) {
for (pnext = pkt; pnext; pnext = PKTNEXT(sd->osh, pnext)) {
ttl_len += PKTLEN(sd->osh, pnext);
if (localbuf)
MFREE(sd->osh, localbuf, ttl_len);
-#endif /* BCMSDIOH_TXGLOM */
if (sd_msglevel & SDH_COST_VAL) {
getnstimeofday(&now);
sd_trace(("%s: Exit\n", __FUNCTION__));
return SDIOH_API_RC_SUCCESS;
}
+#endif /* BCMSDIOH_TXGLOM */
static SDIOH_API_RC
sdioh_buffer_tofrom_bus(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
uint
sdmmc_get_clock_rate(sdioh_info_t *sd)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
+ return 0;
+#else
struct sdio_func *sdio_func = sd->func[0];
struct mmc_host *host = sdio_func->card->host;
return mmc_host_clk_rate(host);
+#endif
}
void
sdmmc_set_clock_rate(sdioh_info_t *sd, uint hz)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
+ return;
+#else
struct sdio_func *sdio_func = sd->func[0];
struct mmc_host *host = sdio_func->card->host;
struct mmc_ios *ios = &host->ios;
host->ops->set_ios(host, ios);
DHD_ERROR(("%s: After change: sd clock rate is %u\n", __FUNCTION__, ios->clock));
mmc_host_clk_release(host);
+#endif
}
void
#define WL_VENDOR_EXT_SUPPORT
#endif /* 3.18 > KERNEL_VER >= 3.14 || defined(CONFIG_BCMDHD_VENDOR_EXT) */
+/*#if !defined(WL_VENDOR_EXT_SUPPORT)
+#undef GSCAN_SUPPORT
+#endif
+*/
#if defined(KEEP_ALIVE)
/* Default KEEP_ALIVE Period is 55 sec to prevent AP from sending Keep Alive probe frame */
#define KEEP_ALIVE_PERIOD 55000
DHD_BUS_DATA, /* Ready for frame transfers */
DHD_BUS_SUSPEND, /* Bus has been suspended */
DHD_BUS_DOWN_IN_PROGRESS, /* Bus going Down */
+ DHD_BUS_REMOVE, /* Bus has been removed */
};
/*
DHD_BUS_BUSY_CHECK_RPM_SUSPEND_IN_PROGRESS(dhdp))
#define DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(dhdp) \
- ((dhdp)->busstate == DHD_BUS_DOWN || (dhdp)->busstate == DHD_BUS_DOWN_IN_PROGRESS)
+ ((dhdp)->busstate == DHD_BUS_DOWN || (dhdp)->busstate == DHD_BUS_DOWN_IN_PROGRESS || \
+ (dhdp)->busstate == DHD_BUS_REMOVE)
+
+#define DHD_BUS_CHECK_REMOVE(dhdp) \
+ ((dhdp)->busstate == DHD_BUS_REMOVE)
/* Macro to print Ethernet Address as String
* expects both arguements as (char *)
#define WIFI_TURNON_DELAY DEFAULT_WIFI_TURNON_DELAY
#endif /* WIFI_TURNON_DELAY */
+#ifdef BCMSDIO
#define DEFAULT_DHD_WATCHDOG_INTERVAL_MS 10 /* msec */
+#else
+#define DEFAULT_DHD_WATCHDOG_INTERVAL_MS 0 /* msec */
+#endif
#ifndef CUSTOM_DHD_WATCHDOG_MS
#define CUSTOM_DHD_WATCHDOG_MS DEFAULT_DHD_WATCHDOG_INTERVAL_MS
#endif /* DEFAULT_DHD_WATCHDOG_INTERVAL_MS */
#if defined(DHD_DEBUG)
const char dhd_version[] = "Dongle Host Driver, version " EPI_VERSION_STR;
#else
-const char dhd_version[] = "\nDongle Host Driver, version " EPI_VERSION_STR "\nCompiled from ";
+const char dhd_version[] = "\nDongle Host Driver, version " EPI_VERSION_STR;
#endif
char fw_version[FW_VER_STR_LEN] = "\0";
char clm_version[CLM_VER_STR_LEN] = "\0";
extern pkt_statics_t tx_statics;
extern void dhdsdio_txpktstatics(void);
#endif
+
static int
dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, uint32 actionid, const char *name,
void *params, int plen, void *arg, int len, int val_size)
bcmstricmp((char *)buf, "pciecfgreg") &&
bcmstricmp((char *)buf, "devreset") &&
bcmstricmp((char *)buf, "sdio_suspend") &&
- bcmstricmp((char *)buf, "control_signal")) {
+ bcmstricmp((char *)buf, "control_signal"))
#else
if (bcmstricmp((char *)buf, "pcie_suspend") &&
bcmstricmp((char *)buf, "pciecfgreg") &&
bcmstricmp((char *)buf, "devreset") &&
- bcmstricmp((char *)buf, "sdio_suspend")) {
+ bcmstricmp((char *)buf, "sdio_suspend"))
#endif /* DHD_EFI */
+ {
DHD_ERROR(("%s: bus is in suspend(%d)"
"or suspending(0x%x) state\n",
__FUNCTION__, dhd_pub->busstate,
return retcode;
}
+
/*
* Neighbor Discover Offload: enable NDO feature
* Called by ipv6 event handler when interface goes down
}
}
+
#ifdef PCIE_FULL_DONGLE
int
dhd_event_logtrace_infobuf_pkt_process(dhd_pub_t *dhdp, void *pktbuf,
if (chiprev == BCM4339A0_CHIP_REV)\r
strcpy(&fw_path[i+1], FW_BCM4339A0);\r
break;\r
- case BCM4345_CHIP_ID:\r
case BCM43454_CHIP_ID:\r
+ if (chiprev == BCM43455C0_CHIP_REV)\r
+ strcpy(&fw_path[i+1], FW_BCM43455C0);\r
+ break;\r
+ case BCM4345_CHIP_ID:\r
if (chiprev == BCM43455C0_CHIP_REV)\r
strcpy(&fw_path[i+1], FW_BCM43455C0);\r
else if (chiprev == BCM43455C5_CHIP_REV)\r
printf("%s: dhd_slpauto = %d\n", __FUNCTION__, dhd_slpauto);\r
}\r
else if (!strncmp("kso_enable=", full_param, len_param)) {\r
- if (!strncmp(data, "1", 1))\r
+ if (!strncmp(data, "0", 1))\r
dhd_slpauto = FALSE;\r
else\r
dhd_slpauto = TRUE;\r
printf("%s: deferred_tx_len = %d\n", __FUNCTION__, conf->deferred_tx_len);\r
}\r
else if (!strncmp("txctl_tmo_fix=", full_param, len_param)) {\r
- if (!strncmp(data, "0", 1))\r
- conf->txctl_tmo_fix = FALSE;\r
- else\r
- conf->txctl_tmo_fix = TRUE;\r
+ conf->txctl_tmo_fix = (int)simple_strtol(data, NULL, 10);\r
printf("%s: txctl_tmo_fix = %d\n", __FUNCTION__, conf->txctl_tmo_fix);\r
}\r
else if (!strncmp("tx_in_rx=", full_param, len_param)) {\r
#endif\r
conf->srl = -1;\r
conf->lrl = -1;\r
- conf->bcn_timeout = 15;\r
+ conf->bcn_timeout = 16;\r
conf->spect = -1;\r
conf->txbf = -1;\r
conf->lpc = -1;\r
conf->tx_max_offset = 0;\r
conf->txglomsize = SDPCM_DEFGLOM_SIZE;\r
conf->dhd_poll = -1;\r
- conf->txctl_tmo_fix = TRUE;\r
+ conf->txctl_tmo_fix = 5;\r
conf->tx_in_rx = TRUE;\r
conf->txglom_mode = SDPCM_TXGLOM_MDESC;\r
conf->deferred_tx_len = 0;\r
conf->dhcpc_enable = -1;\r
conf->dhcpd_enable = -1;\r
#endif\r
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0))\r
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 1, 0))\r
conf->tsq = 10;\r
#else\r
conf->tsq = 0;\r
#ifdef BCMSDIO\r
conf->dhd_txminmax = -1;\r
conf->txinrx_thres = 128;\r
- conf->sd_f2_blocksize = 256;\r
+ conf->sd_f2_blocksize = CUSTOM_SDIO_F2_BLKSIZE;\r
conf->oob_enabled_later = TRUE;\r
#ifdef CUSTOMER_HW_AMLOGIC\r
conf->rxf_cpucore = 2;\r
#endif\r
if (conf->txglomsize > SDPCM_MAXGLOM_SIZE)\r
conf->txglomsize = SDPCM_MAXGLOM_SIZE;\r
- conf->deferred_tx_len = conf->txglomsize;\r
+ conf->deferred_tx_len = 0;\r
#endif\r
\r
return 0;\r
int tx_max_offset;
uint txglomsize;
int dhd_poll;
- bool txctl_tmo_fix;
+ int txctl_tmo_fix;
bool tx_in_rx;
bool txglom_mode;
uint deferred_tx_len;
void dhd_conf_set_hw_oob_intr(bcmsdh_info_t *sdh, uint chip);
#endif
void dhd_conf_set_txglom_params(dhd_pub_t *dhd, bool enable);
+int dhd_conf_set_blksize(bcmsdh_info_t *sdh);
#endif
void dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *fw_path);
void dhd_conf_set_clm_name_by_chip(dhd_pub_t *dhd, char *clm_path);
#endif
int dhd_conf_get_ap_mode_in_suspend(dhd_pub_t *dhd);
int dhd_conf_set_ap_in_suspend(dhd_pub_t *dhd, int suspend);
-int dhd_conf_set_blksize(bcmsdh_info_t *sdh);
int dhd_conf_preinit(dhd_pub_t *dhd);
int dhd_conf_reset(dhd_pub_t *dhd);
int dhd_conf_attach(dhd_pub_t *dhd);
void *buf;
unsigned long flags;
#ifdef CONFIG_DHD_USE_STATIC_BUF
- buf = bcm_wlan_prealloc(section, ring_sz);
+ buf = DHD_OS_PREALLOC(dhdp, section, ring_sz);
#else
buf = MALLOCZ(dhdp->osh, ring_sz);
#endif
pkt_count = MIN(req_count, tx_report->status_pos);
#ifdef CONFIG_COMPAT
- if (is_compat_task()) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
+ if (in_compat_syscall())
+#else
+ if (is_compat_task())
+#endif
+ {
cptr = (compat_wifi_tx_report_t *)user_buf;
while ((count < pkt_count) && tx_pkt && cptr) {
compat_wifi_tx_report_t *comp_ptr = compat_ptr((uintptr_t) cptr);
pkt_count = MIN(req_count, rx_report->pkt_pos);
#ifdef CONFIG_COMPAT
- if (is_compat_task()) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
+ if (in_compat_syscall())
+#else
+ if (is_compat_task())
+#endif
+ {
cptr = (compat_wifi_rx_report_t *)user_buf;
while ((count < pkt_count) && rx_pkt && cptr) {
compat_wifi_rx_report_t *comp_ptr = compat_ptr((uintptr_t) cptr);
#include <linux/mmc/sdio_func.h>
#endif /* defined(BUS_POWER_RESTORE) && defined(BCMSDIO) */
+
+static int gpio_wl_reg_on = -1; // WL_REG_ON is input pin of WLAN module
+#ifdef CUSTOMER_OOB
+static int gpio_wl_host_wake = -1; // WL_HOST_WAKE is output pin of WLAN module
+#endif
+
#ifdef CUSTOMER_HW_AMLOGIC
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
#include <linux/amlogic/aml_gpio_consumer.h>
#endif
#endif
-
-static int gpio_wl_reg_on = -1; // WL_REG_ON is input pin of WLAN module
-#ifdef CUSTOMER_OOB
-static int gpio_wl_host_wake = -1; // WL_HOST_WAKE is output pin of WLAN module
-#endif
-
static int
dhd_wlan_set_power(int on
#ifdef BUS_POWER_RESTORE
}
#endif
-//#if !defined(WL_WIRELESS_EXT)
-//struct cntry_locales_custom {
-// char iso_abbrev[WLC_CNTRY_BUF_SZ]; /* ISO 3166-1 country abbreviation */
-// char custom_locale[WLC_CNTRY_BUF_SZ]; /* Custom firmware locale */
-// int32 custom_locale_rev; /* Custom local revisin default -1 */
-//};
-//#endif
-
static struct cntry_locales_custom brcm_wlan_translate_custom_table[] = {
/* Table should be filled out based on custom platform regulatory requirement */
{"", "XT", 49}, /* Universal if Country code is unknown or empty */
}
#endif /* NDO_CONFIG_SUPPORT */
#ifndef APF
- if (FW_SUPPORTED(dhd, ndoe)) {
+ if (FW_SUPPORTED(dhd, ndoe))
#else
- if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf)) {
+ if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf))
#endif /* APF */
+ {
/* enable IPv6 RA filter in firmware during suspend */
nd_ra_filter = 1;
ret = dhd_iovar(dhd, 0, "nd_ra_filter_enable",
#endif /* PASS_ALL_MCAST_PKTS */
#if defined(BCMPCIE)
/* restore pre-suspend setting */
- dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim,
+ ret = dhd_iovar(dhd, 0, "bcn_li_dtim", (char *)&bcn_li_dtim,
sizeof(bcn_li_dtim), NULL, 0, TRUE);
+ if (ret < 0) {
+ DHD_ERROR(("%s:bcn_li_ditm fail:%d\n", __FUNCTION__, ret));
+ }
dhd_iovar(dhd, 0, "lpas", (char *)&lpas, sizeof(lpas), NULL, 0,
TRUE);
}
#endif /* NDO_CONFIG_SUPPORT */
#ifndef APF
- if (FW_SUPPORTED(dhd, ndoe)) {
+ if (FW_SUPPORTED(dhd, ndoe))
#else
- if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf)) {
+ if (FW_SUPPORTED(dhd, ndoe) && !FW_SUPPORTED(dhd, apf))
#endif /* APF */
+ {
/* disable IPv6 RA filter in firmware during suspend */
nd_ra_filter = 0;
ret = dhd_iovar(dhd, 0, "nd_ra_filter_enable",
__FUNCTION__, dhd->pub.up, dhd->pub.busstate));
netif_stop_queue(net);
/* Send Event when bus down detected during data session */
- if (dhd->pub.up && !dhd->pub.hang_was_sent) {
+ if (dhd->pub.up && !dhd->pub.hang_was_sent && !DHD_BUS_CHECK_REMOVE(&dhd->pub)) {
DHD_ERROR(("%s: Event HANG sent up\n", __FUNCTION__));
dhd->pub.hang_reason = HANG_REASON_BUS_DOWN;
net_os_send_hang_message(net);
ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]);
ifp = dhd->iflist[ifidx];
#ifndef PROP_TXSTATUS_VSDB
- if (!(ifp && ifp->net && (ifp->net->reg_state == NETREG_REGISTERED))) {
+ if (!(ifp && ifp->net && (ifp->net->reg_state == NETREG_REGISTERED)))
#else
if (!(ifp && ifp->net && (ifp->net->reg_state == NETREG_REGISTERED) &&
- dhd->pub.up)) {
+ dhd->pub.up))
#endif /* PROP_TXSTATUS_VSDB */
+ {
DHD_ERROR(("%s: net device is NOT registered. drop event packet\n",
__FUNCTION__));
#ifdef DHD_USE_STATIC_CTRLBUF
DHD_ERROR(("%s: WLAN driver is not initialized\n", __FUNCTION__));
return -1;
}
- /* Init wakelock */
+ }
+
+ 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) {
+ DHD_ERROR(("%s : dhd_open: call dev open before insmod complete!\n", __FUNCTION__));
+ }
+ mutex_lock(&_dhd_sdio_mutex_lock_);
+#endif
+#endif /* MULTIPLE_SUPPLICANT */
+ /* Init wakelock */
+ if (!dhd_download_fw_on_driverload) {
if (!(dhd->dhd_state & DHD_ATTACH_STATE_WAKELOCKS_INIT)) {
DHD_OS_WAKE_LOCK_INIT(dhd);
dhd->dhd_state |= DHD_ATTACH_STATE_WAKELOCKS_INIT;
}
-
#ifdef SHOW_LOGTRACE
skb_queue_head_init(&dhd->evt_trace_queue);
}
}
#endif /* SHOW_LOGTRACE */
- 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) {
- DHD_ERROR(("%s : dhd_open: call dev open before insmod complete!\n", __FUNCTION__));
- }
- mutex_lock(&_dhd_sdio_mutex_lock_);
-#endif
-#endif /* MULTIPLE_SUPPLICANT */
}
#if defined(PREVENT_REOPEN_DURING_HANG)
dhd_state |= DHD_ATTACH_STATE_WL_ATTACH;
}
#ifdef WL_ESCAN
- wl_escan_attach(net, (void *)&dhd->pub);
+ wl_escan_attach(net, &dhd->pub);
#endif /* WL_ESCAN */
#endif /* defined(WL_WIRELESS_EXT) */
wl_iw_detach();
}
#ifdef WL_ESCAN
- wl_escan_detach();
+ wl_escan_detach(dhdp);
#endif /* WL_ESCAN */
#endif /* defined(WL_WIRELESS_EXT) */
wake_up(&dhd->d3ack_wait);
return 0;
}
+
int
dhd_os_busbusy_wait_negation(dhd_pub_t *pub, uint *condition)
{
goto err;
}
+ DHD_ERROR(("%s: %s (%d bytes) open success\n", __FUNCTION__, filename, size));
+
err:
return fp;
}
return ret;
}
+
#ifdef CUSTOM_FORCE_NODFS_FLAG
int
dhd_dev_set_nodfs(struct net_device *dev, u32 nodfs)
return (dhd_pno_stop_for_ssid(&dhd->pub));
}
+
/* Linux wrapper to call common dhd_pno_set_for_ssid */
int
dhd_dev_pno_set_for_ssid(struct net_device *dev, wlc_ssid_ext_t* ssids_local, int nssid,
dhd_info_t *dhd = DHD_DEV_INFO(dev);
return (dhd_pno_stop_for_batch(&dhd->pub));
}
+
/* Linux wrapper to call common dhd_dev_pno_set_for_batch */
int
dhd_dev_pno_set_for_batch(struct net_device *dev, struct dhd_pno_batch_params *batch_params)
dhd_info_t *dhd = DHD_DEV_INFO(dev);
return (dhd_pno_set_for_batch(&dhd->pub, batch_params));
}
+
/* Linux wrapper to call common dhd_dev_pno_get_for_batch */
int
dhd_dev_pno_get_for_batch(struct net_device *dev, char *buf, int bufsize)
return (dhd_retreive_batch_scan_results(&dhd->pub));
}
+
/* Linux wrapper to call common dhd_pno_process_epno_result */
void * dhd_dev_process_epno_result(struct net_device *dev,
const void *data, uint32 event, int *send_evt_bytes)
}
return err;
}
+
int
dhd_dev_set_lazy_roam_bssid_pref(struct net_device *dev,
wl_bssid_pref_cfg_t *bssid_pref, uint32 flush)
}
return err;
}
+
int
dhd_dev_set_blacklist_bssid(struct net_device *dev, maclist_t *blacklist,
uint32 len, uint32 flush)
}
return err;
}
+
int
dhd_dev_set_whitelist_ssid(struct net_device *dev, wl_ssid_whitelist_t *ssid_whitelist,
uint32 len, uint32 flush)
return err;
}
#endif /* GSCAN_SUPPORT */
+
#if defined(GSCAN_SUPPORT) || defined(DHD_GET_VALID_CHANNELS)
/* Linux wrapper to call common dhd_pno_get_gscan */
void *
#elif (defined(BOARD_PANDA) || defined(__ARM_ARCH_7A__))
#define MEMDUMPINFO "/data/misc/wifi/.memdump.info"
#else
-#if defined(CONFIG_X86)
-#define MEMDUMPINFO MEMDUMPINFO_LIVE
-#endif
+#define MEMDUMPINFO "/data/misc/wifi/.memdump.info"
#endif /* CUSTOMER_HW4_DEBUG */
void dhd_get_memdump_info(dhd_pub_t *dhd)
{
+ struct file *fp = NULL;
uint32 mem_val = DUMP_MEMFILE_MAX;
-#if defined(CONFIG_X86)
int ret = 0;
- struct file *fp = NULL;
char *filepath = MEMDUMPINFO;
+
/* Read memdump info from the file */
fp = filp_open(filepath, O_RDONLY, 0);
-
if (IS_ERR(fp)) {
DHD_ERROR(("%s: File [%s] doesn't exist\n", __FUNCTION__, filepath));
+#if defined(CONFIG_X86)
/* Check if it is Live Brix Image */
if (strcmp(filepath, MEMDUMPINFO_LIVE) != 0) {
goto done;
#else /* Non Brix Android platform */
goto done;
#endif /* CONFIG_X86 && OEM_ANDROID */
-#if defined(CONFIG_X86)
}
/* Handle success case */
mem_val = bcm_atoi((char *)&mem_val);
filp_close(fp, NULL);
-#endif
+
#ifdef DHD_INIT_DEFAULT_MEMDUMP
if (mem_val == 0 || mem_val == DUMP_MEMFILE_MAX)
mem_val = DUMP_MEMFILE_BUGON;
#ifdef CUSTOMER_HW4_DEBUG
dhd->memdump_enabled = (mem_val < DUMP_MEMFILE_MAX) ? mem_val : DUMP_DISABLED;
#else
- dhd->memdump_enabled = (mem_val < DUMP_MEMFILE_MAX) ? mem_val : DUMP_MEMFILE_BUGON;
+ dhd->memdump_enabled = (mem_val < DUMP_MEMFILE_MAX) ? mem_val : DUMP_MEMFILE;
#endif /* CUSTOMER_HW4_DEBUG */
DHD_ERROR(("%s: MEMDUMP ENABLED = %d\n", __FUNCTION__, dhd->memdump_enabled));
dhd_deferred_schedule_work(dhdp->info->dhd_deferred_wq, (void *)dump,
DHD_WQ_WORK_SOC_RAM_DUMP, dhd_mem_dump, DHD_WQ_WORK_PRIORITY_HIGH);
}
+
static void
dhd_mem_dump(void *handle, void *event_info, u8 event)
{
/* Scratch buffer for dma rx offset */
#ifdef BCM_HOST_BUF
if (dhd_dma_buf_alloc(dhd, &prot->d2h_dma_scratch_buf,
- ROUNDUP(DMA_D2H_SCRATCH_BUF_LEN, 16) + DMA_HOST_BUFFER_LEN)) {
+ ROUNDUP(DMA_D2H_SCRATCH_BUF_LEN, 16) + DMA_HOST_BUFFER_LEN))
#else
- if (dhd_dma_buf_alloc(dhd, &prot->d2h_dma_scratch_buf, DMA_D2H_SCRATCH_BUF_LEN)) {
-
+ if (dhd_dma_buf_alloc(dhd, &prot->d2h_dma_scratch_buf, DMA_D2H_SCRATCH_BUF_LEN))
#endif /* BCM_HOST_BUF */
+ {
goto fail;
}
PCIECFGREG_PHY_DBG_CLKREQ3,
dhd_pcie_corereg_read(dhd->bus->sih, PCIECFGREG_PHY_DBG_CLKREQ3)));
+#if defined(PCIE_RC_VENDOR_ID) && defined(PCIE_RC_DEVICE_ID)
DHD_ERROR(("Pcie RC Error Status Val=0x%x\n",
dhdpcie_rc_access_cap(dhd->bus, PCIE_EXTCAP_ID_ERR,
PCIE_EXTCAP_AER_UCERR_OFFSET, TRUE, FALSE, 0)));
DHD_ERROR(("RootPort PCIe linkcap=0x%08x\n",
dhd_debug_get_rc_linkcap(dhd->bus)));
+#endif
DHD_ERROR(("\n ------- DUMPING INTR enable/disable counters ------- \r\n"));
DHD_ERROR(("resume_intr_enable_count=%lu dpc_intr_enable_count=%lu\n"
return;
}
+static void
+dhdpcie_advertise_bus_remove(dhd_pub_t *dhdp)
+{
+ unsigned long flags;
+ int timeleft;
+
+ DHD_GENERAL_LOCK(dhdp, flags);
+ dhdp->busstate = DHD_BUS_REMOVE;
+ DHD_GENERAL_UNLOCK(dhdp, flags);
+
+ timeleft = dhd_os_busbusy_wait_negation(dhdp, &dhdp->dhd_bus_busy_state);
+ if ((timeleft == 0) || (timeleft == 1)) {
+ DHD_ERROR(("%s : Timeout due to dhd_bus_busy_state=0x%x\n",
+ __FUNCTION__, dhdp->dhd_bus_busy_state));
+ ASSERT(0);
+ }
+
+ return;
+}
+
+
static void
dhdpcie_bus_remove_prep(dhd_bus_t *bus)
{
ASSERT(osh);
if (bus->dhd) {
- dhdpcie_advertise_bus_cleanup(bus->dhd);
+ dhdpcie_advertise_bus_remove(bus->dhd);
dongle_isolation = bus->dhd->dongle_isolation;
bus->dhd->is_pcie_watchdog_reset = FALSE;
dhdpcie_bus_remove_prep(bus);
err:
if (memblock) {
MFREE(bus->dhd->osh, memblock, MEMBLOCK + DHD_SDALIGN);
- if (dhd_msg_level & DHD_TRACE_VAL) {
- if (memptr_tmp)
- MFREE(bus->dhd->osh, memptr_tmp, MEMBLOCK + DHD_SDALIGN);
+ if (dhd_msg_level & DHD_TRACE_VAL) {
+ if (memptr_tmp)
+ MFREE(bus->dhd->osh, memptr_tmp, MEMBLOCK + DHD_SDALIGN);
+ }
}
if (imgbuf) {
return bcmerror;
}
+
static int
dhdpcie_bus_doiovar(dhd_bus_t *bus, const bcm_iovar_t *vi, uint32 actionid, const char *name,
void *params, int plen, void *arg, int len, int val_size)
#elif defined(CONFIG_ARCH_TEGRA)
#define PCIE_RC_VENDOR_ID TEGRA_PCIE_VENDOR_ID
#define PCIE_RC_DEVICE_ID TEGRA_PCIE_DEVICE_ID
-#else
-#error "Not supported platform"
#endif /* CONFIG_ARCH_EXYNOS */
#ifdef USE_EXYNOS_PCIE_RC_PMPATCH
return bcmerror;
}
+#if defined(PCIE_RC_VENDOR_ID) && defined(PCIE_RC_DEVICE_ID)
uint32
dhdpcie_rc_config_read(dhd_bus_t *bus, uint offset)
{
linkcap &= PCIE_CAP_LINKCAP_LNKSPEED_MASK;
return linkcap;
}
+#endif
int dhdpcie_pci_suspend_resume(dhd_bus_t *bus, bool state)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
#if defined(DHD_HANG_SEND_UP_TEST)
if (bus->is_linkdown ||
- bus->dhd->req_hang_type == HANG_REASON_PCIE_RC_LINK_UP_FAIL) {
+ bus->dhd->req_hang_type == HANG_REASON_PCIE_RC_LINK_UP_FAIL)
#else /* DHD_HANG_SEND_UP_TEST */
- if (bus->is_linkdown) {
+ if (bus->is_linkdown)
#endif /* DHD_HANG_SEND_UP_TEST */
+ {
bus->dhd->hang_reason = HANG_REASON_PCIE_RC_LINK_UP_FAIL;
dhd_os_send_hang_message(bus->dhd);
}
bus->is_linkdown = 0;
/* Get RC Device Handle */
+#if defined(PCIE_RC_VENDOR_ID) && defined(PCIE_RC_DEVICE_ID)
bus->rc_dev = pci_get_device(PCIE_RC_VENDOR_ID, PCIE_RC_DEVICE_ID, NULL);
+#else
+ bus->rc_dev = NULL;
+#endif
#if defined(BCMPCIE_OOB_HOST_WAKE) && defined(CUSTOMER_HW2) && \
defined(CONFIG_ARCH_APQ8084)
#define FTM_DEFAULT_CNT_40M 10
#define FTM_DEFAULT_CNT_80M 5
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
-#define ieee80211_band nl80211_band
-#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
-#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ
-#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
-#endif
-
/* convenience macros */
#define FTM_TU2MICRO(_tu) ((uint64)(_tu) << 10)
#define FTM_MICRO2TU(_tu) ((uint64)(_tu) >> 10)
static int dhdsdio_set_sdmode(dhd_bus_t *bus, int32 sd_mode);
static int dhdsdio_sdclk(dhd_bus_t *bus, bool on);
static void dhdsdio_advertise_bus_cleanup(dhd_pub_t *dhdp);
+static void dhdsdio_advertise_bus_remove(dhd_pub_t *dhdp);
#ifdef SUPPORT_MULTIPLE_BOARD_REV_FROM_DT
int dhd_get_system_rev(void);
#endif /* SUPPORT_MULTIPLE_BOARD_REV_FROM_DT */
uint8 doff = 0;
int ret = -1;
uint8 sdpcm_hdrlen = bus->txglom_enable ? SDPCM_HDRLEN_TXGLOM : SDPCM_HDRLEN;
+ int cnt = 0;
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
/* Need to lock here to protect txseq and SDIO tx calls */
+retry:
dhd_os_sdlock(bus->dhd);
+ if (cnt < bus->dhd->conf->txctl_tmo_fix && !TXCTLOK(bus)) {
+ cnt++;
+ dhd_os_sdunlock(bus->dhd);
+ OSL_SLEEP(1);
+ if (cnt >= (bus->dhd->conf->txctl_tmo_fix))
+ DHD_ERROR(("%s: No bus credit bus->tx_max %d, bus->tx_seq %d, last retry cnt %d\n",
+ __FUNCTION__, bus->tx_max, bus->tx_seq, cnt));
+ goto retry;
+ }
BUS_WAKE(bus);
}
/* Resched the DPC if ctrl cmd is pending on bus credit */
if (bus->ctrl_frame_stat) {
- if (bus->dhd->conf->txctl_tmo_fix) {
+ if (bus->dhd->conf->txctl_tmo_fix > 0) {
set_current_state(TASK_INTERRUPTIBLE);
if (!kthread_should_stop())
schedule_timeout(1);
if (bus) {
ASSERT(bus->dhd);
- /* Advertise bus cleanup during rmmod */
- dhdsdio_advertise_bus_cleanup(bus->dhd);
+ /* Advertise bus remove during rmmod */
+ dhdsdio_advertise_bus_remove(bus->dhd);
dhdsdio_release(bus, bus->dhd->osh);
}
return;
}
+static void
+dhdsdio_advertise_bus_remove(dhd_pub_t *dhdp)
+{
+ unsigned long flags;
+ int timeleft;
+
+ DHD_LINUX_GENERAL_LOCK(dhdp, flags);
+ dhdp->busstate = DHD_BUS_REMOVE;
+ DHD_LINUX_GENERAL_UNLOCK(dhdp, flags);
+
+ timeleft = dhd_os_busbusy_wait_negation(dhdp, &dhdp->dhd_bus_busy_state);
+ if ((timeleft == 0) || (timeleft == 1)) {
+ DHD_ERROR(("%s : Timeout due to dhd_bus_busy_state=0x%x\n",
+ __FUNCTION__, dhdp->dhd_bus_busy_state));
+ ASSERT(0);
+ }
+
+ return;
+}
+
+
int
dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
{
#include <linux/delay.h>\r
#include <linux/err.h>\r
#include <linux/skbuff.h>\r
+#include <linux/wlan_plat.h>\r
#include <linux/amlogic/dhd_buf.h>\r
\r
+#define DHD_STATIC_VERSION_STR "1.579.77.41.1"\r
+\r
+#define BCMDHD_SDIO\r
+#define BCMDHD_PCIE\r
+\r
enum dhd_prealloc_index {\r
DHD_PREALLOC_PROT = 0,\r
- DHD_PREALLOC_RXBUF,\r
- DHD_PREALLOC_DATABUF,\r
- DHD_PREALLOC_OSL_BUF,\r
- DHD_PREALLOC_SKB_BUF,\r
+#if defined(BCMDHD_SDIO)\r
+ DHD_PREALLOC_RXBUF = 1,\r
+ DHD_PREALLOC_DATABUF = 2,\r
+#endif\r
+ DHD_PREALLOC_OSL_BUF = 3,\r
+ DHD_PREALLOC_SKB_BUF = 4,\r
DHD_PREALLOC_WIPHY_ESCAN0 = 5,\r
DHD_PREALLOC_WIPHY_ESCAN1 = 6,\r
DHD_PREALLOC_DHD_INFO = 7,\r
DHD_PREALLOC_DHD_WLFC_INFO = 8,\r
+#ifdef BCMDHD_PCIE\r
DHD_PREALLOC_IF_FLOW_LKUP = 9,\r
+#endif\r
DHD_PREALLOC_MEMDUMP_BUF = 10,\r
DHD_PREALLOC_MEMDUMP_RAM = 11,\r
DHD_PREALLOC_DHD_WLFC_HANGER = 12,\r
+ DHD_PREALLOC_PKTID_MAP = 13,\r
+ DHD_PREALLOC_PKTID_MAP_IOCTL = 14,\r
+ DHD_PREALLOC_DHD_LOG_DUMP_BUF = 15,\r
+ DHD_PREALLOC_DHD_LOG_DUMP_BUF_EX = 16,\r
+ DHD_PREALLOC_DHD_PKTLOG_DUMP_BUF = 17,\r
+ DHD_PREALLOC_STAT_REPORT_BUF = 18,\r
+ DHD_PREALLOC_WL_ESCAN_INFO = 19,\r
+ DHD_PREALLOC_FW_VERBOSE_RING = 20,\r
+ DHD_PREALLOC_FW_EVENT_RING = 21,\r
+ DHD_PREALLOC_DHD_EVENT_RING = 22,\r
+ DHD_PREALLOC_NAN_EVENT_RING = 23,\r
DHD_PREALLOC_MAX\r
};\r
\r
#define STATIC_BUF_MAX_NUM 20\r
#define STATIC_BUF_SIZE (PAGE_SIZE*2)\r
\r
-#define DHD_PREALLOC_PROT_SIZE (16 * 1024)\r
-#define DHD_PREALLOC_RXBUF_SIZE (24 * 1024)\r
-#define DHD_PREALLOC_DATABUF_SIZE (64 * 1024)\r
-#define DHD_PREALLOC_OSL_BUF_SIZE (STATIC_BUF_MAX_NUM * STATIC_BUF_SIZE)\r
+#define DHD_PREALLOC_PROT_SIZE (16 * 1024)\r
+#define DHD_PREALLOC_RXBUF_SIZE (24 * 1024)\r
+#define DHD_PREALLOC_DATABUF_SIZE (64 * 1024)\r
+#define DHD_PREALLOC_OSL_BUF_SIZE (STATIC_BUF_MAX_NUM * STATIC_BUF_SIZE)\r
#define DHD_PREALLOC_WIPHY_ESCAN0_SIZE (64 * 1024)\r
-#define DHD_PREALLOC_DHD_INFO_SIZE (24 * 1024)\r
-#define DHD_PREALLOC_DHD_WLFC_HANGER_SIZE (64 * 1024)\r
+#define DHD_PREALLOC_DHD_INFO_SIZE (30 * 1024)\r
+#define DHD_PREALLOC_MEMDUMP_RAM_SIZE (770 * 1024)\r
+#define DHD_PREALLOC_DHD_WLFC_HANGER_SIZE (73 * 1024)\r
+#define DHD_PREALLOC_WL_ESCAN_INFO_SIZE (66 * 1024)\r
#ifdef CONFIG_64BIT\r
#define DHD_PREALLOC_IF_FLOW_LKUP_SIZE (20 * 1024 * 2)\r
#else\r
#define DHD_PREALLOC_IF_FLOW_LKUP_SIZE (20 * 1024)\r
#endif\r
+#define FW_VERBOSE_RING_SIZE (64 * 1024)\r
+#define FW_EVENT_RING_SIZE (64 * 1024)\r
+#define DHD_EVENT_RING_SIZE (64 * 1024)\r
+#define NAN_EVENT_RING_SIZE (64 * 1024)\r
\r
#if defined(CONFIG_64BIT)\r
-#define WLAN_DHD_INFO_BUF_SIZE (24 * 1024)\r
-#define WLAN_DHD_WLFC_BUF_SIZE (64 * 1024)\r
+#define WLAN_DHD_INFO_BUF_SIZE (24 * 1024)\r
+#define WLAN_DHD_WLFC_BUF_SIZE (64 * 1024)\r
#define WLAN_DHD_IF_FLOW_LKUP_SIZE (64 * 1024)\r
#else\r
-#define WLAN_DHD_INFO_BUF_SIZE (16 * 1024)\r
-#define WLAN_DHD_WLFC_BUF_SIZE (24 * 1024)\r
+#define WLAN_DHD_INFO_BUF_SIZE (16 * 1024)\r
+#define WLAN_DHD_WLFC_BUF_SIZE (24 * 1024)\r
#define WLAN_DHD_IF_FLOW_LKUP_SIZE (20 * 1024)\r
#endif /* CONFIG_64BIT */\r
-#define WLAN_DHD_MEMDUMP_SIZE (800 * 1024)\r
+#define WLAN_DHD_MEMDUMP_SIZE (800 * 1024)\r
\r
-#ifdef CONFIG_BCMDHD_PCIE\r
#define DHD_SKB_1PAGE_BUFSIZE (PAGE_SIZE*1)\r
#define DHD_SKB_2PAGE_BUFSIZE (PAGE_SIZE*2)\r
#define DHD_SKB_4PAGE_BUFSIZE (PAGE_SIZE*4)\r
\r
-#define DHD_SKB_1PAGE_BUF_NUM 0\r
-#define DHD_SKB_2PAGE_BUF_NUM 64\r
-#define DHD_SKB_4PAGE_BUF_NUM 0\r
-#else\r
-#define DHD_SKB_HDRSIZE 336\r
-#define DHD_SKB_1PAGE_BUFSIZE ((PAGE_SIZE*1)-DHD_SKB_HDRSIZE)\r
-#define DHD_SKB_2PAGE_BUFSIZE ((PAGE_SIZE*2)-DHD_SKB_HDRSIZE)\r
-#define DHD_SKB_4PAGE_BUFSIZE ((PAGE_SIZE*4)-DHD_SKB_HDRSIZE)\r
-\r
#define DHD_SKB_1PAGE_BUF_NUM 8\r
+#ifdef BCMDHD_PCIE\r
+#define DHD_SKB_2PAGE_BUF_NUM 64\r
+#elif defined(BCMDHD_SDIO)\r
#define DHD_SKB_2PAGE_BUF_NUM 8\r
+#endif\r
#define DHD_SKB_4PAGE_BUF_NUM 1\r
-#endif /* CONFIG_BCMDHD_PCIE */\r
\r
/* The number is defined in linux_osl.c\r
* WLAN_SKB_1_2PAGE_BUF_NUM => STATIC_PKT_1_2PAGE_NUM\r
(DHD_SKB_2PAGE_BUF_NUM))\r
#define WLAN_SKB_BUF_NUM ((WLAN_SKB_1_2PAGE_BUF_NUM) + (DHD_SKB_4PAGE_BUF_NUM))\r
\r
-void *wlan_static_prot = NULL;\r
-void *wlan_static_rxbuf = NULL;\r
-void *wlan_static_databuf = NULL;\r
-void *wlan_static_osl_buf = NULL;\r
-void *wlan_static_scan_buf0 = NULL;\r
-void *wlan_static_scan_buf1 = NULL;\r
-void *wlan_static_dhd_info_buf = NULL;\r
-void *wlan_static_dhd_wlfc_info_buf = NULL;\r
-void *wlan_static_if_flow_lkup = NULL;\r
-void *wlan_static_dhd_wlfc_hanger_buf = NULL;\r
+void *wlan_static_prot;\r
+void *wlan_static_rxbuf;\r
+void *wlan_static_databuf;\r
+void *wlan_static_osl_buf;\r
+void *wlan_static_scan_buf0;\r
+void *wlan_static_scan_buf1;\r
+void *wlan_static_dhd_info_buf;\r
+void *wlan_static_dhd_wlfc_info_buf;\r
+void *wlan_static_if_flow_lkup;\r
+void *wlan_static_dhd_memdump_ram_buf;\r
+void *wlan_static_dhd_wlfc_hanger_buf;\r
+void *wlan_static_wl_escan_info_buf;\r
+void *wlan_static_fw_verbose_ring_buf;\r
+void *wlan_static_fw_event_ring_buf;\r
+void *wlan_static_dhd_event_ring_buf;\r
+void *wlan_static_nan_event_ring_buf;\r
\r
static struct sk_buff *wlan_static_skb[WLAN_SKB_BUF_NUM];\r
\r
-void *dhd_wlan_mem_prealloc(int section, unsigned long size)\r
+void *bcmdhd_mem_prealloc(int section, unsigned long size)\r
{\r
- printk("%s: sectoin %d, %ld\n", __FUNCTION__, section, size);\r
+ pr_err("%s: sectoin %d, %ld\n", __func__, section, size);\r
if (section == DHD_PREALLOC_PROT)\r
return wlan_static_prot;\r
\r
+#if defined(BCMDHD_SDIO)\r
if (section == DHD_PREALLOC_RXBUF)\r
return wlan_static_rxbuf;\r
\r
if (section == DHD_PREALLOC_DATABUF)\r
return wlan_static_databuf;\r
+#endif /* BCMDHD_SDIO */\r
\r
if (section == DHD_PREALLOC_SKB_BUF)\r
return wlan_static_skb;\r
\r
if (section == DHD_PREALLOC_OSL_BUF) {\r
if (size > DHD_PREALLOC_OSL_BUF_SIZE) {\r
- pr_err("request OSL_BUF(%lu) is bigger than static size(%ld).\n",\r
+ pr_err("request OSL_BUF(%lu) > %ld\n",\r
size, DHD_PREALLOC_OSL_BUF_SIZE);\r
return NULL;\r
}\r
\r
if (section == DHD_PREALLOC_DHD_INFO) {\r
if (size > DHD_PREALLOC_DHD_INFO_SIZE) {\r
- pr_err("request DHD_INFO size(%lu) is bigger than static size(%d).\n",\r
+ pr_err("request DHD_INFO size(%lu) > %d\n",\r
size, DHD_PREALLOC_DHD_INFO_SIZE);\r
return NULL;\r
}\r
}\r
if (section == DHD_PREALLOC_DHD_WLFC_INFO) {\r
if (size > WLAN_DHD_WLFC_BUF_SIZE) {\r
- pr_err("request DHD_WLFC_INFO size(%lu) is bigger than static size(%d).\n",\r
+ pr_err("request DHD_WLFC_INFO size(%lu) > %d\n",\r
size, WLAN_DHD_WLFC_BUF_SIZE);\r
return NULL;\r
}\r
return wlan_static_dhd_wlfc_info_buf;\r
}\r
+#ifdef BCMDHD_PCIE\r
if (section == DHD_PREALLOC_IF_FLOW_LKUP) {\r
if (size > DHD_PREALLOC_IF_FLOW_LKUP_SIZE) {\r
- pr_err("request DHD_IF_FLOW_LKUP size(%lu) is bigger than static size(%d).\n",\r
+ pr_err("request DHD_IF_FLOW_LKUP size(%lu) > %d\n",\r
size, DHD_PREALLOC_IF_FLOW_LKUP_SIZE);\r
return NULL;\r
}\r
\r
return wlan_static_if_flow_lkup;\r
}\r
+#endif /* BCMDHD_PCIE */\r
+ if (section == DHD_PREALLOC_MEMDUMP_RAM) {\r
+ if (size > DHD_PREALLOC_MEMDUMP_RAM_SIZE) {\r
+ pr_err("request DHD_PREALLOC_MEMDUMP_RAM_SIZE(%lu) > %d\n",\r
+ size, DHD_PREALLOC_MEMDUMP_RAM_SIZE);\r
+ return NULL;\r
+ }\r
+\r
+ return wlan_static_dhd_memdump_ram_buf;\r
+ }\r
if (section == DHD_PREALLOC_DHD_WLFC_HANGER) {\r
if (size > DHD_PREALLOC_DHD_WLFC_HANGER_SIZE) {\r
- pr_err("request DHD_WLFC_HANGER size(%lu) is bigger than static size(%d).\n",\r
+ pr_err("request DHD_WLFC_HANGER size(%lu) > %d\n",\r
size, DHD_PREALLOC_DHD_WLFC_HANGER_SIZE);\r
return NULL;\r
}\r
return wlan_static_dhd_wlfc_hanger_buf;\r
}\r
+ if (section == DHD_PREALLOC_WL_ESCAN_INFO) {\r
+ if (size > DHD_PREALLOC_WL_ESCAN_INFO_SIZE) {\r
+ pr_err("request DHD_PREALLOC_WL_ESCAN_INFO_SIZE(%lu) > %d\n",\r
+ size, DHD_PREALLOC_WL_ESCAN_INFO_SIZE);\r
+ return NULL;\r
+ }\r
+\r
+ return wlan_static_wl_escan_info_buf;\r
+ }\r
+ if (section == DHD_PREALLOC_FW_VERBOSE_RING) {\r
+ if (size > FW_VERBOSE_RING_SIZE) {\r
+ pr_err("request DHD_PREALLOC_FW_VERBOSE_RING(%lu) > %d\n",\r
+ size, FW_VERBOSE_RING_SIZE);\r
+ return NULL;\r
+ }\r
+\r
+ return wlan_static_fw_verbose_ring_buf;\r
+ }\r
+ if (section == DHD_PREALLOC_FW_EVENT_RING) {\r
+ if (size > FW_EVENT_RING_SIZE) {\r
+ pr_err("request DHD_PREALLOC_FW_EVENT_RING(%lu) > %d\n",\r
+ size, FW_EVENT_RING_SIZE);\r
+ return NULL;\r
+ }\r
+\r
+ return wlan_static_fw_event_ring_buf;\r
+ }\r
+ if (section == DHD_PREALLOC_DHD_EVENT_RING) {\r
+ if (size > DHD_EVENT_RING_SIZE) {\r
+ pr_err("request DHD_PREALLOC_DHD_EVENT_RING(%lu) > %d\n",\r
+ size, DHD_EVENT_RING_SIZE);\r
+ return NULL;\r
+ }\r
+\r
+ return wlan_static_dhd_event_ring_buf;\r
+ }\r
+ if (section == DHD_PREALLOC_NAN_EVENT_RING) {\r
+ if (size > NAN_EVENT_RING_SIZE) {\r
+ pr_err("request DHD_PREALLOC_NAN_EVENT_RING(%lu) > %d\n",\r
+ size, NAN_EVENT_RING_SIZE);\r
+ return NULL;\r
+ }\r
+\r
+ return wlan_static_nan_event_ring_buf;\r
+ }\r
if ((section < 0) || (section > DHD_PREALLOC_MAX))\r
pr_err("request section id(%d) is out of max index %d\n",\r
section, DHD_PREALLOC_MAX);\r
\r
- pr_err("%s: failed to alloc section %d, size=%ld\n", __FUNCTION__, section, size);\r
+ pr_err("%s: failed to alloc section %d, size=%ld\n",\r
+ __func__, section, size);\r
\r
return NULL;\r
}\r
-EXPORT_SYMBOL(dhd_wlan_mem_prealloc);\r
+EXPORT_SYMBOL(bcmdhd_mem_prealloc);\r
\r
-static int dhd_init_wlan_mem(void)\r
+int bcmdhd_init_wlan_mem(void)\r
{\r
int i;\r
int j;\r
if (!wlan_static_skb[i]) {\r
goto err_skb_alloc;\r
}\r
- printk("%s: sectoin %d skb[%d], size=%ld\n", __FUNCTION__, DHD_PREALLOC_SKB_BUF, i, DHD_SKB_1PAGE_BUFSIZE);\r
+ pr_err("%s: sectoin %d skb[%d], size=%ld\n", __func__,\r
+ DHD_PREALLOC_SKB_BUF, i, DHD_SKB_1PAGE_BUFSIZE);\r
}\r
\r
for (i = DHD_SKB_1PAGE_BUF_NUM; i < WLAN_SKB_1_2PAGE_BUF_NUM; i++) {\r
if (!wlan_static_skb[i]) {\r
goto err_skb_alloc;\r
}\r
- printk("%s: sectoin %d skb[%d], size=%ld\n", __FUNCTION__, DHD_PREALLOC_SKB_BUF, i, DHD_SKB_2PAGE_BUFSIZE);\r
+ pr_err("%s: sectoin %d skb[%d], size=%ld\n", __func__,\r
+ DHD_PREALLOC_SKB_BUF, i, DHD_SKB_2PAGE_BUFSIZE);\r
}\r
\r
-#if !defined(CONFIG_BCMDHD_PCIE)\r
+#if defined(BCMDHD_SDIO)\r
wlan_static_skb[i] = dev_alloc_skb(DHD_SKB_4PAGE_BUFSIZE);\r
- if (!wlan_static_skb[i]) {\r
+ if (!wlan_static_skb[i])\r
goto err_skb_alloc;\r
- }\r
-#endif /* !CONFIG_BCMDHD_PCIE */\r
+ pr_err("%s: sectoin %d skb[%d], size=%ld\n", __func__,\r
+ DHD_PREALLOC_SKB_BUF, i, DHD_SKB_4PAGE_BUFSIZE);\r
+#endif /* BCMDHD_SDIO */\r
\r
wlan_static_prot = kmalloc(DHD_PREALLOC_PROT_SIZE, GFP_KERNEL);\r
- if (!wlan_static_prot) {\r
- pr_err("Failed to alloc wlan_static_prot\n");\r
+ if (!wlan_static_prot)\r
goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%d\n", __FUNCTION__, DHD_PREALLOC_PROT, DHD_PREALLOC_PROT_SIZE);\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_PROT, DHD_PREALLOC_PROT_SIZE);\r
\r
-#if defined(CONFIG_BCMDHD_SDIO)\r
+#if defined(BCMDHD_SDIO)\r
wlan_static_rxbuf = kmalloc(DHD_PREALLOC_RXBUF_SIZE, GFP_KERNEL);\r
- if (!wlan_static_rxbuf) {\r
- pr_err("Failed to alloc wlan_static_rxbuf\n");\r
+ if (!wlan_static_rxbuf)\r
goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%d\n", __FUNCTION__, DHD_PREALLOC_RXBUF, DHD_PREALLOC_RXBUF_SIZE);\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_RXBUF, DHD_PREALLOC_RXBUF_SIZE);\r
\r
wlan_static_databuf = kmalloc(DHD_PREALLOC_DATABUF_SIZE, GFP_KERNEL);\r
- if (!wlan_static_databuf) {\r
- pr_err("Failed to alloc wlan_static_databuf\n");\r
+ if (!wlan_static_databuf)\r
goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%d\n", __FUNCTION__, DHD_PREALLOC_DATABUF, DHD_PREALLOC_DATABUF_SIZE);\r
-#endif\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_DATABUF, DHD_PREALLOC_DATABUF_SIZE);\r
+#endif /* BCMDHD_SDIO */\r
\r
wlan_static_osl_buf = kmalloc(DHD_PREALLOC_OSL_BUF_SIZE, GFP_KERNEL);\r
- if (!wlan_static_osl_buf) {\r
- pr_err("Failed to alloc wlan_static_osl_buf\n");\r
+ if (!wlan_static_osl_buf)\r
goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%ld\n", __FUNCTION__, DHD_PREALLOC_OSL_BUF, DHD_PREALLOC_OSL_BUF_SIZE);\r
+ pr_err("%s: sectoin %d, size=%ld\n", __func__,\r
+ DHD_PREALLOC_OSL_BUF, DHD_PREALLOC_OSL_BUF_SIZE);\r
\r
wlan_static_scan_buf0 = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE, GFP_KERNEL);\r
- if (!wlan_static_scan_buf0) {\r
- pr_err("Failed to alloc wlan_static_scan_buf0\n");\r
+ if (!wlan_static_scan_buf0)\r
goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%d\n", __FUNCTION__, DHD_PREALLOC_WIPHY_ESCAN0, DHD_PREALLOC_WIPHY_ESCAN0_SIZE);\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_WIPHY_ESCAN0, DHD_PREALLOC_WIPHY_ESCAN0_SIZE);\r
\r
wlan_static_dhd_info_buf = kmalloc(DHD_PREALLOC_DHD_INFO_SIZE, GFP_KERNEL);\r
- if (!wlan_static_dhd_info_buf) {\r
- pr_err("Failed to alloc wlan_static_dhd_info_buf\n");\r
+ if (!wlan_static_dhd_info_buf)\r
goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%d\n", __FUNCTION__, DHD_PREALLOC_DHD_INFO, DHD_PREALLOC_DHD_INFO_SIZE);\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_DHD_INFO, DHD_PREALLOC_DHD_INFO_SIZE);\r
\r
wlan_static_dhd_wlfc_info_buf = kmalloc(WLAN_DHD_WLFC_BUF_SIZE, GFP_KERNEL);\r
- if (!wlan_static_dhd_wlfc_info_buf) {\r
- pr_err("Failed to alloc wlan_static_dhd_wlfc_info_buf\n");\r
- goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%d\n", __FUNCTION__, DHD_PREALLOC_DHD_WLFC_INFO, WLAN_DHD_WLFC_BUF_SIZE);\r
-\r
- wlan_static_dhd_wlfc_hanger_buf = kmalloc(DHD_PREALLOC_DHD_WLFC_HANGER_SIZE, GFP_KERNEL);\r
- if (!wlan_static_dhd_wlfc_hanger_buf) {\r
- pr_err("Failed to alloc wlan_static_dhd_wlfc_hanger_buf\n");\r
+ if (!wlan_static_dhd_wlfc_info_buf)\r
goto err_mem_alloc;\r
- }\r
- printk("%s: sectoin %d, size=%d\n", __FUNCTION__, DHD_PREALLOC_DHD_WLFC_HANGER, DHD_PREALLOC_DHD_WLFC_HANGER_SIZE);\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_DHD_WLFC_INFO, WLAN_DHD_WLFC_BUF_SIZE);\r
\r
-#ifdef CONFIG_BCMDHD_PCIE\r
+#ifdef BCMDHD_PCIE\r
wlan_static_if_flow_lkup = kmalloc(DHD_PREALLOC_IF_FLOW_LKUP_SIZE, GFP_KERNEL);\r
- if (!wlan_static_if_flow_lkup) {\r
- pr_err("Failed to alloc wlan_static_if_flow_lkup\n");\r
+ if (!wlan_static_if_flow_lkup)\r
goto err_mem_alloc;\r
- }\r
-#endif /* CONFIG_BCMDHD_PCIE */\r
-\r
- return 0;\r
-\r
-err_mem_alloc:\r
+#endif /* BCMDHD_PCIE */\r
\r
- if (wlan_static_prot)\r
- kfree(wlan_static_prot);\r
+ wlan_static_dhd_memdump_ram_buf = kmalloc(DHD_PREALLOC_MEMDUMP_RAM_SIZE, GFP_KERNEL);\r
+ if (!wlan_static_dhd_memdump_ram_buf) \r
+ goto err_mem_alloc;\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_MEMDUMP_RAM, DHD_PREALLOC_MEMDUMP_RAM_SIZE);\r
\r
-#if defined(CONFIG_BCMDHD_SDIO)\r
- if (wlan_static_rxbuf)\r
- kfree(wlan_static_rxbuf);\r
+ wlan_static_dhd_wlfc_hanger_buf = kmalloc(DHD_PREALLOC_DHD_WLFC_HANGER_SIZE, GFP_KERNEL);\r
+ if (!wlan_static_dhd_wlfc_hanger_buf)\r
+ goto err_mem_alloc;\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_DHD_WLFC_HANGER, DHD_PREALLOC_DHD_WLFC_HANGER_SIZE);\r
\r
- if (wlan_static_databuf)\r
- kfree(wlan_static_databuf);\r
-#endif\r
+ wlan_static_wl_escan_info_buf = kmalloc(DHD_PREALLOC_WL_ESCAN_INFO_SIZE, GFP_KERNEL);\r
+ if (!wlan_static_wl_escan_info_buf)\r
+ goto err_mem_alloc;\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_WL_ESCAN_INFO, DHD_PREALLOC_WL_ESCAN_INFO_SIZE);\r
\r
- if (wlan_static_dhd_info_buf)\r
- kfree(wlan_static_dhd_info_buf);\r
+ wlan_static_fw_verbose_ring_buf = kmalloc(\r
+ DHD_PREALLOC_WIPHY_ESCAN0_SIZE,\r
+ GFP_KERNEL);\r
+ if (!wlan_static_fw_verbose_ring_buf)\r
+ goto err_mem_alloc;\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_FW_VERBOSE_RING, DHD_PREALLOC_WL_ESCAN_INFO_SIZE);\r
\r
- if (wlan_static_dhd_wlfc_info_buf)\r
- kfree(wlan_static_dhd_wlfc_info_buf);\r
+ wlan_static_fw_event_ring_buf = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE, GFP_KERNEL);\r
+ if (!wlan_static_fw_event_ring_buf)\r
+ goto err_mem_alloc;\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_FW_EVENT_RING, DHD_PREALLOC_WL_ESCAN_INFO_SIZE);\r
\r
- if (wlan_static_dhd_wlfc_hanger_buf)\r
- kfree(wlan_static_dhd_wlfc_hanger_buf);\r
+ wlan_static_dhd_event_ring_buf = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE, GFP_KERNEL);\r
+ if (!wlan_static_dhd_event_ring_buf)\r
+ goto err_mem_alloc;\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_DHD_EVENT_RING, DHD_PREALLOC_WL_ESCAN_INFO_SIZE);\r
\r
- if (wlan_static_scan_buf1)\r
- kfree(wlan_static_scan_buf1);\r
+ wlan_static_nan_event_ring_buf = kmalloc(DHD_PREALLOC_WIPHY_ESCAN0_SIZE, GFP_KERNEL);\r
+ if (!wlan_static_nan_event_ring_buf)\r
+ goto err_mem_alloc;\r
+ pr_err("%s: sectoin %d, size=%d\n", __func__,\r
+ DHD_PREALLOC_NAN_EVENT_RING, DHD_PREALLOC_WL_ESCAN_INFO_SIZE);\r
\r
- if (wlan_static_scan_buf0)\r
- kfree(wlan_static_scan_buf0);\r
+ return 0;\r
\r
- if (wlan_static_osl_buf)\r
- kfree(wlan_static_osl_buf);\r
+err_mem_alloc:\r
\r
-#ifdef CONFIG_BCMDHD_PCIE\r
- if (wlan_static_if_flow_lkup)\r
- kfree(wlan_static_if_flow_lkup);\r
-#endif\r
- pr_err("Failed to mem_alloc for WLAN\n");\r
+ kfree(wlan_static_prot);\r
+ kfree(wlan_static_rxbuf);\r
+ kfree(wlan_static_databuf);\r
+ kfree(wlan_static_osl_buf);\r
+ kfree(wlan_static_scan_buf0);\r
+ kfree(wlan_static_scan_buf1);\r
+ kfree(wlan_static_dhd_info_buf);\r
+ kfree(wlan_static_dhd_wlfc_info_buf);\r
+ kfree(wlan_static_if_flow_lkup);\r
+ kfree(wlan_static_dhd_memdump_ram_buf);\r
+ kfree(wlan_static_dhd_wlfc_hanger_buf);\r
+ kfree(wlan_static_wl_escan_info_buf);\r
+ kfree(wlan_static_fw_verbose_ring_buf);\r
+ kfree(wlan_static_fw_event_ring_buf);\r
+ kfree(wlan_static_dhd_event_ring_buf);\r
+ kfree(wlan_static_nan_event_ring_buf);\r
+ pr_err("%s: Failed to mem_alloc for WLAN\n", __func__);\r
\r
i = WLAN_SKB_BUF_NUM;\r
\r
err_skb_alloc:\r
- pr_err("Failed to skb_alloc for WLAN\n");\r
- for (j = 0; j < i; j++) {\r
+ pr_err("%s: Failed to skb_alloc for WLAN\n", __func__);\r
+ for (j = 0; j < i; j++)\r
dev_kfree_skb(wlan_static_skb[j]);\r
- }\r
\r
return -ENOMEM;\r
}\r
-\r
-int\r
-bcmdhd_init_wlan_mem(void)\r
-{\r
- printk(KERN_ERR "%s()\n", __FUNCTION__);\r
-\r
- dhd_init_wlan_mem();\r
-\r
- return 0;\r
-}\r
-\r
-static void\r
-dhd_static_buf_exit(void)\r
-{\r
- int i;\r
-\r
- printk(KERN_ERR "%s()\n", __FUNCTION__);\r
-\r
- for (i = 0; i < DHD_SKB_1PAGE_BUF_NUM; i++) {\r
- if (wlan_static_skb[i])\r
- dev_kfree_skb(wlan_static_skb[i]);\r
- }\r
-\r
- for (i = DHD_SKB_1PAGE_BUF_NUM; i < WLAN_SKB_1_2PAGE_BUF_NUM; i++) {\r
- if (wlan_static_skb[i])\r
- dev_kfree_skb(wlan_static_skb[i]);\r
- }\r
-\r
-#if !defined(CONFIG_BCMDHD_PCIE)\r
- if (wlan_static_skb[i])\r
- dev_kfree_skb(wlan_static_skb[i]);\r
-#endif /* !CONFIG_BCMDHD_PCIE */\r
-\r
- if (wlan_static_prot)\r
- kfree(wlan_static_prot);\r
-\r
-#if defined(CONFIG_BCMDHD_SDIO)\r
- if (wlan_static_rxbuf)\r
- kfree(wlan_static_rxbuf);\r
-\r
- if (wlan_static_databuf)\r
- kfree(wlan_static_databuf);\r
-#endif\r
-\r
- if (wlan_static_osl_buf)\r
- kfree(wlan_static_osl_buf);\r
-\r
- if (wlan_static_scan_buf0)\r
- kfree(wlan_static_scan_buf0);\r
-\r
- if (wlan_static_dhd_info_buf)\r
- kfree(wlan_static_dhd_info_buf);\r
-\r
- if (wlan_static_dhd_wlfc_info_buf)\r
- kfree(wlan_static_dhd_wlfc_info_buf);\r
-\r
- if (wlan_static_dhd_wlfc_hanger_buf)\r
- kfree(wlan_static_dhd_wlfc_hanger_buf);\r
-\r
- if (wlan_static_scan_buf1)\r
- kfree(wlan_static_scan_buf1);\r
-\r
-#ifdef CONFIG_BCMDHD_PCIE\r
- if (wlan_static_if_flow_lkup)\r
- kfree(wlan_static_if_flow_lkup);\r
-#endif\r
- return;\r
-}\r
-\r
-\r
EXPORT_SYMBOL(bcmdhd_init_wlan_mem);\r
-#endif /* CONFIG_BROADCOM_WIFI_RESERVED_MEM */\r
MODULE_LICENSE("GPL");\r
MODULE_AUTHOR("AMLOGIC");\r
MODULE_DESCRIPTION("wifi device tree driver");\r
#define EPI_VERSION_DEV 1.579.77.41
/* Driver Version String, ASCII, 32 chars max */
-#define EPI_VERSION_STR "1.579.77.41.1 (r)"
+#define EPI_VERSION_STR "1.579.77.41.2 (r)"
#endif /* _epivers_h_ */
#ifndef OR_REG
#define OR_REG(osh, r, v) W_REG(osh, (r), R_REG(osh, r) | (v))
#endif /* !OR_REG */
-#ifdef CONFIG_DHD_USE_STATIC_BUF
-void* bcm_wlan_prealloc(int section, unsigned long size);
-#endif
+
#if !defined(OSL_SYSUPTIME)
#define OSL_SYSUPTIME() (0)
#define OSL_SYSUPTIME_SUPPORT FALSE
struct ether_addr mac_addr; /* Optional Mac address */
} wl_interface_create_t;
+typedef struct wl_interface_create_v0 {
+ uint16 ver; /* version of this struct */
+ struct ether_addr mac_addr; /* MAC address of the interface */
+ char ifname[BCM_MSG_IFNAME_MAX]; /* name of interface */
+ uint8 bsscfgidx; /* source bsscfg index */
+} wl_interface_info_t;
+
typedef struct wl_interface_create_v1 {
uint16 ver; /**< version of this struct */
uint8 pad1[2]; /**< Padding bytes */
uint32 rxrtry = 0;
uint32 rxmulti = 0;
- WL_DBG(("%s\n", command));
+ ANDROID_TRACE(("%s\n", command));
str = bcmstrtok(&pcmd, " ", NULL);
if (str) {
str = bcmstrtok(&pcmd, " ", NULL);
"%s %s Rx_Retry_Pkts=%d Rx_BcMc_Pkts=%d CAP=%04x\n",
CMD_GET_STA_INFO, str, rxrtry, rxmulti, cap);
- WL_DBG(("%s", command));
+ ANDROID_TRACE(("%s", command));
error:
return bytes_written;
u8 *reqbuf = NULL;
uint32 band = WLC_BAND_2G;
uint32 buf_size;
+ char *pos = command;
if (cmd_str) {
ANDROID_INFO(("Command: %s len:%d \n", cmd_str, (int)strlen(cmd_str)));
apcs_band = (band == WLC_BAND_AUTO) ? WLC_BAND_2G : band;
chosen_band = (channel <= CH_MAX_2G_CHANNEL) ? WLC_BAND_2G : WLC_BAND_5G;
if (apcs_band == chosen_band) {
- ANDROID_ERROR(("selected channel = %d\n", channel));
+ printf("%s: selected channel = %d\n", __FUNCTION__, channel);
break;
}
}
}
if (channel) {
- snprintf(command, 4, "%d", channel);
+ if (channel < 15)
+ pos += snprintf(pos, total_len, "2g=");
+ else
+ pos += snprintf(pos, total_len, "5g=");
+ pos += snprintf(pos, total_len, "%d", channel);
ANDROID_INFO(("command result is %s \n", command));
return strlen(command);
} else {
/* set pid, and if the event was happened, let's send a notification through netlink */
wl_cfg80211_set_rmc_pid(dev, pid);
- WL_DBG(("RMC pid=%d\n", pid));
+ ANDROID_TRACE(("RMC pid=%d\n", pid));
return err;
}
/* netlink_unicast() takes ownership of the skb and frees it itself. */
ret = netlink_unicast(nl_sk, skb, pid, 0);
- WL_DBG(("netlink_unicast() pid=%d, ret=%d\n", pid, ret));
+ ANDROID_TRACE(("netlink_unicast() pid=%d, ret=%d\n", pid, ret));
nlmsg_failure:
return ret;
}
if (i == ETHER_ADDR_LEN) {
- WL_DBG(("No BSSID\n"));
+ ANDROID_TRACE(("No BSSID\n"));
return -1;
}
}
}
- WL_DBG(("%s:result=%d, stf=%d, single_stream=%d, mcs map=%d\n",
+ ANDROID_TRACE(("%s:result=%d, stf=%d, single_stream=%d, mcs map=%d\n",
__FUNCTION__, result, stf, single_stream, nss));
bytes_written = sprintf(command, "%s %d", CMD_GET_LINK_STATUS, result);
sizeof(wl_reassoc_params_t))) < 0) {
ANDROID_ERROR(("reassoc failed err:%d \n", err));
} else {
- WL_DBG(("reassoc issued successfully\n"));
+ ANDROID_TRACE(("reassoc issued successfully\n"));
}
return err;
return -EINVAL;
ifname = token;
- WL_DBG(("rate %d, ifacename %s\n", rate, ifname));
+ ANDROID_TRACE(("rate %d, ifacename %s\n", rate, ifname));
err = wl_set_ap_beacon_rate(dev, rate, ifname);
if (unlikely(err)) {
return -EINVAL;
ifname = token;
- WL_DBG(("ifacename %s\n", ifname));
+ ANDROID_TRACE(("ifacename %s\n", ifname));
bytes_written = wl_get_ap_basic_rate(dev, command, ifname, total_len);
if (bytes_written < 1) {
return -EINVAL;
ifname = token;
- WL_DBG(("ifacename %s\n", ifname));
+ ANDROID_TRACE(("ifacename %s\n", ifname));
bytes_written = wl_get_ap_rps(dev, command, ifname, total_len);
if (bytes_written < 1) {
return -EINVAL;
ifname = token;
- WL_DBG(("enable %d, ifacename %s\n", enable, ifname));
+ ANDROID_TRACE(("enable %d, ifacename %s\n", enable, ifname));
err = wl_set_ap_rps(dev, enable? TRUE: FALSE, ifname);
if (unlikely(err)) {
return -EINVAL;
ifname = token;
- WL_DBG(("pps %d, level %d, quiettime %d, sta_assoc_check %d, "
+ ANDROID_TRACE(("pps %d, level %d, quiettime %d, sta_assoc_check %d, "
"ifacename %s\n", rps.pps, rps.level, rps.quiet_time,
rps.sta_assoc_check, ifname));
}
/* Parse the results */
- WL_DBG(("ifname %s, version %d, count %d, mimo rssi %d\n",
+ ANDROID_TRACE(("ifname %s, version %d, count %d, mimo rssi %d\n",
ifname, rssi_ant_mimo.version, rssi_ant_mimo.count, mimo_rssi));
if (mimo_rssi) {
- WL_DBG(("MIMO RSSI: %d\n", rssi_ant_mimo.rssi_sum));
+ ANDROID_TRACE(("MIMO RSSI: %d\n", rssi_ant_mimo.rssi_sum));
bytes_written = snprintf(command, total_len, "%s MIMO %d",
CMD_GET_RSSI_PER_ANT, rssi_ant_mimo.rssi_sum);
} else {
int cnt;
bytes_written = snprintf(command, total_len, "%s PER_ANT ", CMD_GET_RSSI_PER_ANT);
for (cnt = 0; cnt < rssi_ant_mimo.count; cnt++) {
- WL_DBG(("RSSI[%d]: %d\n", cnt, rssi_ant_mimo.rssi_ant[cnt]));
+ ANDROID_TRACE(("RSSI[%d]: %d\n", cnt, rssi_ant_mimo.rssi_ant[cnt]));
bytes_written = snprintf(command, total_len, "%d ",
rssi_ant_mimo.rssi_ant[cnt]);
}
}
set_param.time_threshold = bcm_atoi(token);
- WL_DBG(("enable %d, RSSI threshold %d, Time threshold %d\n", set_param.enable,
+ ANDROID_TRACE(("enable %d, RSSI threshold %d, Time threshold %d\n", set_param.enable,
set_param.rssi_threshold, set_param.time_threshold));
err = wl_set_rssi_logging(dev, (void *)&set_param);
return BCME_ERROR;
}
- WL_DBG(("report_count %d, enable %d, rssi_threshold %d, time_threshold %d\n",
+ ANDROID_TRACE(("report_count %d, enable %d, rssi_threshold %d, time_threshold %d\n",
get_param.report_count, get_param.enable, get_param.rssi_threshold,
get_param.time_threshold));
/* Parse the parameter */
if (!get_param.enable) {
- WL_DBG(("RSSI LOGGING: Feature is disables\n"));
+ ANDROID_TRACE(("RSSI LOGGING: Feature is disables\n"));
bytes_written = snprintf(command, total_len,
"%s FEATURE DISABLED\n", CMD_GET_RSSI_LOGGING);
} else if (get_param.enable &
(RSSILOG_FLAG_FEATURE_SW | RSSILOG_FLAG_REPORT_READY)) {
if (!get_param.report_count) {
- WL_DBG(("[PASS] RSSI difference across antennas is within"
+ ANDROID_TRACE(("[PASS] RSSI difference across antennas is within"
" threshold limits\n"));
bytes_written = snprintf(command, total_len, "%s PASS\n",
CMD_GET_RSSI_LOGGING);
} else {
- WL_DBG(("[FAIL] RSSI difference across antennas found "
+ ANDROID_TRACE(("[FAIL] RSSI difference across antennas found "
"to be greater than %3d dB\n", get_param.rssi_threshold));
- WL_DBG(("[FAIL] RSSI difference check have failed for "
+ ANDROID_TRACE(("[FAIL] RSSI difference check have failed for "
"%d out of %d times\n", get_param.report_count,
get_param.time_threshold));
- WL_DBG(("[FAIL] RSSI difference is being monitored once "
+ ANDROID_TRACE(("[FAIL] RSSI difference is being monitored once "
"per second, for a %d secs window\n", get_param.time_threshold));
bytes_written = snprintf(command, total_len, "%s FAIL - RSSI Threshold "
"%d dBm for %d out of %d times\n", CMD_GET_RSSI_LOGGING,
get_param.time_threshold);
}
} else {
- WL_DBG(("[BUSY] Reprot is not ready\n"));
+ ANDROID_TRACE(("[BUSY] Reprot is not ready\n"));
bytes_written = snprintf(command, total_len, "%s BUSY - NOT READY\n",
CMD_GET_RSSI_LOGGING);
}
else if (strnicmp(command, CMD_MAXDTIM_IN_SUSPEND, strlen(CMD_MAXDTIM_IN_SUSPEND)) == 0) {
bytes_written = wl_android_set_max_dtim(net, command, priv_cmd.total_len);
}
+#ifdef WL_CFG80211
else if (strnicmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) == 0) {
#ifdef DISABLE_SETBAND
bytes_written = BCME_DISABLED;
bytes_written = wl_cfg80211_set_if_band(net, band);
#endif /* DISABLE_SETBAND */
}
+#endif
else if (strnicmp(command, CMD_GETBAND, strlen(CMD_GETBAND)) == 0) {
bytes_written = wl_android_get_band(net, command, priv_cmd.total_len);
}
#define CFG80211_PUT_BSS(wiphy, bss) cfg80211_put_bss(bss);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
-#define ieee80211_band nl80211_band
-#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
-#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ
-#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
-#endif
-
#define CHAN2G(_channel, _freq, _flags) { \
.band = IEEE80211_BAND_2GHZ, \
.center_freq = (_freq), \
chspec |= WL_CHANSPEC_CTL_SB_U;
}
}
+
if (wf_chspec_malformed(chspec)) {
WL_ERR(("wl_chspec_from_legacy: output chanspec (0x%04X) malformed\n",
chspec));
return INVCHANSPEC;
}
+
return chspec;
}
if (ioctl_version == 1) {
chanspec = wl_chspec_from_legacy(chanspec);
}
+
return chanspec;
}
&iface_v3, sizeof(wl_interface_create_v3_t),
ioctl_buf, sizeof(ioctl_buf), NULL);
} else {
+#if 0
/* On any other error, attempt with iovar version 2 */
WL_DBG(("interface_create version 2. get_ver:%d\n", ret));
iface.ver = WL_INTERFACE_CREATE_VER_2;
ret = wldev_iovar_getbuf(ndev, "interface_create",
&iface, sizeof(struct wl_interface_create_v2),
ioctl_buf, sizeof(ioctl_buf), NULL);
+#endif
}
if (unlikely(ret)) {
struct wl_bss_info *bi = NULL;
s32 i;
u32 channel;
-/*#if defined(DHD_DEBUG) && defined(DHD_FW_COREDUMP)
+#if 0
dhd_pub_t *dhdp = (dhd_pub_t *)(cfg->pub);
uint32 prev_memdump_mode = dhdp->memdump_enabled;
-#endif*/ /* DHD_DEBUG && DHD_FW_COREDUMP */
+#endif /* DHD_DEBUG && DHD_FW_COREDUMP */
+
if (!(cfg->scan_request)) {
WL_ERR(("timer expired but no scan request\n"));
return;
WL_ERR(("bss_list is null. Didn't receive any partial scan results\n"));
} else {
WL_ERR(("scanned AP count (%d)\n", bss_list->count));
+
bi = next_bss(bss_list, bi);
for_each_bss(bss_list, bi, i) {
if (bi != NULL && &(bi->chanspec) != NULL && (bi->SSID)) {
}
}
}
+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0))
if (cfg->scan_request->dev)
wdev = cfg->scan_request->dev->ieee80211_ptr;
return;
}
ndev = wdev_to_wlc_ndev(wdev, cfg);
+
bzero(&msg, sizeof(wl_event_msg_t));
WL_ERR(("timer expired\n"));
-/*#if defined(DHD_DEBUG) && defined(DHD_FW_COREDUMP)
+#if 0
if (dhdp->memdump_enabled) {
dhdp->memdump_enabled = DUMP_MEMFILE;
dhdp->memdump_type = DUMP_TYPE_SCAN_TIMEOUT;
dhd_bus_mem_dump(dhdp);
dhdp->memdump_enabled = prev_memdump_mode;
}
-#endif*/
- /* DHD_DEBUG && DHD_FW_COREDUMP */
+#endif /* DHD_DEBUG && DHD_FW_COREDUMP */
msg.event_type = hton32(WLC_E_ESCAN_RESULT);
msg.status = hton32(WLC_E_STATUS_TIMEOUT);
msg.reason = 0xFFFFFFFF;
if (!wl_scan_timeout_dbg_enabled)
wl_scan_timeout_dbg_set();
#endif /* CUSTOMER_HW4_DEBUG */
+
// terence 20130729: workaround to fix out of memory in firmware
// if (dhd_conf_get_chip(dhd_get_pub(ndev)) == BCM43362_CHIP_ID) {
// WL_ERR(("Send hang event\n"));
wl_cfg80211_update_power_mode(_net_info->ndev);
}
#ifdef RTT_SUPPORT
- }
+ }
#endif /* RTT_SUPPORT */
}
wl_cfg80211_concurrent_roam(cfg, 0);
unsigned long flags;
struct net_info *iter, *next;
struct net_device *ndev = bcmcfg_to_prmry_ndev(cfg);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
- struct cfg80211_scan_info info;
-#endif
#if defined(WL_CFG80211) && (defined(WL_ENABLE_P2P_IF) || \
defined(WL_NEW_CFG_PRIVCMD_SUPPORT)) && !defined(PLATFORM_SLP)
struct net_device *p2p_net = cfg->p2p_net;
dhd_pub_t *dhd = (dhd_pub_t *)(cfg->pub);
#endif
#endif /* PROP_TXSTATUS_VSDB */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0))
+ struct cfg80211_scan_info info;
+#endif
+
WL_DBG(("In\n"));
/* Check if cfg80211 interface is already down */
}
static bool
-wl_cfg80211_valid_chanspec_p2p(chanspec_t chanspec)
+wl_cfg80211_valid_channel_p2p(int channel)
{
bool valid = false;
- char chanbuf[CHANSPEC_STR_LEN];
/* channel 1 to 14 */
- if ((chanspec >= 0x2b01) && (chanspec <= 0x2b0e)) {
+ if ((channel >= 1) && (channel <= 14)) {
valid = true;
}
/* channel 36 to 48 */
- else if ((chanspec >= 0x1b24) && (chanspec <= 0x1b30)) {
+ else if ((channel >= 36) && (channel <= 48)) {
valid = true;
}
/* channel 149 to 161 */
- else if ((chanspec >= 0x1b95) && (chanspec <= 0x1ba1)) {
+ else if ((channel >= 149) && (channel <= 161)) {
valid = true;
}
else {
valid = false;
- WL_INFORM(("invalid P2P chanspec, chanspec = %s\n",
- wf_chspec_ntoa_ex(chanspec, chanbuf)));
+ WL_INFORM(("invalid P2P chanspec, channel = %d\n", channel));
}
return valid;
}
if (CHANNEL_IS_RADAR(channel) ||
- !(wl_cfg80211_valid_chanspec_p2p(chanspec))) {
+ !(wl_cfg80211_valid_channel_p2p(CHSPEC_CHANNEL(chanspec)))) {
continue;
} else {
list->element[j] = list->element[i];
uint chip;
/* Start auto channel selection scan. */
- ret = wldev_ioctl_set(ndev, WLC_START_CHANNEL_SEL, NULL, 0);
+ ret = wldev_ioctl_set(ndev, WLC_START_CHANNEL_SEL, buf, buflen);
if (ret < 0) {
WL_ERR(("can't start auto channel scan, error = %d\n", ret));
*channel = 0;
chanspec = wl_chspec_driver_to_host(chosen);
printf("selected chanspec = 0x%x\n", chanspec);
ctl_chan = wf_chspec_ctlchan(chanspec);
- printf("selected ctl_chan = 0x%x\n", ctl_chan);
+ printf("selected ctl_chan = %d\n", ctl_chan);
*channel = (u16)(ctl_chan & 0x00FF);
} else
*channel = (u16)(chosen & 0x00FF);
*channel = 0;
ret = BCME_ERROR;
}
+ WL_INFORM(("selected channel = %d\n", *channel));
done:
return ret;
}
if (CHANNEL_IS_2G(channel)) {
+#if 0
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) && !defined(WL_COMPAT_WIRELESS)
channel = ieee80211_channel_to_frequency(channel);
#else
channel = ieee80211_channel_to_frequency(channel, IEEE80211_BAND_2GHZ);
+#endif
#endif
} else {
WL_ERR(("invalid 2.4GHz channel, channel = %d\n", channel));
channel = 0;
}
+ pos += snprintf(pos, total_len, "2g=%d ", channel);
}
- pos += snprintf(pos, total_len, "%04d ", channel);
if (band_cur != WLC_BAND_2G) {
// terence 20140120: fix for some chipsets only return 2.4GHz channel (4330b2/43341b0/4339a0)
}
if (CHANNEL_IS_5G(channel)) {
- channel = ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ);
- } else {
- WL_ERR(("invalid 5GHz channel, channel = %d\n", channel));
- channel = 0;
- }
-
- if (CHANNEL_IS_5G(channel)) {
+#if 0
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 39) && !defined(WL_COMPAT_WIRELESS)
channel = ieee80211_channel_to_frequency(channel);
#else
channel = ieee80211_channel_to_frequency(channel, IEEE80211_BAND_5GHZ);
+#endif
#endif
} else {
WL_ERR(("invalid 5GHz channel, channel = %d\n", channel));
ret = wldev_ioctl(dev, WLC_SET_BAND, &band_cur, sizeof(band_cur), true);
if (ret < 0)
WL_ERR(("WLC_SET_BAND error %d\n", ret));
+ pos += snprintf(pos, total_len, "5g=%d ", channel);
}
- pos += snprintf(pos, total_len, "%04d ", channel);
-
- /* Set overall best channel same as 5GHz best channel. */
- pos += snprintf(pos, total_len, "%04d ", channel);
done:
if (NULL != buf) {
WL_ERR(("can't restore auto channel scan state, error = %d\n", ret));
}
- printf("%s: channel %s\n", __FUNCTION__, cmd);
+ printf("%s: %s\n", __FUNCTION__, cmd);
return (pos - cmd);
}
#define WL_PNO(x)
#define WL_SD(x)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0))
+#define ieee80211_band nl80211_band
+#define IEEE80211_BAND_2GHZ NL80211_BAND_2GHZ
+#define IEEE80211_BAND_5GHZ NL80211_BAND_5GHZ
+#define IEEE80211_NUM_BANDS NUM_NL80211_BANDS
+#endif
#define WL_SCAN_RETRY_MAX 3
#define WL_NUM_PMKIDS_MAX MAXPMKID
int err = BCME_ERROR, rem, type;
char country_code[WLC_CNTRY_BUF_SZ] = {0};
const struct nlattr *iter;
-
+ WL_ERR(("enter wl_cfgvendor_set_country: \n"));
nla_for_each_attr(iter, data, len, rem) {
type = nla_type(iter);
switch (type) {
}
err = wldev_set_country(wdev->netdev, country_code, true, true, -1);
+ WL_ERR(("Set country code ret:%d\n", err));
if (err < 0) {
WL_ERR(("Set country failed ret:%d\n", err));
}
wlc_rev_info_t revinfo;
#ifdef CONFIG_COMPAT
compat_wifi_iface_stat compat_iface;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
+ int compat_task_state = in_compat_syscall();
+#else
int compat_task_state = is_compat_task();
+#endif
#endif /* CONFIG_COMPAT */
WL_INFORM(("%s: Enter \n", __func__));
goto free_mem;
}
#ifdef CONFIG_COMPAT
- if (is_compat_task()) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
+ if (in_compat_syscall())
+#else
+ if (is_compat_task())
+#endif
+ {
void * usr_ptr = compat_ptr((uintptr_t) user_buf);
ret = copy_to_user(usr_ptr, mem_buf, buf_len);
if (ret) {
ret = wl_cfgvendor_send_cmd_reply(wiphy, bcmcfg_to_prmry_ndev(cfg),
&supported_features, sizeof(supported_features));
if (ret < 0) {
- WL_ERR(("wl_cfgvendor_send_cmd_reply failed ret:%d\n", ret));
- goto exit;
- }
+ WL_ERR(("wl_cfgvendor_send_cmd_reply failed ret:%d\n", ret));
+ goto exit;
+ }
exit:
return ret;
}
#include <typedefs.h>
#include <linuxver.h>
#include <osl.h>
+#include <dngl_stats.h>
+#include <dhd.h>
+
#include <bcmutils.h>
#include <bcmendian.h>
#include <ethernet.h>
return err;
}
-void wl_escan_detach(void)
+void wl_escan_detach(dhd_pub_t *dhdp)
{
struct wl_escan_info *escan = g_escan;
kfree(escan->escan_ioctl_buf);
escan->escan_ioctl_buf = NULL;
}
-#ifndef CONFIG_DHD_USE_STATIC_BUF
- kfree(escan);
-#endif
+ DHD_OS_PREFREE(dhdp, escan, sizeof(struct wl_escan_info));
g_escan = NULL;
}
int
-wl_escan_attach(struct net_device *dev, void * dhdp)
+wl_escan_attach(struct net_device *dev, dhd_pub_t *dhdp)
{
struct wl_escan_info *escan = NULL;
if (!dev)
return 0;
-#ifdef CONFIG_DHD_USE_STATIC_BUF
- escan = bcm_wlan_prealloc(DHD_PREALLOC_WL_ESCAN_INFO, sizeof(struct wl_escan_info));
-#else
- escan = kmalloc(sizeof(struct wl_escan_info), GFP_KERNEL);
-#endif
+ escan = (wl_escan_info_t *)DHD_OS_PREALLOC(dhdp, DHD_PREALLOC_WL_ESCAN_INFO, sizeof(struct wl_escan_info));
if (!escan)
return -ENOMEM;
memset(escan, 0, sizeof(struct wl_escan_info));
return 0;
err:
- wl_escan_detach();
+ wl_escan_detach(dhdp);
return -ENOMEM;
}
);\r
int wl_escan_get_scan(struct net_device *dev, struct iw_request_info *info,\r
struct iw_point *dwrq, char *extra);\r
-int wl_escan_attach(struct net_device *dev, void * dhdp);\r
-void wl_escan_detach(void);\r
+int wl_escan_attach(struct net_device *dev, dhd_pub_t *dhdp);\r
+void wl_escan_detach(dhd_pub_t *dhdp);\r
\r
#endif /* _wl_escan_ */\r
\r
fwrq->m /= 10;
}
/* handle 4.9GHz frequencies as Japan 4 GHz based channelization */
- if (fwrq->m > 4000 && fwrq->m < 5000) {
- sf = WF_CHAN_FACTOR_4_G; /* start factor for 4 GHz */
- }
+ if (fwrq->m > 4000 && fwrq->m < 5000) {
+ sf = WF_CHAN_FACTOR_4_G; /* start factor for 4 GHz */
+ }
chan = wf_mhz2channel(fwrq->m, sf);
}
WL_ERROR(("%s: chan=%d\n", __FUNCTION__, chan));