summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuzhen <huzhen@allwinnertech.com>2012-11-27 12:20:43 +0400
committerhuzhen <huzhen@allwinnertech.com>2012-11-27 12:30:56 +0400
commita2a60c6aa9e39eacaafa5868942a9e5cf19b80b4 (patch)
tree2f3b95c7dc022abde1a76088c38ec2e28c5a0944
parent5952f000f433ea39e415e4bb146d0ee3a58bca3b (diff)
downloadlinux-sunxi-lichee/a10-ics.tar.xz
update bcm40181&40183 for softap and directlichee/a10-ics
-rwxr-xr-xdrivers/net/wireless/bcmdhd/Kconfig9
-rwxr-xr-xdrivers/net/wireless/bcmdhd/Makefile42
-rwxr-xr-xdrivers/net/wireless/bcmdhd/bcmsdh.c25
-rwxr-xr-xdrivers/net/wireless/bcmdhd/bcmsdh_linux.c14
-rwxr-xr-xdrivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c211
-rwxr-xr-xdrivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c20
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd.h74
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_cdc.c22
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_cfg80211.c69
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_cfg80211.h3
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_common.c180
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_custom_gpio.c6
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_dbg.h9
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_linux.c627
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_proto.h8
-rwxr-xr-xdrivers/net/wireless/bcmdhd/dhd_sdio.c146
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/bcmdevs.h3
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/bcmsdh_sdmmc.h11
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/bcmsdstd.h7
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/dhdioctl.h5
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/epivers.h10
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/epivers.sh268
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/hndpmu.h5
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/htsf.h (renamed from drivers/net/wireless/bcmdhd/include/epivers.h.in)73
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/sbchipc.h12
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/siutils.h4
-rwxr-xr-xdrivers/net/wireless/bcmdhd/include/wlioctl.h12
-rwxr-xr-xdrivers/net/wireless/bcmdhd/mk.sh3
-rwxr-xr-xdrivers/net/wireless/bcmdhd/siutils.c2
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_android.c58
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_cfg80211.c1655
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_cfg80211.h27
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_cfgp2p.c75
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_cfgp2p.h12
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_iw.c1737
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wl_iw.h8
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wldev_common.c50
-rwxr-xr-xdrivers/net/wireless/bcmdhd/wldev_common.h4
38 files changed, 1868 insertions, 3638 deletions
diff --git a/drivers/net/wireless/bcmdhd/Kconfig b/drivers/net/wireless/bcmdhd/Kconfig
index 0458dc03ffd9..e7ddbcb175b5 100755
--- a/drivers/net/wireless/bcmdhd/Kconfig
+++ b/drivers/net/wireless/bcmdhd/Kconfig
@@ -22,7 +22,7 @@ config BCMDHD_FW_PATH
config BCMDHD_NVRAM_PATH
depends on BCMDHD
- string "NVRAM path"
+ string "NVRAM path"
default "/system/vendor/modules/bcm_nvram.txt"
---help---
bcm40181 bcm40183 Path to the calibration file.
@@ -36,10 +36,3 @@ config BCMDHD_WEXT
select WEXT_PRIV
help
Enables WEXT support
-
-config DHD_USE_SCHED_SCAN
- bool "Use CFG80211 sched scan"
- depends on BCMDHD && CFG80211
- default y
- ---help---
- Use CFG80211 sched scan
diff --git a/drivers/net/wireless/bcmdhd/Makefile b/drivers/net/wireless/bcmdhd/Makefile
index 15a77ac289c0..258473029e38 100755
--- a/drivers/net/wireless/bcmdhd/Makefile
+++ b/drivers/net/wireless/bcmdhd/Makefile
@@ -1,36 +1,32 @@
-# bcmdhd
-DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \
- -DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DWLBTAMP -DBCMFILEIMAGE \
- -DDHDTHREAD -DDHD_GPL -DDHD_SCHED -DDHD_DEBUG -DSDTEST -DBDC -DTOE \
- -DDHD_BCMEVENTS -DSHOW_EVENTS -DDONGLEOVERLAYS -DBCMDBG \
- -DMMC_SDIO_ABORT -DBCMSDIO -DBCMLXSDMMC -DBCMPLATFORM_BUS -DWLP2P \
- -DNEW_COMPAT_WIRELESS -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT \
- -DKEEP_ALIVE -DCSCAN -DPKT_FILTER_SUPPORT \
- -DEMBEDDED_PLATFORM -DENABLE_INSMOD_NO_FW_LOAD -DPNO_SUPPORT \
- -DOEM_ANDROID -DLINUX -DWL_ENABLE_P2P_IF -DWL_CFG80211_STA_EVENT \
- -DSDIO_ISR_THREAD -UCONFIG_WIRELESS_EXT -DCONFIG_DHD_ENABLE_P2P \
- -Idrivers/net/wireless/bcmdhd -Idrivers/net/wireless/bcmdhd/include
+#bcmdhd flags
+DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \
+ -DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DWLBTAMP -DBCMFILEIMAGE \
+ -DDHDTHREAD -DDHD_GPL -DDHD_SCHED -DBDC -DTOE \
+ -DDHD_BCMEVENTS -DSHOW_EVENTS -DDONGLEOVERLAYS \
+ -DMMC_SDIO_ABORT -DBCMSDIO -DBCMLXSDMMC -DBCMPLATFORM_BUS -DWLP2P \
+ -DNEW_COMPAT_WIRELESS -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT \
+ -DKEEP_ALIVE -DCSCAN -DPKT_FILTER_SUPPORT \
+ -DEMBEDDED_PLATFORM -DPNO_SUPPORT -DENABLE_INSMOD_NO_FW_LOAD -DSDIO_ISR_THREAD \
+ -Idrivers/net/wireless/bcmdhd -Idrivers/net/wireless/bcmdhd/include
-DHDOFILES = aiutils.o bcmsdh_sdmmc_linux.o dhd_linux.o siutils.o bcmutils.o \
- dhd_linux_sched.o bcmwifi.o dhd_sdio.o bcmevent.o dhd_bta.o hndpmu.o \
- bcmsdh.o dhd_cdc.o bcmsdh_linux.o dhd_common.o linux_osl.o \
- bcmsdh_sdmmc.o dhd_custom_gpio.o sbutils.o wldev_common.o wl_android.o dhd_cfg80211.o
+DHDOFILES = aiutils.o bcmsdh_sdmmc_linux.o dhd_linux.o siutils.o bcmutils.o \
+ dhd_linux_sched.o bcmwifi.o dhd_sdio.o bcmevent.o dhd_bta.o hndpmu.o \
+ bcmsdh.o dhd_cdc.o bcmsdh_linux.o dhd_common.o linux_osl.o \
+ bcmsdh_sdmmc.o dhd_custom_gpio.o sbutils.o wldev_common.o wl_android.o
obj-$(CONFIG_BCMDHD) += bcmdhd.o
bcmdhd-objs += $(DHDOFILES)
-#ifneq ($(CONFIG_WIRELESS_EXT),)
-#bcmdhd-objs += wl_iw.o
-#DHDCFLAGS += -DSOFTAP
-#endif
+ifneq ($(CONFIG_WIRELESS_EXT),)
+bcmdhd-objs += wl_iw.o
+DHDCFLAGS += -DSOFTAP -DWL_WIRELESS_EXT
+endif
ifneq ($(CONFIG_CFG80211),)
-bcmdhd-objs += wl_cfg80211.o wl_cfgp2p.o wl_linux_mon.o
+bcmdhd-objs += wl_cfg80211.o wl_cfgp2p.o wl_linux_mon.o dhd_cfg80211.o
DHDCFLAGS += -DWL_CFG80211
endif
EXTRA_CFLAGS = $(DHDCFLAGS)
ifeq ($(CONFIG_BCMDHD),m)
EXTRA_LDFLAGS += --strip-debug
endif
-
-# -DCUSTOMER_HW2 -DCUSTOM_OOB_GPIO_NUM=2 -DOOB_INTR_ONLY -DHW_OOB \
diff --git a/drivers/net/wireless/bcmdhd/bcmsdh.c b/drivers/net/wireless/bcmdhd/bcmsdh.c
index d5dd6296e3cf..2b36dbbe6a8d 100755
--- a/drivers/net/wireless/bcmdhd/bcmsdh.c
+++ b/drivers/net/wireless/bcmdhd/bcmsdh.c
@@ -22,7 +22,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh.c 335570 2012-05-29 12:04:50Z $
+ * $Id: bcmsdh.c 300445 2011-12-03 05:37:20Z $
*/
/**
@@ -724,26 +724,3 @@ bcmsdh_gpioout(void *sdh, uint32 gpio, bool enab)
return sdioh_gpioout(sd, gpio, enab);
}
-
-#ifdef BCMSDIOH_TXGLOM
-void
-bcmsdh_glom_post(void *sdh, uint8 *frame, uint len)
-{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *)sdh;
- sdioh_glom_post(bcmsdh->sdioh, frame, len);
-}
-
-void
-bcmsdh_glom_clear(void *sdh)
-{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *)sdh;
- sdioh_glom_clear(bcmsdh->sdioh);
-}
-
-uint8
-bcmsdh_get_version(void *sdh)
-{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *)sdh;
- return (sdioh_get_version(bcmsdh->sdioh));
-}
-#endif /* BCMSDIOH_TXGLOM */
diff --git a/drivers/net/wireless/bcmdhd/bcmsdh_linux.c b/drivers/net/wireless/bcmdhd/bcmsdh_linux.c
index a732a7b69f2e..ec6adf5ab51b 100755
--- a/drivers/net/wireless/bcmdhd/bcmsdh_linux.c
+++ b/drivers/net/wireless/bcmdhd/bcmsdh_linux.c
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh_linux.c 312788 2012-02-03 23:06:32Z $
+ * $Id: bcmsdh_linux.c 310626 2012-01-25 05:47:55Z $
*/
/**
@@ -635,6 +635,12 @@ int bcmsdh_register_oob_intr(void * dhdp)
return 0;
}
+void *bcmsdh_get_drvdata(void)
+{
+ if (!sdhcinfo)
+ return NULL;
+ return dev_get_drvdata(sdhcinfo->dev);
+}
void bcmsdh_set_irq(int flag)
{
if (sdhcinfo->oob_irq_registered && sdhcinfo->oob_irq_enable_flag != flag) {
@@ -660,16 +666,14 @@ void bcmsdh_unregister_oob_intr(void)
sdhcinfo->oob_irq_registered = FALSE;
}
}
-#endif /* defined(OOB_INTR_ONLY) */
-
-#if defined(BCMLXSDMMC)
+#else
void *bcmsdh_get_drvdata(void)
{
if (!sdhcinfo)
return NULL;
return dev_get_drvdata(sdhcinfo->dev);
}
-#endif
+#endif /* defined(OOB_INTR_ONLY) */
/* Module parameters specific to each host-controller driver */
diff --git a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
index a7843cc2de03..2ea0da9ad4e7 100755
--- a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh_sdmmc.c 321372 2012-03-15 01:10:32Z $
+ * $Id: bcmsdh_sdmmc.c 309549 2012-01-20 01:13:15Z $
*/
#include <typedefs.h>
@@ -35,7 +35,6 @@
#include <sdiovar.h> /* ioctl/iovars */
#include <linux/mmc/core.h>
-#include <linux/mmc/card.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
@@ -149,7 +148,6 @@ sdioh_attach(osl_t *osh, void *bar0, uint irq)
sd->sd_blockmode = TRUE;
sd->use_client_ints = TRUE;
sd->client_block_size[0] = 64;
- sd->use_rxchain = FALSE;
gInstance->sd = sd;
@@ -514,7 +512,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
}
case IOV_GVAL(IOV_RXCHAIN):
- int_val = (int32)si->use_rxchain;
+ int_val = FALSE;
bcopy(&int_val, arg, val_size);
break;
@@ -681,10 +679,15 @@ sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
uint8 data;
if (enable)
- data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE | SDIO_SEPINT_ACT_HI;
+ data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE; /* enable hw oob interrupt */
else
data = SDIO_SEPINT_ACT_HI; /* disable hw oob interrupt */
+#if 1 && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
+ /* Needed for Android Linux Kernel 2.6.35 */
+ data |= SDIO_SEPINT_ACT_HI; /* Active HIGH */
+#endif /* OEM_ANDROID */
+
status = sdioh_request_byte(sd, SDIOH_WRITE, 0, SDIOD_CCCR_BRCM_SEPINT, &data);
return status;
}
@@ -837,8 +840,8 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr, uint8 *by
}
if (err_ret) {
- sd_err(("bcmsdh_sdmmc: Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n",
- rw ? "Write" : "Read", func, regaddr, *byte, err_ret));
+ //sd_err(("bcmsdh_sdmmc: Failed to %s byte F%d:@0x%05x=%02x, Err: %d\n", //magic resume error
+ // rw ? "Write" : "Read", func, regaddr, *byte, err_ret));
}
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
@@ -899,12 +902,8 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
bool fifo = (fix_inc == SDIOH_DATA_FIX);
uint32 SGCount = 0;
int err_ret = 0;
- void *pnext, *pprev;
- uint ttl_len, dma_len, lft_len, xfred_len, pkt_len;
- uint blk_num;
- struct mmc_request mmc_req;
- struct mmc_command mmc_cmd;
- struct mmc_data mmc_dat;
+
+ void *pnext;
sd_trace(("%s: Enter\n", __FUNCTION__));
@@ -912,149 +911,67 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
DHD_PM_RESUME_WAIT(sdioh_request_packet_wait);
DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
- ttl_len = xfred_len = 0;
- /* at least 4 bytes alignment of skb buff is guaranteed */
- for (pnext = pkt; pnext; pnext = PKTNEXT(sd->osh, pnext))
- ttl_len += PKTLEN(sd->osh, pnext);
-
- if (!sd->use_rxchain || ttl_len <= sd->client_block_size[func]) {
- blk_num = 0;
- dma_len = 0;
- } else {
- blk_num = ttl_len / sd->client_block_size[func];
- dma_len = blk_num * sd->client_block_size[func];
- }
- lft_len = ttl_len - dma_len;
-
- sd_trace(("%s: %s %dB to func%d:%08x, %d blks with DMA, %dB leftover\n",
- __FUNCTION__, write ? "W" : "R",
- ttl_len, func, addr, blk_num, lft_len));
-
- if (0 != dma_len) {
- memset(&mmc_req, 0, sizeof(struct mmc_request));
- memset(&mmc_cmd, 0, sizeof(struct mmc_command));
- memset(&mmc_dat, 0, sizeof(struct mmc_data));
-
- /* Set up DMA descriptors */
- pprev = pkt;
- for (pnext = pkt;
- pnext && dma_len;
- pnext = PKTNEXT(sd->osh, pnext)) {
- pkt_len = PKTLEN(sd->osh, pnext);
-
- if (dma_len > pkt_len)
- dma_len -= pkt_len;
- else {
- pkt_len = xfred_len = dma_len;
- dma_len = 0;
- pkt = pnext;
- }
+ /* Claim host controller */
+ sdio_claim_host(gInstance->func[func]);
+ for (pnext = pkt; pnext; pnext = PKTNEXT(sd->osh, pnext)) {
+ uint pkt_len = PKTLEN(sd->osh, pnext);
+ pkt_len += 3;
+ pkt_len &= 0xFFFFFFFC;
- sg_set_buf(&sd->sg_list[SGCount++],
- (uint8*)PKTDATA(sd->osh, pnext),
+#ifdef CONFIG_MMC_MSM7X00A
+ if ((pkt_len % 64) == 32) {
+ sd_trace(("%s: Rounding up TX packet +=32\n", __FUNCTION__));
+ pkt_len += 32;
+ }
+#endif /* CONFIG_MMC_MSM7X00A */
+ /* Make sure the packet is aligned properly. If it isn't, then this
+ * is the fault of sdioh_request_buffer() which is supposed to give
+ * us something we can work with.
+ */
+ ASSERT(((uint32)(PKTDATA(sd->osh, pkt)) & DMA_ALIGN_MASK) == 0);
+
+ if ((write) && (!fifo)) {
+ err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
+ ((uint8*)PKTDATA(sd->osh, pnext)),
+ pkt_len);
+ } else if (write) {
+ err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
+ ((uint8*)PKTDATA(sd->osh, pnext)),
+ pkt_len);
+ } else if (fifo) {
+ err_ret = sdio_readsb(gInstance->func[func],
+ ((uint8*)PKTDATA(sd->osh, pnext)),
+ addr,
+ pkt_len);
+ } else {
+ err_ret = sdio_memcpy_fromio(gInstance->func[func],
+ ((uint8*)PKTDATA(sd->osh, pnext)),
+ addr,
pkt_len);
-
- if (SGCount >= SDIOH_SDMMC_MAX_SG_ENTRIES) {
- sd_err(("%s: sg list entries exceed limit\n",
- __FUNCTION__));
- return (SDIOH_API_RC_FAIL);
- }
}
- mmc_dat.sg = sd->sg_list;
- mmc_dat.sg_len = SGCount;
- mmc_dat.blksz = sd->client_block_size[func];
- mmc_dat.blocks = blk_num;
- mmc_dat.flags = write ? MMC_DATA_WRITE : MMC_DATA_READ;
-
- mmc_cmd.opcode = 53; /* SD_IO_RW_EXTENDED */
- mmc_cmd.arg = write ? 1<<31 : 0;
- mmc_cmd.arg |= (func & 0x7) << 28;
- mmc_cmd.arg |= 1<<27;
- mmc_cmd.arg |= fifo ? 0 : 1<<26;
- mmc_cmd.arg |= (addr & 0x1FFFF) << 9;
- mmc_cmd.arg |= blk_num & 0x1FF;
- mmc_cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_ADTC;
-
- mmc_req.cmd = &mmc_cmd;
- mmc_req.data = &mmc_dat;
-
- sdio_claim_host(gInstance->func[func]);
- mmc_set_data_timeout(&mmc_dat, gInstance->func[func]->card);
- mmc_wait_for_req(gInstance->func[func]->card->host, &mmc_req);
- sdio_release_host(gInstance->func[func]);
-
- err_ret = mmc_cmd.error? mmc_cmd.error : mmc_dat.error;
- if (0 != err_ret) {
- sd_err(("%s:CMD53 %s failed with code %d\n",
- __FUNCTION__,
- write ? "write" : "read",
- err_ret));
- sd_err(("%s:Disabling rxchain and fire it with PIO\n",
- __FUNCTION__));
- sd->use_rxchain = FALSE;
- pkt = pprev;
- lft_len = ttl_len;
- } else if (!fifo) {
- addr = addr + ttl_len - lft_len - dma_len;
+ if (err_ret) {
+ sd_err(("%s: %s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=0x%08x\n",
+ __FUNCTION__,
+ (write) ? "TX" : "RX",
+ pnext, SGCount, addr, pkt_len, err_ret));
+ } else {
+ sd_trace(("%s: %s xfr'd %p[%d], addr=0x%05x, len=%d\n",
+ __FUNCTION__,
+ (write) ? "TX" : "RX",
+ pnext, SGCount, addr, pkt_len));
}
- }
-
- /* PIO mode */
- if (0 != lft_len) {
- /* Claim host controller */
- sdio_claim_host(gInstance->func[func]);
- for (pnext = pkt; pnext; pnext = PKTNEXT(sd->osh, pnext)) {
- uint8 *buf = (uint8*)PKTDATA(sd->osh, pnext) +
- xfred_len;
- pkt_len = PKTLEN(sd->osh, pnext);
- if (0 != xfred_len) {
- pkt_len -= xfred_len;
- xfred_len = 0;
- }
- pkt_len = (pkt_len + 3) & 0xFFFFFFFC;
-#ifdef CONFIG_MMC_MSM7X00A
- if ((pkt_len % 64) == 32) {
- sd_trace(("%s: Rounding up TX packet +=32\n", __FUNCTION__));
- pkt_len += 32;
- }
-#endif /* CONFIG_MMC_MSM7X00A */
- if ((write) && (!fifo))
- err_ret = sdio_memcpy_toio(
- gInstance->func[func],
- addr, buf, pkt_len);
- else if (write)
- err_ret = sdio_memcpy_toio(
- gInstance->func[func],
- addr, buf, pkt_len);
- else if (fifo)
- err_ret = sdio_readsb(
- gInstance->func[func],
- buf, addr, pkt_len);
- else
- err_ret = sdio_memcpy_fromio(
- gInstance->func[func],
- buf, addr, pkt_len);
-
- if (err_ret)
- sd_err(("%s: %s FAILED %p[%d], addr=0x%05x, pkt_len=%d, ERR=%d\n",
- __FUNCTION__,
- (write) ? "TX" : "RX",
- pnext, SGCount, addr, pkt_len, err_ret));
- else
- sd_trace(("%s: %s xfr'd %p[%d], addr=0x%05x, len=%d\n",
- __FUNCTION__,
- (write) ? "TX" : "RX",
- pnext, SGCount, addr, pkt_len));
-
- if (!fifo)
- addr += pkt_len;
- SGCount ++;
+ if (!fifo) {
+ addr += pkt_len;
}
- sdio_release_host(gInstance->func[func]);
+ SGCount ++;
+
}
+ /* Release host controller */
+ sdio_release_host(gInstance->func[func]);
+
sd_trace(("%s: Exit\n", __FUNCTION__));
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
}
diff --git a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c
index 9ef9cc04ace1..d50ce7ba4454 100755
--- a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c
+++ b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc_linux.c
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh_sdmmc_linux.c 331154 2012-05-04 00:41:40Z $
+ * $Id: bcmsdh_sdmmc_linux.c 310626 2012-01-25 05:47:55Z $
*/
#include <typedefs.h>
@@ -183,8 +183,6 @@ MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids);
static int bcmsdh_sdmmc_suspend(struct device *pdev)
{
struct sdio_func *func = dev_to_sdio_func(pdev);
- mmc_pm_flag_t sdio_flags;
- int ret;
if (func->num != 2)
return 0;
@@ -193,19 +191,6 @@ static int bcmsdh_sdmmc_suspend(struct device *pdev)
if (dhd_os_check_wakelock(bcmsdh_get_drvdata()))
return -EBUSY;
- sdio_flags = sdio_get_host_pm_caps(func);
-
- if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
- sd_err(("%s: can't keep power while host is suspended\n", __FUNCTION__));
- return -EINVAL;
- }
-
- /* keep power while host suspended */
- ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
- if (ret) {
- sd_err(("%s: error while trying to keep power\n", __FUNCTION__));
- return ret;
- }
#if defined(OOB_INTR_ONLY)
bcmsdh_oob_intr_set(0);
#endif /* defined(OOB_INTR_ONLY) */
@@ -217,9 +202,8 @@ static int bcmsdh_sdmmc_suspend(struct device *pdev)
static int bcmsdh_sdmmc_resume(struct device *pdev)
{
-#if defined(OOB_INTR_ONLY)
struct sdio_func *func = dev_to_sdio_func(pdev);
-#endif
+
sd_trace(("%s Enter\n", __FUNCTION__));
dhd_mmc_suspend = FALSE;
#if defined(OOB_INTR_ONLY)
diff --git a/drivers/net/wireless/bcmdhd/dhd.h b/drivers/net/wireless/bcmdhd/dhd.h
index fae6a9a7a6e5..4c931380c7fd 100755
--- a/drivers/net/wireless/bcmdhd/dhd.h
+++ b/drivers/net/wireless/bcmdhd/dhd.h
@@ -24,7 +24,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd.h 333052 2012-05-12 02:09:28Z $
+ * $Id: dhd.h 311717 2012-01-31 03:11:13Z $
*/
/****************
@@ -51,7 +51,6 @@
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
#include <linux/wakelock.h>
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
-
/* The kernel threading is sdio-specific */
struct task_struct;
struct sched_param;
@@ -78,14 +77,9 @@ enum dhd_bus_state {
/* Firmware requested operation mode */
#define STA_MASK 0x0001
-#define HOSTAPD_MASK 0x0002
+#define HOSTAPD_MASK 0x0002
#define WFD_MASK 0x0004
-#define SOFTAP_FW_MASK 0x0008
-#define P2P_GO_ENABLED 0x0010
-#define P2P_GC_ENABLED 0x0020
-#define CONCURENT_MASK 0x00F0
-
-#define MANUFACTRING_FW "WLTEST"
+#define SOFTAP_FW_MASK 0x0008
/* max sequential rxcntl timeouts to set HANG event */
#define MAX_CNTL_TIMEOUT 2
@@ -93,9 +87,6 @@ enum dhd_bus_state {
#define DHD_SCAN_ACTIVE_TIME 40 /* ms : Embedded default Active setting from DHD Driver */
#define DHD_SCAN_PASSIVE_TIME 130 /* ms: Embedded default Passive setting from DHD Driver */
-#define DHD_BEACON_TIMEOUT_NORMAL 4
-#define DHD_BEACON_TIMEOUT_HIGH 10
-
enum dhd_bus_wake_state {
WAKE_LOCK_OFF,
WAKE_LOCK_PRIV,
@@ -214,12 +205,9 @@ typedef struct dhd_pub {
int op_mode; /* STA, HostAPD, WFD, SoftAP */
-/* Set this to 1 to use a seperate interface (p2p0) for p2p operations.
- * For ICS MR1 releases it should be disable to be compatable with ICS MR1 Framework
- * see target dhd-cdc-sdmmc-panda-cfg80211-icsmr1-gpl-debug in Makefile
- */
-/* #define WL_ENABLE_P2P_IF 1 */
-
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
+ struct wake_lock wakelock[WAKE_LOCK_MAX];
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
struct mutex wl_start_stop_lock; /* lock/unlock for Android start/stop */
struct mutex wl_softap_lock; /* lock/unlock for any SoftAP/STA settings */
@@ -301,9 +289,26 @@ void dhd_os_spin_unlock(dhd_pub_t *pub, unsigned long flags);
extern int dhd_os_wake_lock(dhd_pub_t *pub);
extern int dhd_os_wake_unlock(dhd_pub_t *pub);
extern int dhd_os_wake_lock_timeout(dhd_pub_t *pub);
-extern int dhd_os_wake_lock_rx_timeout_enable(dhd_pub_t *pub, int val);
-extern int dhd_os_wake_lock_ctrl_timeout_enable(dhd_pub_t *pub, int val);
+extern int dhd_os_wake_lock_timeout_enable(dhd_pub_t *pub, int val);
+
+#ifdef WL_PROTECT
+typedef struct wlp_info {
+ long wlp_pid;
+ struct semaphore wlp_sem;
+ struct completion wlp_exited;
+} wlp_info_t;
+
+#define WIFI_FIRMWARE_RECOVER 0
+#define WIFI_FIRMWARE_ERROR 1
+
+extern void dhd_os_start_lock(dhd_pub_t *pub);
+extern void dhd_os_start_unlock(dhd_pub_t *pub);
+extern wlp_info_t *g_wl_protect;
+extern atomic_t g_fw_err_flag;
+extern atomic_t g_fw_reload_over_flag;
+
+#endif //WL_PROTECT
inline static void MUTEX_LOCK_SOFTAP_SET_INIT(dhd_pub_t * dhdp)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
@@ -328,8 +333,8 @@ inline static void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t * dhdp)
#define DHD_OS_WAKE_LOCK(pub) dhd_os_wake_lock(pub)
#define DHD_OS_WAKE_UNLOCK(pub) dhd_os_wake_unlock(pub)
#define DHD_OS_WAKE_LOCK_TIMEOUT(pub) dhd_os_wake_lock_timeout(pub)
-#define DHD_OS_WAKE_LOCK_RX_TIMEOUT_ENABLE(pub, val) dhd_os_wake_lock_rx_timeout_enable(pub, val)
-#define DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(pub, val) dhd_os_wake_lock_ctrl_timeout_enable(pub, val)
+#define DHD_OS_WAKE_LOCK_TIMEOUT_ENABLE(pub, val) dhd_os_wake_lock_timeout_enable(pub, val)
+
#define DHD_PACKET_TIMEOUT_MS 1000
#define DHD_EVENT_TIMEOUT_MS 1500
@@ -439,14 +444,10 @@ extern int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled);
extern int dhd_pno_clean(dhd_pub_t *dhd);
extern int dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t* ssids_local, int nssid,
ushort scan_fr, int pno_repeat, int pno_freq_expo_max);
-extern int dhd_pno_set_ex(dhd_pub_t *dhd, wl_pfn_t* ssidnet, int nssid,
- ushort pno_interval, int pno_repeat, int pno_expo_max, int pno_lost_time);
extern int dhd_pno_get_status(dhd_pub_t *dhd);
extern int dhd_dev_pno_reset(struct net_device *dev);
extern int dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t* ssids_local,
int nssid, ushort scan_fr, int pno_repeat, int pno_freq_expo_max);
-extern int dhd_dev_pno_set_ex(struct net_device *dev, wl_pfn_t* ssidnet, int nssid,
- ushort pno_interval, int pno_repeat, int pno_expo_max, int pno_lost_time);
extern int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled);
extern int dhd_dev_get_pno_status(struct net_device *dev);
#endif /* PNO_SUPPORT */
@@ -455,8 +456,6 @@ extern int dhd_dev_get_pno_status(struct net_device *dev);
#define DHD_BROADCAST_FILTER_NUM 1
#define DHD_MULTICAST4_FILTER_NUM 2
#define DHD_MULTICAST6_FILTER_NUM 3
-#define DHD_MDNS_FILTER_NUM 4
-extern int dhd_os_set_packet_filter(dhd_pub_t *dhdp, int val);
extern int net_os_set_packet_filter(struct net_device *dev, int val);
extern int net_os_rxfilter_add_remove(struct net_device *dev, int val, int num);
@@ -521,8 +520,7 @@ extern uint dhd_bus_status(dhd_pub_t *dhdp);
extern int dhd_bus_start(dhd_pub_t *dhdp);
extern int dhd_bus_membytes(dhd_pub_t *dhdp, bool set, uint32 address, uint8 *data, uint size);
extern void dhd_print_buf(void *pbuf, int len, int bytes_per_line);
-extern bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf, int *retval);
-extern uint dhd_bus_chip_id(dhd_pub_t *dhdp);
+extern bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf);
#if defined(KEEP_ALIVE)
extern int dhd_keep_alive_onoff(dhd_pub_t *dhd);
@@ -611,11 +609,6 @@ extern uint dhd_pktgen_len;
extern char fw_path[MOD_PARAM_PATHLEN];
extern char nv_path[MOD_PARAM_PATHLEN];
-#ifdef DHD_BCM_WIFI_HDMI
-#define MOD_PARAM_TYPELEN 64
-extern char wifi_type[MOD_PARAM_TYPELEN];
-#endif /* DHD_BCM_WIFI_HDMI */
-
#ifdef SOFTAP
extern char fw_path2[MOD_PARAM_PATHLEN];
#endif
@@ -763,15 +756,4 @@ int dhd_arp_get_arp_hostip_table(dhd_pub_t *dhd, void *buf, int buflen);
void dhd_arp_offload_add_ip(dhd_pub_t *dhd, uint32 ipaddr);
#endif /* ARP_OFFLOAD_SUPPORT */
-#ifdef DHD_BCM_WIFI_HDMI
-/* Wireless HDMI run-time enable flag */
-extern bool dhd_bcm_whdmi_enable;
-
-/* Network interface created for the Wireless HDMI soft AP */
-#define DHD_WHDMI_SOFTAP_IF_NAME "wl0.2"
-#define DHD_WHDMI_SOFTAP_IF_NAME_LEN 5
-#define DHD_WHDMI_SOFTAP_IF_NUM 2
-
-#endif /* DHD_BCM_WIFI_HDMI */
-
#endif /* _dhd_h_ */
diff --git a/drivers/net/wireless/bcmdhd/dhd_cdc.c b/drivers/net/wireless/bcmdhd/dhd_cdc.c
index de5238fe0fef..d01853c71a2e 100755
--- a/drivers/net/wireless/bcmdhd/dhd_cdc.c
+++ b/drivers/net/wireless/bcmdhd/dhd_cdc.c
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_cdc.c 324280 2012-03-28 19:01:17Z $
+ * $Id: dhd_cdc.c 303389 2011-12-16 09:30:48Z $
*
* BDC is like CDC, except it includes a header for data packets to convey
* packet priority over the bus, and flags (e.g. to indicate checksum status
@@ -285,25 +285,11 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len)
dhd_prot_t *prot = dhd->prot;
int ret = -1;
uint8 action;
-#if defined(BCMNDIS6)
- bool acquired = FALSE;
-#endif /* BCMNDIS6 */
+
if ((dhd->busstate == DHD_BUS_DOWN) || dhd->hang_was_sent) {
DHD_ERROR(("%s : bus is down. we have nothing to do\n", __FUNCTION__));
goto done;
}
-#if defined(BCMNDIS6)
- if (dhd_os_proto_block(dhd))
- {
- acquired = TRUE;
- }
- else
- {
- /* attempt to acquire protocol mutex timed out. */
- ret = -1;
- return ret;
- }
-#endif /* BCMNDIS6 */
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
@@ -354,10 +340,6 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len)
prot->pending = FALSE;
done:
-#if defined(BCMNDIS6)
- if (acquired)
- dhd_os_proto_unblock(dhd);
-#endif /* BCMNDIS6 */
return ret;
}
diff --git a/drivers/net/wireless/bcmdhd/dhd_cfg80211.c b/drivers/net/wireless/bcmdhd/dhd_cfg80211.c
index c5c7d24c096c..800590cca653 100755
--- a/drivers/net/wireless/bcmdhd/dhd_cfg80211.c
+++ b/drivers/net/wireless/bcmdhd/dhd_cfg80211.c
@@ -33,12 +33,6 @@
extern struct wl_priv *wlcfg_drv_priv;
static int dhd_dongle_up = FALSE;
-#include <dngl_stats.h>
-#include <dhd.h>
-#include <dhdioctl.h>
-#include <wlioctl.h>
-#include <dhd_cfg80211.h>
-
static s32 wl_dongle_up(struct net_device *ndev, u32 up);
/**
@@ -57,72 +51,12 @@ s32 dhd_cfg80211_deinit(struct wl_priv *wl)
return 0;
}
-s32 dhd_cfg80211_get_opmode(struct wl_priv *wl)
-{
- dhd_pub_t *dhd = (dhd_pub_t *)(wl->pub);
- return dhd->op_mode;
-}
-
s32 dhd_cfg80211_down(struct wl_priv *wl)
{
dhd_dongle_up = FALSE;
return 0;
}
-/*
- * dhd_cfg80211_set_p2p_info : gets called when GO or GC created
- */
-s32 dhd_cfg80211_set_p2p_info(struct wl_priv *wl, int val)
-{
- dhd_pub_t *dhd = (dhd_pub_t *)(wl->pub);
- int bcn_timeout = DHD_BEACON_TIMEOUT_HIGH;
- char iovbuf[30];
-
- dhd->op_mode |= val;
- WL_ERR(("Set : op_mode=%d\n", dhd->op_mode));
-
-#ifdef ARP_OFFLOAD_SUPPORT
- /* IF P2P is enabled, disable arpoe */
- dhd_arp_offload_set(dhd, 0);
- dhd_arp_offload_enable(dhd, false);
-#endif /* ARP_OFFLOAD_SUPPORT */
- /* diable all filtering in p2p mode */
- dhd_os_set_packet_filter(dhd, 0);
-
- /* Setup timeout if Beacons are lost and roam is off to report link down */
- bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
-
-
- return 0;
-}
-
-/*
- * dhd_cfg80211_clean_p2p_info : gets called when GO or GC terminated
- */
-s32 dhd_cfg80211_clean_p2p_info(struct wl_priv *wl)
-{
- dhd_pub_t *dhd = (dhd_pub_t *)(wl->pub);
- int bcn_timeout = DHD_BEACON_TIMEOUT_NORMAL;
- char iovbuf[30];
-
- dhd->op_mode &= ~CONCURENT_MASK;
- WL_ERR(("Clean : op_mode=%d\n", dhd->op_mode));
-
-#ifdef ARP_OFFLOAD_SUPPORT
- /* IF P2P is disabled, enable arpoe back for STA mode. */
- dhd_arp_offload_set(dhd, dhd_arp_mode);
- dhd_arp_offload_enable(dhd, true);
-#endif /* ARP_OFFLOAD_SUPPORT */
- dhd_os_set_packet_filter(dhd, 1);
-
- /* Setup timeout if Beacons are lost and roam is off to report link down */
- bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
-
- return 0;
-}
-
static s32 wl_dongle_up(struct net_device *ndev, u32 up)
{
s32 err = 0;
@@ -133,7 +67,6 @@ static s32 wl_dongle_up(struct net_device *ndev, u32 up)
}
return err;
}
-
s32 dhd_config_dongle(struct wl_priv *wl, bool need_lock)
{
#ifndef DHD_SDALIGN
@@ -534,6 +467,7 @@ void wl_cfg80211_btcoex_deinit(struct wl_priv *wl)
kfree(wl->btcoex_info);
wl->btcoex_info = NULL;
}
+#endif
int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, char *command)
{
@@ -657,4 +591,3 @@ int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, char *command)
return (strlen("OK"));
}
-#endif
diff --git a/drivers/net/wireless/bcmdhd/dhd_cfg80211.h b/drivers/net/wireless/bcmdhd/dhd_cfg80211.h
index ced46dbdb96c..8dab652c1a2c 100755
--- a/drivers/net/wireless/bcmdhd/dhd_cfg80211.h
+++ b/drivers/net/wireless/bcmdhd/dhd_cfg80211.h
@@ -33,10 +33,7 @@
s32 dhd_cfg80211_init(struct wl_priv *wl);
s32 dhd_cfg80211_deinit(struct wl_priv *wl);
-s32 dhd_cfg80211_get_opmode(struct wl_priv *wl);
s32 dhd_cfg80211_down(struct wl_priv *wl);
-s32 dhd_cfg80211_set_p2p_info(struct wl_priv *wl, int val);
-s32 dhd_cfg80211_clean_p2p_info(struct wl_priv *wl);
s32 dhd_config_dongle(struct wl_priv *wl, bool need_lock);
int wl_cfg80211_btcoex_init(struct wl_priv *wl);
diff --git a/drivers/net/wireless/bcmdhd/dhd_common.c b/drivers/net/wireless/bcmdhd/dhd_common.c
index 72966ae65367..5b999d59ad9b 100755
--- a/drivers/net/wireless/bcmdhd/dhd_common.c
+++ b/drivers/net/wireless/bcmdhd/dhd_common.c
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_common.c 331276 2012-05-04 08:05:57Z $
+ * $Id: dhd_common.c 307573 2012-01-12 00:04:39Z $
*/
#include <typedefs.h>
#include <osl.h>
@@ -306,6 +306,13 @@ dhd_wl_ioctl_cmd(dhd_pub_t *dhd_pub, int cmd, void *arg, int len, uint8 set, int
{
wl_ioctl_t ioc;
+#ifdef WL_PROTECT
+ if (WIFI_FIRMWARE_ERROR == atomic_read(&g_fw_err_flag))
+ {
+ return 0;
+ }
+#endif
+
ioc.cmd = cmd;
ioc.buf = arg;
ioc.len = len;
@@ -319,11 +326,17 @@ int
dhd_wl_ioctl(dhd_pub_t *dhd_pub, int ifindex, wl_ioctl_t *ioc, void *buf, int len)
{
int ret;
+#ifdef WL_PROTECT
+ if (WIFI_FIRMWARE_ERROR == atomic_read(&g_fw_err_flag))
+ {
+ return 0;
+ }
+#endif
dhd_os_proto_block(dhd_pub);
ret = dhd_prot_ioctl(dhd_pub, ifindex, ioc, buf, len);
- if (ret)
+ if (!ret)
dhd_os_check_hang(dhd_pub, ifindex, ret);
dhd_os_proto_unblock(dhd_pub);
@@ -973,6 +986,7 @@ wl_show_host_event(wl_event_msg_t *event, void *event_data)
break;
}
+#if 0
/* show any appended data */
if (datalen) {
buf = (uchar *) event_data;
@@ -981,6 +995,8 @@ wl_show_host_event(wl_event_msg_t *event, void *event_data)
DHD_EVENT((" 0x%02x ", *buf++));
DHD_EVENT(("\n"));
}
+#endif
+
}
#endif /* SHOW_EVENTS */
@@ -1019,9 +1035,6 @@ wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
datalen = ntoh32_ua((void *)&event->datalen);
evlen = datalen + sizeof(bcm_event_t);
- DHD_TRACE(("RX: event_type:%d flags:%d status:%d reason:%d \n",
- type, flags, status, reason));
-
switch (type) {
#ifdef PROP_TXSTATUS
case WLC_E_FIFO_CREDIT_MAP:
@@ -1749,12 +1762,11 @@ fail:
/*
* returns = TRUE if associated, FALSE if not associated
- * third paramter retval can return error from error
*/
-bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf, int *retval)
+bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf)
{
char bssid[6], zbuf[6];
- int ret;
+ int ret = -1;
bzero(bssid, 6);
bzero(zbuf, 6);
@@ -1762,9 +1774,6 @@ bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf, int *retval)
ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_BSSID, (char *)&bssid, ETHER_ADDR_LEN, FALSE, 0);
DHD_TRACE((" %s WLC_GET_BSSID ioctl res = %d\n", __FUNCTION__, ret));
- if (retval)
- *retval = ret;
-
if (ret == BCME_NOTASSOCIATED) {
DHD_TRACE(("%s: not associated! res:%d\n", __FUNCTION__, ret));
}
@@ -1786,6 +1795,7 @@ bool dhd_is_associated(dhd_pub_t *dhd, void *bss_buf, int *retval)
}
}
+
/* Function to estimate possible DTIM_SKIP value */
int
dhd_get_dtim_skip(dhd_pub_t *dhd)
@@ -1800,7 +1810,7 @@ dhd_get_dtim_skip(dhd_pub_t *dhd)
bcn_li_dtim = dhd->dtim_skip;
/* Check if associated */
- if (dhd_is_associated(dhd, NULL, NULL) == FALSE) {
+ if (dhd_is_associated(dhd, NULL) == FALSE) {
DHD_TRACE(("%s NOT assoc ret %d\n", __FUNCTION__, ret));
goto exit;
}
@@ -1843,24 +1853,10 @@ exit:
bool dhd_check_ap_wfd_mode_set(dhd_pub_t *dhd)
{
#ifdef WL_CFG80211
-#ifndef WL_ENABLE_P2P_IF
- /* To be back compatble with ICS MR1 release where p2p interface
- * disable but wlan0 used for p2p
- */
if (((dhd->op_mode & HOSTAPD_MASK) == HOSTAPD_MASK) ||
- ((dhd->op_mode & WFD_MASK) == WFD_MASK)) {
- return TRUE;
- }
- else
-#else
- /* concurent mode with p2p interface for wfd and wlan0 for sta */
- if (((dhd->op_mode & P2P_GO_ENABLED) == P2P_GO_ENABLED) ||
- ((dhd->op_mode & P2P_GC_ENABLED) == P2P_GC_ENABLED)) {
- DHD_ERROR(("%s P2P enabled for mode=%d\n", __FUNCTION__, dhd->op_mode));
+ ((dhd->op_mode & WFD_MASK) == WFD_MASK))
return TRUE;
- }
else
-#endif /* WL_ENABLE_P2P_IF */
#endif /* WL_CFG80211 */
return FALSE;
}
@@ -1907,18 +1903,15 @@ dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled)
return ret;
}
-
- memset(iovbuf, 0, sizeof(iovbuf));
-
-#ifndef WL_SCHED_SCAN
if (dhd_check_ap_wfd_mode_set(dhd) == TRUE)
return (ret);
- if ((pfn_enabled) && (dhd_is_associated(dhd, NULL, NULL) == TRUE)) {
+ memset(iovbuf, 0, sizeof(iovbuf));
+
+ if ((pfn_enabled) && (dhd_is_associated(dhd, NULL) == TRUE)) {
DHD_ERROR(("%s pno is NOT enable : called in assoc mode , ignore\n", __FUNCTION__));
return ret;
}
-#endif /* !WL_SCHED_SCAN */
/* Enable/disable PNO */
if ((ret = bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf, sizeof(iovbuf))) > 0) {
@@ -1957,10 +1950,9 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t* ssids_local, int nssid, ushort scan_fr,
err = -1;
return err;
}
-#ifndef WL_SCHED_SCAN
+
if (dhd_check_ap_wfd_mode_set(dhd) == TRUE)
return (err);
-#endif /* !WL_SCHED_SCAN */
/* Check for broadcast ssid */
for (k = 0; k < nssid; k++) {
@@ -2054,123 +2046,6 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t* ssids_local, int nssid, ushort scan_fr,
}
int
-dhd_pno_set_ex(dhd_pub_t *dhd, wl_pfn_t* ssidnet, int nssid, ushort pno_interval,
- int pno_repeat, int pno_expo_max, int pno_lost_time)
-{
- int err = -1;
- char iovbuf[128];
- int k, i;
- wl_pfn_param_t pfn_param;
- wl_pfn_t pfn_element;
- uint len = 0;
-
- DHD_TRACE(("%s nssid=%d pno_interval=%d\n", __FUNCTION__, nssid, pno_interval));
-
- if ((!dhd) && (!ssidnet)) {
- DHD_ERROR(("%s error exit\n", __FUNCTION__));
- err = -1;
- return err;
- }
-
- if (dhd_check_ap_wfd_mode_set(dhd) == TRUE)
- return (err);
-
- /* Check for broadcast ssid */
- for (k = 0; k < nssid; k++) {
- if (!ssidnet[k].ssid.SSID_len) {
- DHD_ERROR(("%d: Broadcast SSID is ilegal for PNO setting\n", k));
- return err;
- }
- }
-/* #define PNO_DUMP 1 */
-#ifdef PNO_DUMP
- {
- int j;
- for (j = 0; j < nssid; j++) {
- DHD_ERROR(("%d: scan for %s size =%d\n", j,
- ssidnet[j].ssid.SSID, ssidnet[j].ssid.SSID_len));
- }
- }
-#endif /* PNO_DUMP */
-
- /* clean up everything */
- if ((err = dhd_pno_clean(dhd)) < 0) {
- DHD_ERROR(("%s failed error=%d\n", __FUNCTION__, err));
- return err;
- }
- memset(iovbuf, 0, sizeof(iovbuf));
- memset(&pfn_param, 0, sizeof(pfn_param));
- memset(&pfn_element, 0, sizeof(pfn_element));
-
- /* set pfn parameters */
- pfn_param.version = htod32(PFN_VERSION);
- pfn_param.flags = htod16((PFN_LIST_ORDER << SORT_CRITERIA_BIT));
-
- /* check and set extra pno params */
- if ((pno_repeat != 0) || (pno_expo_max != 0)) {
- pfn_param.flags |= htod16(ENABLE << ENABLE_ADAPTSCAN_BIT);
- pfn_param.repeat = (uchar) (pno_repeat);
- pfn_param.exp = (uchar) (pno_expo_max);
- }
-
- /* set up pno scan fr */
- if (pno_interval != 0)
- pfn_param.scan_freq = htod32(pno_interval);
-
- if (pfn_param.scan_freq > PNO_SCAN_MAX_FW_SEC) {
- DHD_ERROR(("%s pno freq above %d sec\n", __FUNCTION__, PNO_SCAN_MAX_FW_SEC));
- return err;
- }
- if (pfn_param.scan_freq < PNO_SCAN_MIN_FW_SEC) {
- DHD_ERROR(("%s pno freq less %d sec\n", __FUNCTION__, PNO_SCAN_MIN_FW_SEC));
- return err;
- }
-
- /* network lost time */
- pfn_param.lost_network_timeout = htod32(pno_lost_time);
-
- len = bcm_mkiovar("pfn_set", (char *)&pfn_param, sizeof(pfn_param), iovbuf, sizeof(iovbuf));
- if ((err = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, len, TRUE, 0)) < 0) {
- DHD_ERROR(("%s pfn_set failed for error=%d\n",
- __FUNCTION__, err));
- return err;
- } else {
- DHD_TRACE(("%s pfn_set OK with PNO time=%d repeat=%d max_adjust=%d\n",
- __FUNCTION__, pfn_param.scan_freq,
- pfn_param.repeat, pfn_param.exp));
- }
-
- /* set all pfn ssid */
- for (i = 0; i < nssid; i++) {
- pfn_element.flags = htod32(ssidnet[i].flags);
- pfn_element.infra = htod32(ssidnet[i].infra);
- pfn_element.auth = htod32(ssidnet[i].auth);
- pfn_element.wpa_auth = htod32(ssidnet[i].wpa_auth);
- pfn_element.wsec = htod32(ssidnet[i].wsec);
-
- memcpy((char *)pfn_element.ssid.SSID, ssidnet[i].ssid.SSID, ssidnet[i].ssid.SSID_len);
- pfn_element.ssid.SSID_len = htod32(ssidnet[i].ssid.SSID_len);
-
- if ((len =
- bcm_mkiovar("pfn_add", (char *)&pfn_element,
- sizeof(pfn_element), iovbuf, sizeof(iovbuf))) > 0) {
- if ((err =
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, len, TRUE, 0)) < 0) {
- DHD_ERROR(("%s pfn_add failed with ssidnet[%d] error=%d\n",
- __FUNCTION__, i, err));
- return err;
- } else {
- DHD_TRACE(("%s pfn_add OK with ssidnet[%d]\n", __FUNCTION__, i));
- }
- } else {
- DHD_ERROR(("%s bcm_mkiovar failed with ssidnet[%d]\n", __FUNCTION__, i));
- }
- }
-
- return err;
-}
-
-int
dhd_pno_get_status(dhd_pub_t *dhd)
{
int ret = -1;
@@ -2223,7 +2098,6 @@ int dhd_keep_alive_onoff(dhd_pub_t *dhd)
return res;
}
#endif /* defined(KEEP_ALIVE) */
-
/* Android ComboSCAN support */
/*
diff --git a/drivers/net/wireless/bcmdhd/dhd_custom_gpio.c b/drivers/net/wireless/bcmdhd/dhd_custom_gpio.c
index 6b298d1b1c99..ad0f5b9ad82f 100755
--- a/drivers/net/wireless/bcmdhd/dhd_custom_gpio.c
+++ b/drivers/net/wireless/bcmdhd/dhd_custom_gpio.c
@@ -20,7 +20,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
-* $Id: dhd_custom_gpio.c 339054 2012-06-15 04:56:55Z $
+* $Id: dhd_custom_gpio.c 280266 2011-08-28 04:18:20Z $
*/
#include <typedefs.h>
@@ -102,7 +102,7 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
if (dhd_oob_gpio_num < 0) {
dhd_oob_gpio_num = CUSTOM_OOB_GPIO_NUM;
}
-#endif /* CUSTOM_OOB_GPIO_NUM */
+#endif /* CUSTOMER_HW2 */
if (dhd_oob_gpio_num < 0) {
WL_ERROR(("%s: ERROR customer specific Host GPIO is NOT defined \n",
@@ -111,7 +111,7 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
}
WL_ERROR(("%s: customer specific Host GPIO number is (%d)\n",
- __FUNCTION__, dhd_oob_gpio_num));
+ __FUNCTION__, dhd_oob_gpio_num));
#if defined CUSTOMER_HW
host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num);
diff --git a/drivers/net/wireless/bcmdhd/dhd_dbg.h b/drivers/net/wireless/bcmdhd/dhd_dbg.h
index bd1683f8e197..a35d76797b85 100755
--- a/drivers/net/wireless/bcmdhd/dhd_dbg.h
+++ b/drivers/net/wireless/bcmdhd/dhd_dbg.h
@@ -29,8 +29,7 @@
#if defined(DHD_DEBUG)
-#define DHD_ERROR(args) do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
- printf args;} while (0)
+#define DHD_ERROR(args) do {if (dhd_msg_level & DHD_ERROR_VAL) printf args;} while (0)
#define DHD_TRACE(args) do {if (dhd_msg_level & DHD_TRACE_VAL) printf args;} while (0)
#define DHD_INFO(args) do {if (dhd_msg_level & DHD_INFO_VAL) printf args;} while (0)
#define DHD_DATA(args) do {if (dhd_msg_level & DHD_DATA_VAL) printf args;} while (0)
@@ -63,8 +62,8 @@
#else /* defined(BCMDBG) || defined(DHD_DEBUG) */
#define DHD_ERROR(args) do {if (net_ratelimit()) printf args;} while (0)
-#define DHD_TRACE(args)
-#define DHD_INFO(args)
+#define DHD_TRACE(args) //printk args
+#define DHD_INFO(args) //printk args
#define DHD_DATA(args)
#define DHD_CTL(args)
#define DHD_TIMER(args)
@@ -72,7 +71,7 @@
#define DHD_BYTES(args)
#define DHD_INTR(args)
#define DHD_GLOM(args)
-#define DHD_EVENT(args)
+#define DHD_EVENT(args) //printk args
#define DHD_BTA(args)
#define DHD_ISCAN(args)
#define DHD_ARPOE(args)
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c
index 5ae73344d6df..af20da34bc01 100755
--- a/drivers/net/wireless/bcmdhd/dhd_linux.c
+++ b/drivers/net/wireless/bcmdhd/dhd_linux.c
@@ -22,7 +22,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_linux.c 338147 2012-06-11 20:33:36Z $
+ * $Id: dhd_linux.c 311494 2012-01-30 13:19:04Z $
*/
#include <typedefs.h>
@@ -49,7 +49,6 @@
#include <epivers.h>
#include <bcmutils.h>
#include <bcmendian.h>
-#include <bcmdevs.h>
#include <proto/ethernet.h>
#include <dngl_stats.h>
@@ -70,6 +69,8 @@
//#define FW_PATH_AUTO_SELECT 1
+#define wchg_trace //printk("%s_%d\n", __func__, __LINE__);
+
#ifdef FW_PATH_AUTO_SELECT
extern void dhd_bus_select_firmware_name_by_chip(struct dhd_bus *bus, char *dst, char *src);
#define COPY_FW_PATH_BY_CHIP( bus, dst, src) dhd_bus_select_firmware_name_by_chip( bus, dst, src);
@@ -138,9 +139,6 @@ DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
#if defined(OOB_INTR_ONLY)
extern void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable);
#endif /* defined(OOB_INTR_ONLY) */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
-static void dhd_hang_process(struct work_struct *work);
-#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0))
MODULE_LICENSE("GPL v2");
#endif /* LinuxVer */
@@ -162,15 +160,16 @@ print_tainted()
#endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 15) */
/* Linux wireless extension support */
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
#include <wl_iw.h>
extern wl_iw_extra_params_t g_wl_iw_params;
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
-#if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
+#if defined(CONFIG_HAS_EARLYSUSPEND)
#include <linux/earlysuspend.h>
-#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
+extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len);
extern int dhd_get_dtim_skip(dhd_pub_t *dhd);
+#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
#ifdef PKT_FILTER_SUPPORT
extern void dhd_pktfilter_offload_set(dhd_pub_t * dhd, char *arg);
@@ -224,9 +223,9 @@ static uint32 maxdelay = 0, tspktcnt = 0, maxdelaypktno = 0;
/* Local private structure (extension of pub) */
typedef struct dhd_info {
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
wl_iw_t iw; /* wireless extensions state (must be first) */
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
dhd_pub_t pub;
@@ -260,28 +259,26 @@ typedef struct dhd_info {
#endif /* DHDTHREAD */
tsk_ctl_t thr_sysioc_ctl;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
- struct work_struct work_hang;
-#endif
-
/* Wakelocks */
#if defined(CONFIG_HAS_WAKELOCK) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
struct wake_lock wl_wifi; /* Wifi wakelock */
struct wake_lock wl_rxwake; /* Wifi rx wakelock */
- struct wake_lock wl_ctrlwake; /* Wifi ctrl wakelock */
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && (1 || 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
/* net_device interface lock, prevent race conditions among net_dev interface
* calls and wifi_on or wifi_off
*/
struct mutex dhd_net_if_mutex;
- struct mutex dhd_suspend_mutex;
-#endif
+#endif
+#ifdef WL_PROTECT
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
+ struct mutex wl_start_lock;
+#endif
+#endif
spinlock_t wakelock_spinlock;
int wakelock_counter;
- int wakelock_rx_timeout_enable;
- int wakelock_ctrl_timeout_enable;
+ int wakelock_timeout_enable;
/* Thread to issue ioctl for multicast */
bool set_macaddress;
@@ -290,7 +287,7 @@ typedef struct dhd_info {
atomic_t pend_8021x_cnt;
dhd_attach_states_t dhd_state;
-#if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
+#ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend;
#endif /* CONFIG_HAS_EARLYSUSPEND */
@@ -325,15 +322,6 @@ module_param(dhd_msg_level, int, 0);
module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0660);
module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
-#ifdef DHD_BCM_WIFI_HDMI
-/* insmod module parameter "wifi_type" */
-char wifi_type[MOD_PARAM_TYPELEN];
-module_param_string(wifi_type, wifi_type, MOD_PARAM_TYPELEN, 0);
-
-/* Wireless HDMI enable flag */
-bool dhd_bcm_whdmi_enable = FALSE;
-#endif /* DHD_BCM_WIFI_HDMI */
-
/* Watchdog interval */
uint dhd_watchdog_ms = 10;
module_param(dhd_watchdog_ms, uint, 0);
@@ -362,7 +350,7 @@ module_param(dhd_pkt_filter_init, uint, 0);
/* Pkt filter mode control */
uint dhd_master_mode = TRUE;
-module_param(dhd_master_mode, uint, 0);
+module_param(dhd_master_mode, uint, 1);
#ifdef DHDTHREAD
/* Watchdog thread priority, -1 to use kernel timer */
@@ -452,13 +440,10 @@ static char dhd_version[] = "Dongle Host Driver, version " EPI_VERSION_STR
;
static void dhd_net_if_lock_local(dhd_info_t *dhd);
static void dhd_net_if_unlock_local(dhd_info_t *dhd);
-static void dhd_suspend_lock(dhd_pub_t *dhdp);
-static void dhd_suspend_unlock(dhd_pub_t *dhdp);
-#if !defined(AP) && defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+#if !defined(AP) && defined(WLP2P)
static u32 dhd_concurrent_fw(dhd_pub_t *dhd);
#endif
-
#ifdef WLMEDIA_HTSF
void htsf_update(dhd_info_t *dhd, void *data);
tsf_t prev_tsf, cur_tsf;
@@ -476,9 +461,9 @@ int dhd_monitor_init(void *dhd_pub);
int dhd_monitor_uninit(void);
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
struct iw_statistics *dhd_get_wireless_stats(struct net_device *dev);
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
static void dhd_dpc(ulong data);
/* forward decl */
@@ -505,19 +490,13 @@ static int dhd_sleep_pm_callback(struct notifier_block *nfb, unsigned long actio
switch (action) {
case PM_HIBERNATION_PREPARE:
case PM_SUSPEND_PREPARE:
- /* Note: When Linux is suspended, the kernel calls this
- * callback with PM_SUSPEND_PREPARE *before* userland
- * processes are frozen. *After* userland processes
- * are frozen, the kernel calls the DHD driver .suspend
- * routine wifi_suspend().
- */
dhd_mmc_suspend = TRUE;
- ret = NOTIFY_OK;
+ ret = NOTIFY_OK;
break;
case PM_POST_HIBERNATION:
case PM_POST_SUSPEND:
dhd_mmc_suspend = FALSE;
- ret = NOTIFY_OK;
+ ret = NOTIFY_OK;
break;
}
smp_mb();
@@ -527,7 +506,7 @@ static int dhd_sleep_pm_callback(struct notifier_block *nfb, unsigned long actio
static struct notifier_block dhd_sleep_pm_notifier = {
.notifier_call = dhd_sleep_pm_callback,
- .priority = 10
+ .priority = 0
};
extern int register_pm_notifier(struct notifier_block *nb);
extern int unregister_pm_notifier(struct notifier_block *nb);
@@ -539,8 +518,7 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
DHD_TRACE(("%s: %d\n", __FUNCTION__, value));
/* 1 - Enable packet filter, only allow unicast packet to send up */
/* 0 - Disable packet filter */
- if (dhd_pkt_filter_enable && (!value ||
- (dhd_check_ap_wfd_mode_set(dhd) == FALSE))) {
+ if (dhd_pkt_filter_enable) {
int i;
for (i = 0; i < dhd->pktfilter_count; i++) {
@@ -552,6 +530,7 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
#endif
}
+#if defined(CONFIG_HAS_EARLYSUSPEND)
static int dhd_set_suspend(int value, dhd_pub_t *dhd)
{
int power_mode = PM_MAX;
@@ -560,10 +539,11 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
int bcn_li_dtim = 3;
uint roamvar = 1;
+ wchg_trace
+
DHD_TRACE(("%s: enter, value = %d in_suspend=%d\n",
__FUNCTION__, value, dhd->in_suspend));
- dhd_suspend_lock(dhd);
if (dhd && dhd->up) {
if (value && dhd->in_suspend) {
@@ -612,35 +592,35 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
}
}
- dhd_suspend_unlock(dhd);
+
return 0;
}
-static int dhd_suspend_resume_helper(struct dhd_info *dhd, int val, int force)
+static void dhd_suspend_resume_helper(struct dhd_info *dhd, int val)
{
dhd_pub_t *dhdp = &dhd->pub;
- int ret = 0;
+
+ wchg_trace
+
DHD_OS_WAKE_LOCK(dhdp);
/* Set flag when early suspend was called */
dhdp->in_suspend = val;
- if ((force || !dhdp->suspend_disable_flag) &&
- (dhd_check_ap_wfd_mode_set(dhdp) == FALSE)) {
- ret = dhd_set_suspend(val, dhdp);
- }
+ if ((!dhdp->suspend_disable_flag) && (dhd_check_ap_wfd_mode_set(dhdp) == FALSE))
+ dhd_set_suspend(val, dhdp);
DHD_OS_WAKE_UNLOCK(dhdp);
- return ret;
}
-#if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
static void dhd_early_suspend(struct early_suspend *h)
{
struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
DHD_TRACE(("%s: enter\n", __FUNCTION__));
+ wchg_trace
+
if (dhd)
- dhd_suspend_resume_helper(dhd, 1, 0);
+ dhd_suspend_resume_helper(dhd, 1);
}
static void dhd_late_resume(struct early_suspend *h)
@@ -648,9 +628,10 @@ static void dhd_late_resume(struct early_suspend *h)
struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
DHD_TRACE(("%s: enter\n", __FUNCTION__));
+ wchg_trace
if (dhd)
- dhd_suspend_resume_helper(dhd, 0, 0);
+ dhd_suspend_resume_helper(dhd, 0);
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
@@ -1051,19 +1032,12 @@ dhd_op_if(dhd_if_t *ifp)
DHD_TRACE(("\n%s: got 'DHD_IF_DEL' state\n", __FUNCTION__));
#ifdef WL_CFG80211
if (dhd->dhd_state & DHD_ATTACH_STATE_CFG80211) {
- wl_cfg80211_ifdel_ops(ifp->net);
+ wl_cfg80211_notify_ifdel(ifp->net);
}
#endif
- msleep(300);
netif_stop_queue(ifp->net);
unregister_netdev(ifp->net);
ret = DHD_DEL_IF; /* Make sure the free_netdev() is called */
-
-#ifdef WL_CFG80211
- if (dhd->dhd_state & DHD_ATTACH_STATE_CFG80211) {
- wl_cfg80211_notify_ifdel();
- }
-#endif
}
break;
case DHD_IF_DELETING:
@@ -1329,13 +1303,11 @@ dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
DHD_ERROR(("%s: xmit rejected pub.up=%d busstate=%d \n",
__FUNCTION__, dhd->pub.up, dhd->pub.busstate));
netif_stop_queue(net);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
/* Send Event when bus down detected during data session */
if (dhd->pub.busstate == DHD_BUS_DOWN) {
DHD_ERROR(("%s: Event HANG sent up\n", __FUNCTION__));
net_os_send_hang_message(net);
}
-#endif
DHD_OS_WAKE_UNLOCK(&dhd->pub);
return -ENODEV;
}
@@ -1449,9 +1421,10 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
int i;
dhd_if_t *ifp;
wl_event_msg_t event;
- int tout_rx = 0;
- int tout_ctrl = 0;
+ int tout = DHD_PACKET_TIMEOUT_MS;
+
+ (void)tout;
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
save_pktbuf = pktbuf;
@@ -1501,7 +1474,6 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
*/
((athost_wl_status_info_t*)dhdp->wlfc_state)->stats.wlfc_header_only_pkt++;
PKTFREE(dhdp->osh, pktbuf, TRUE);
- DHD_TRACE(("RX: wlfc header \n"));
continue;
}
#endif
@@ -1535,9 +1507,6 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
skb->data = eth;
skb->len = len;
- DHD_TRACE(("RX: pkt_type:0x%x proto:0x%x len:%d \n",
- skb->pkt_type, skb->protocol, len));
-
#ifdef WLMEDIA_HTSF
dhd_htsf_addrxts(dhdp, pktbuf);
#endif
@@ -1556,18 +1525,12 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
&data);
wl_event_to_host_order(&event);
- if (!tout_ctrl)
- tout_ctrl = DHD_PACKET_TIMEOUT_MS;
+ tout = DHD_EVENT_TIMEOUT_MS;
if (event.event_type == WLC_E_BTA_HCI_EVENT) {
dhd_bta_doevt(dhdp, data, event.datalen);
+ } else if (event.event_type == WLC_E_PFN_NET_FOUND) {
+ tout *= 2;
}
-#ifdef PNO_SUPPORT
- if (event.event_type == WLC_E_PFN_NET_FOUND) {
- tout_ctrl *= 2;
- }
-#endif /* PNO_SUPPORT */
- } else {
- tout_rx = DHD_PACKET_TIMEOUT_MS;
}
ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]);
@@ -1600,9 +1563,7 @@ dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, void *pktbuf, int numpkt, uint8 chan)
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) */
}
}
-
- DHD_OS_WAKE_LOCK_RX_TIMEOUT_ENABLE(dhdp, tout_rx);
- DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(dhdp, tout_ctrl);
+ DHD_OS_WAKE_LOCK_TIMEOUT_ENABLE(dhdp, tout);
}
void
@@ -1758,6 +1719,7 @@ static void dhd_watchdog(ulong data)
#endif /* DHDTHREAD */
dhd_os_sdlock(&dhd->pub);
+
/* Call the bus module watchdog */
dhd_bus_watchdog(&dhd->pub);
@@ -2070,7 +2032,6 @@ dhd_ethtool(dhd_info_t *dhd, void *uaddr)
static bool dhd_check_hang(struct net_device *net, dhd_pub_t *dhdp, int error)
{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
if (!dhdp)
return FALSE;
if ((error == -ETIMEDOUT) || ((dhdp->busstate == DHD_BUS_DOWN) &&
@@ -2080,7 +2041,6 @@ static bool dhd_check_hang(struct net_device *net, dhd_pub_t *dhdp, int error)
net_os_send_hang_message(net);
return TRUE;
}
-#endif
return FALSE;
}
static int
@@ -2095,17 +2055,12 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
int ifidx;
int ret;
- if ( !dhd->pub.up || (dhd->pub.busstate == DHD_BUS_DOWN)){
- printf("%s: dhd is down. skip it.\n", __func__);
- return -ENODEV;
- }
-
DHD_OS_WAKE_LOCK(&dhd->pub);
/* send to dongle only if we are not waiting for reload already */
if (dhd->pub.hang_was_sent) {
DHD_ERROR(("%s: HANG was sent up earlier\n", __FUNCTION__));
- DHD_OS_WAKE_LOCK_CTRL_TIMEOUT_ENABLE(&dhd->pub, DHD_EVENT_TIMEOUT_MS);
+ DHD_OS_WAKE_LOCK_TIMEOUT_ENABLE(&dhd->pub, DHD_EVENT_TIMEOUT_MS);
DHD_OS_WAKE_UNLOCK(&dhd->pub);
return OSL_ERROR(BCME_DONGLE_DOWN);
}
@@ -2119,7 +2074,7 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
return -1;
}
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
/* linux wireless extensions */
if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
/* may recurse, do NOT lock */
@@ -2127,7 +2082,7 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
DHD_OS_WAKE_UNLOCK(&dhd->pub);
return ret;
}
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 4, 2)
if (cmd == SIOCETHTOOL) {
@@ -2337,7 +2292,7 @@ dhd_cleanup_virt_ifaces(dhd_info_t *dhd)
static int
dhd_stop(struct net_device *net)
{
- int ifidx = 0;
+ int ifidx;
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(net);
DHD_OS_WAKE_LOCK(&dhd->pub);
DHD_TRACE(("%s: Enter %p\n", __FUNCTION__, net));
@@ -2371,15 +2326,14 @@ dhd_stop(struct net_device *net)
/* Stop the protocol module */
dhd_prot_stop(&dhd->pub);
- OLD_MOD_DEC_USE_COUNT;
-exit:
-
#if defined(WL_CFG80211)
if (ifidx == 0 && !dhd_download_fw_on_driverload)
wl_android_wifi_off(net);
#endif
dhd->pub.rxcnt_timeout = 0;
dhd->pub.txcnt_timeout = 0;
+ OLD_MOD_DEC_USE_COUNT;
+exit:
DHD_OS_WAKE_UNLOCK(&dhd->pub);
return 0;
}
@@ -2410,12 +2364,7 @@ dhd_open(struct net_device *net)
* We keep WEXT's wl_control_wl_start to provide backward compatibility
* This should be removed in the future
*/
- ret = wl_control_wl_start(net);
- if (ret != 0) {
- DHD_ERROR(("%s: failed with code %d\n", __FUNCTION__, ret));
- ret = -1;
- goto exit;
- }
+ wl_control_wl_start(net);
#endif
ifidx = dhd_net2idx(dhd, net);
@@ -2440,8 +2389,7 @@ dhd_open(struct net_device *net)
if (!dhd_download_fw_on_driverload) {
ret = wl_android_wifi_on(net);
if (ret != 0) {
- DHD_ERROR(("%s: failed with code %d\n", __FUNCTION__, ret));
- ret = -1;
+ DHD_ERROR(("wl_android_wifi_on failed (%d)\n", ret));
goto exit;
}
}
@@ -2488,8 +2436,6 @@ dhd_open(struct net_device *net)
OLD_MOD_INC_USE_COUNT;
exit:
- if (ret)
- dhd_stop(net);
DHD_OS_WAKE_UNLOCK(&dhd->pub);
return ret;
}
@@ -2713,16 +2659,19 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
/* Initialize Wakelock stuff */
spin_lock_init(&dhd->wakelock_spinlock);
dhd->wakelock_counter = 0;
- dhd->wakelock_rx_timeout_enable = 0;
- dhd->wakelock_ctrl_timeout_enable = 0;
+ dhd->wakelock_timeout_enable = 0;
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_init(&dhd->wl_wifi, WAKE_LOCK_SUSPEND, "wlan_wake");
wake_lock_init(&dhd->wl_rxwake, WAKE_LOCK_SUSPEND, "wlan_rx_wake");
- wake_lock_init(&dhd->wl_ctrlwake, WAKE_LOCK_SUSPEND, "wlan_ctrl_wake");
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && (1 || 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_init(&dhd->dhd_net_if_mutex);
- mutex_init(&dhd->dhd_suspend_mutex);
+#endif
+
+#ifdef WL_PROTECT
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
+ mutex_init(&dhd->wl_start_lock);
+#endif
#endif
dhd_state |= DHD_ATTACH_STATE_WAKELOCKS_INIT;
@@ -2743,16 +2692,16 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
dhd_monitor_init(&dhd->pub);
dhd_state |= DHD_ATTACH_STATE_CFG80211;
#endif
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
/* Attach and link in the iw */
- if (!(dhd_state & DHD_ATTACH_STATE_CFG80211)) {
+// if (!(dhd_state & DHD_ATTACH_STATE_CFG80211)) {
if (wl_iw_attach(net, (void *)&dhd->pub) != 0) {
DHD_ERROR(("wl_iw_attach failed\n"));
goto fail;
}
dhd_state |= DHD_ATTACH_STATE_WL_ATTACH;
- }
-#endif /* defined(WL_WIRELESS_EXT) */
+// }
+#endif /* defined(CONFIG_WIRELESS_EXT) */
/* Set up the watchdog timer */
@@ -2798,9 +2747,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
dhd->thr_sysioc_ctl.thr_pid = -1;
}
dhd_state |= DHD_ATTACH_STATE_THREADS_CREATED;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
- INIT_WORK(&dhd->work_hang, dhd_hang_process);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
+
/*
* Save the dhd_info into the priv
*/
@@ -2810,7 +2757,7 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
register_pm_notifier(&dhd_sleep_pm_notifier);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */
-#if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
+#ifdef CONFIG_HAS_EARLYSUSPEND
dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
dhd->early_suspend.suspend = dhd_early_suspend;
dhd->early_suspend.resume = dhd_late_resume;
@@ -2857,14 +2804,14 @@ dhd_bus_start(dhd_pub_t *dhdp)
dhd_os_sdlock(dhdp);
#endif /* DHDTHREAD */
- DHD_ERROR(("%s: dhdsdio_probe_download failed. firmware = %s nvram = %s\n",
- __FUNCTION__, fw_path, nv_path));
/* try to download image and nvram to the dongle */
if ((dhd->pub.busstate == DHD_BUS_DOWN) &&
(fw_path != NULL) && (fw_path[0] != '\0') &&
(nv_path != NULL) && (nv_path[0] != '\0')) {
/* wake lock moved to dhdsdio_download_firmware */
+ DHD_ERROR(("%s: lmsg : firmware = %s nvram = %s\n",
+ __FUNCTION__, fw_path, nv_path));
if (!(dhd_bus_download_firmware(dhd->pub.bus, dhd->pub.osh,
fw_path, nv_path))) {
DHD_ERROR(("%s: dhdsdio_probe_download failed. firmware = %s nvram = %s\n",
@@ -2963,7 +2910,7 @@ dhd_bus_start(dhd_pub_t *dhdp)
return 0;
}
-#if !defined(AP) && defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+#if !defined(AP) && defined(WLP2P)
/* For Android ICS MR2 release, the concurrent mode is enabled by default and the firmware
* name would be fw_bcmdhd.bin. So we need to determine whether P2P is enabled in the STA
* firmware and accordingly enable concurrent mode (Apply P2P settings). SoftAP firmware
@@ -2984,20 +2931,15 @@ dhd_concurrent_fw(dhd_pub_t *dhd)
bcm_mkiovar("p2p", 0, 0, buf, sizeof(buf));
if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, buf, sizeof(buf),
FALSE, 0)) < 0) {
- DHD_ERROR(("%s: Get P2P failed (error=%d)\n", __FUNCTION__, ret));
+ DHD_TRACE(("%s: Get P2P failed (error=%d)\n", __FUNCTION__, ret));
} else if (buf[0] == 1) {
DHD_TRACE(("%s: P2P is supported\n", __FUNCTION__));
return 1;
}
}
- return ret;
+ return 0;
}
#endif
-
-/*
- * dhd_preinit_ioctls makes special pre-setting in the firmware before radio turns on
- * returns : 0 if all settings passed or negative value if anything failed
-*/
int
dhd_preinit_ioctls(dhd_pub_t *dhd)
{
@@ -3005,43 +2947,38 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
char eventmask[WL_EVENTING_MASK_LEN];
char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" + '\0' + bitvec */
-#if !defined(WL_CFG80211)
uint up = 0;
-#endif /* defined(WL_CFG80211) */
uint power_mode = PM_FAST;
uint32 dongle_align = DHD_SDALIGN;
uint32 glom = 0;
- uint bcn_timeout = DHD_BEACON_TIMEOUT_NORMAL;
-
+ uint bcn_timeout = 4;
uint retry_max = 10;
#if defined(ARP_OFFLOAD_SUPPORT)
int arpoe = 1;
#endif
-#if defined(KEEP_ALIVE)
- int res;
-#endif /* defined(KEEP_ALIVE) */
int scan_assoc_time = DHD_SCAN_ACTIVE_TIME;
int scan_unassoc_time = 40;
int scan_passive_time = DHD_SCAN_PASSIVE_TIME;
char buf[WLC_IOCTL_SMLEN];
+#ifdef WL_PROTECT
+ int infra = 1;
+#endif
char *ptr;
uint32 listen_interval = LISTEN_INTERVAL; /* Default Listen Interval in Beacons */
- uint16 chipID;
-
#if defined(SOFTAP)
uint dtim = 1;
#endif
-#if (defined(AP) && !defined(WLP2P)) || (!defined(AP) && defined(WL_CFG80211)) || \
- defined(DHD_BCM_WIFI_HDMI)
+#if (defined(AP) && !defined(WLP2P)) || (!defined(AP) && defined(WL_CFG80211))
uint32 mpc = 0; /* Turn MPC off for AP/APSTA mode */
#endif
-#if defined(AP) || defined(WLP2P) || defined(DHD_BCM_WIFI_HDMI)
- uint32 apsta = 1; /* Enable APSTA mode */
-#endif /* defined(AP) || defined(WLP2P) || defined(DHD_BCM_WIFI_HDMI) */
+#if defined(AP) || defined(WLP2P)
+ uint32 apsta = 1; /* Enable APSTA mode */
+#endif /* defined(AP) || defined(WLP2P) */
#ifdef GET_CUSTOM_MAC_ENABLE
struct ether_addr ea_addr;
#endif /* GET_CUSTOM_MAC_ENABLE */
+
DHD_TRACE(("Enter %s\n", __FUNCTION__));
dhd->op_mode = 0;
#ifdef GET_CUSTOM_MAC_ENABLE
@@ -3051,10 +2988,9 @@ 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 custom MAC address , error=%d\n", __FUNCTION__, ret));
+ DHD_ERROR(("%s: can't set MAC address , error=%d\n", __FUNCTION__, ret));
return BCME_NOTUP;
}
- memcpy(dhd->mac.octet, ea_addr.octet, ETHER_ADDR_LEN);
} else {
#endif /* GET_CUSTOM_MAC_ENABLE */
/* Get the default device MAC address directly from firmware */
@@ -3067,12 +3003,13 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
}
/* Update public MAC address after reading from Firmware */
memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN);
+
#ifdef GET_CUSTOM_MAC_ENABLE
}
#endif /* GET_CUSTOM_MAC_ENABLE */
#ifdef SET_RANDOM_MAC_SOFTAP
- if ((!op_mode && strstr(fw_path, "_apsta") != NULL) || (op_mode == HOSTAPD_MASK)) {
+ if ((!op_mode && strstr(fw_path, "_apsta") != NULL) || (op_mode == 0x02)) {
uint rand_mac;
srandom32((uint)jiffies);
@@ -3094,66 +3031,31 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#endif /* SET_RANDOM_MAC_SOFTAP */
DHD_TRACE(("Firmware = %s\n", fw_path));
-
-#if !defined(AP) && defined(WLP2P)
+#if !defined(AP) && defined(WLP2P)
/* Check if firmware with WFD support used */
-#if defined(WL_ENABLE_P2P_IF)
- if ((ret = dhd_concurrent_fw(dhd)) < 0) {
- DHD_ERROR(("%s error : firmware can't support p2p mode\n", __FUNCTION__));
- goto done;
- }
-#endif /* (WL_ENABLE_P2P_IF) */
-
- if ((!op_mode && strstr(fw_path, "_p2p") != NULL)
-#if defined(WL_ENABLE_P2P_IF)
- || (op_mode == WFD_MASK) || (dhd_concurrent_fw(dhd) == 1)
-#endif /* */
- ) {
+#if 0
+if ((!op_mode && strstr(fw_path, "_p2p") != NULL) || (op_mode == 0x04) ||
+ (dhd_concurrent_fw(dhd))) {
+#else //should be decide by firmware name or op mode
+ if ((!op_mode && strstr(fw_path, "_p2p") != NULL) || (op_mode == 0x04)) {
+#endif
bcm_mkiovar("apsta", (char *)&apsta, 4, iovbuf, sizeof(iovbuf));
if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR,
iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) {
- DHD_ERROR(("%s APSTA setting failed ret= %d\n", __FUNCTION__, ret));
+ DHD_ERROR(("%s APSTA for WFD failed ret= %d\n", __FUNCTION__, ret));
} else {
dhd->op_mode |= WFD_MASK;
-#if !defined(WL_ENABLE_P2P_IF)
- /* ICS back capability : disable any packet filtering for p2p only mode */
+#if defined(ARP_OFFLOAD_SUPPORT)
+ arpoe = 0;
+#endif /* (ARP_OFFLOAD_SUPPORT) */
dhd_pkt_filter_enable = FALSE;
-#endif /*!defined(WL_ENABLE_P2P_IF) */
}
}
#endif
-
#if !defined(AP) && defined(WL_CFG80211)
/* Check if firmware with HostAPD support used */
- if ((!op_mode && strstr(fw_path, "_apsta") != NULL) || (op_mode == HOSTAPD_MASK)) {
- /* Disable A-band for HostAPD */
- uint band = WLC_BAND_2G;
- if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_BAND, (char *)&band, sizeof(band),
- TRUE, 0)) < 0) {
- DHD_ERROR(("%s:set band failed error (%d)\n", __FUNCTION__, ret));
- }
-
- /* Turn off wme if we are having only g ONLY firmware */
- bcm_mkiovar("nmode", 0, 0, buf, sizeof(buf));
- if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, buf, sizeof(buf),
- FALSE, 0)) < 0) {
- DHD_ERROR(("%s:get nmode failed error (%d)\n", __FUNCTION__, ret));
- }
- else {
- DHD_TRACE(("%s:get nmode returned %d\n", __FUNCTION__,buf[0]));
- }
- if (buf[0] == 0) {
- int wme = 0;
- bcm_mkiovar("wme", (char *)&wme, 4, iovbuf, sizeof(iovbuf));
- if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf,
- sizeof(iovbuf), TRUE, 0)) < 0) {
- DHD_ERROR(("%s set wme for HostAPD failed %d\n", __FUNCTION__, ret));
- }
- else {
- DHD_TRACE(("%s set wme succeeded for g ONLY firmware\n", __FUNCTION__));
- }
- }
+ if ((!op_mode && strstr(fw_path, "_apsta") != NULL) || (op_mode == 0x02)) {
/* Turn off MPC in AP mode */
bcm_mkiovar("mpc", (char *)&mpc, 4, iovbuf, sizeof(iovbuf));
if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf,
@@ -3164,20 +3066,16 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#if defined(ARP_OFFLOAD_SUPPORT)
arpoe = 0;
#endif /* (ARP_OFFLOAD_SUPPORT) */
- /* disable any filtering for SoftAP mode */
dhd_pkt_filter_enable = FALSE;
}
}
#endif
-#if !defined(WL_ENABLE_P2P_IF)
- /* ICS mode setting for sta */
if ((dhd->op_mode != WFD_MASK) && (dhd->op_mode != HOSTAPD_MASK)) {
/* STA only operation mode */
dhd->op_mode |= STA_MASK;
dhd_pkt_filter_enable = TRUE;
}
-#endif /* !defined(WL_ENABLE_P2P_IF) */
DHD_ERROR(("Firmware up: op_mode=%d, "
"Broadcom Dongle Host Driver mac=%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
@@ -3205,13 +3103,9 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
bcm_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf, sizeof(iovbuf));
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
- /* disable glom option for some chips */
- chipID = (uint16)dhd_bus_chip_id(dhd);
- if ((chipID == BCM4330_CHIP_ID) || (chipID == BCM4329_CHIP_ID)) {
- DHD_INFO(("%s disable glom for chipID=0x%X\n", __FUNCTION__, chipID));
- bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
- }
+ /* disable glom option per default */
+ bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
+ dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
/* Setup timeout if Beacons are lost and roam is off to report link down */
bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, sizeof(iovbuf));
@@ -3219,7 +3113,6 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
/* Setup assoc_retry_max count to reconnect target AP in dongle */
bcm_mkiovar("assoc_retry_max", (char *)&retry_max, 4, iovbuf, sizeof(iovbuf));
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
-
#if defined(AP) && !defined(WLP2P)
/* Turn off MPC in AP mode */
bcm_mkiovar("mpc", (char *)&mpc, 4, iovbuf, sizeof(iovbuf));
@@ -3228,20 +3121,6 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
#endif /* defined(AP) && !defined(WLP2P) */
-#ifdef DHD_BCM_WIFI_HDMI
- /* Check if WHDMI or APSTA firmware is being used */
- if (strstr(fw_path, "whdmi") != NULL || strstr(fw_path, "apsta") != NULL) {
- apsta = 1;
- bcm_mkiovar("apsta", (char *)&apsta, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
- }
- /* Parse kernel parameters for WHDMI enable flag */
- if (strncmp(wifi_type, "4330whdmi", sizeof(wifi_type-1)) == 0) {
- printf("'wifi_type=4330whdmi' module parameter indicates WHDMI is on.\n");
- dhd_bcm_whdmi_enable = TRUE;
- }
-#endif /* DHD_BCM_WIFI_HDMI */
-
#if defined(SOFTAP)
if (ap_fw_loaded == TRUE) {
dhd_wl_ioctl_cmd(dhd, WLC_SET_DTIMPRD, (char *)&dtim, sizeof(dtim), TRUE, 0);
@@ -3249,13 +3128,17 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#endif
#if defined(KEEP_ALIVE)
+ {
/* Set Keep Alive : be sure to use FW with -keepalive */
+ int res;
+
#if defined(SOFTAP)
if (ap_fw_loaded == FALSE)
#endif
if ((res = dhd_keep_alive_onoff(dhd)) < 0)
DHD_ERROR(("%s set keeplive failed %d\n",
__FUNCTION__, res));
+ }
#endif /* defined(KEEP_ALIVE) */
@@ -3341,14 +3224,12 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#ifdef PKT_FILTER_SUPPORT
/* Setup defintions for pktfilter , enable in suspend */
- dhd->pktfilter_count = 5;
+ dhd->pktfilter_count = 4;
/* Setup filter to allow only unicast */
dhd->pktfilter[0] = "100 0 0 0 0x01 0x00";
dhd->pktfilter[1] = NULL;
dhd->pktfilter[2] = NULL;
dhd->pktfilter[3] = NULL;
- /* Add filter to pass multicastDNS packet and NOT filter out as Broadcast */
- dhd->pktfilter[4] = "104 0 0 0 0xFFFFFFFFFFFF 0x01005E0000FB";
#if defined(SOFTAP)
if (ap_fw_loaded) {
int i;
@@ -3360,39 +3241,20 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
#endif /* defined(SOFTAP) */
#endif /* PKT_FILTER_SUPPORT */
-#if defined(DHD_BCM_WIFI_HDMI)
- if (dhd_bcm_whdmi_enable) {
- DHD_ERROR(("DHD WiFi HDMI is enabled\n"));
-
- /* Turn off MPC, turn on APSTA */
- /* APSTA can only be set before wl up */
- bcm_mkiovar("mpc", (char *)&mpc, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
- bcm_mkiovar("apsta", (char *)&apsta, 4, iovbuf, sizeof(iovbuf));
- dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
-
- /* Disable legacy power save modes */
- power_mode = PM_OFF;
- dhd_wl_ioctl_cmd(dhd, WLC_SET_PM, (char*)&power_mode, sizeof(power_mode), TRUE, 0);
-#ifdef ARP_OFFLOAD_SUPPORT
- /* Disable ARP offload */
- dhd_arp_offload_set(dhd, 0);
- dhd_arp_offload_enable(dhd, FALSE);
-#endif /* ARP_OFFLOAD_SUPPORT */
-
- } else {
- DHD_INFO(("DHD WiFi HDMI is NOT enabled\n"));
+#ifdef WL_PROTECT
+ if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_INFRA, (char *)&infra, sizeof(infra), TRUE, 0)) < 0) {
+ DHD_ERROR(("%s Setting WL INFRA failed %d\n", __FUNCTION__, ret));
+ goto done;
}
-#endif /* defined(DHD_BCM_WIFI_HDMI) */
-
-#if !defined(WL_CFG80211)
+ OSL_DELAY(10*1000);
+#endif
/* Force STA UP */
if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_UP, (char *)&up, sizeof(up), TRUE, 0)) < 0) {
DHD_ERROR(("%s Setting WL UP failed %d\n", __FUNCTION__, ret));
goto done;
}
-#endif /* (WL_CFG80211) */
+
/* query for 'ver' to get version info from firmware */
memset(buf, 0, sizeof(buf));
ptr = buf;
@@ -3403,15 +3265,8 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
bcmstrtok(&ptr, "\n", 0);
/* Print fw version info */
DHD_ERROR(("Firmware version = %s\n", buf));
-
DHD_BLOG(buf, strlen(buf) + 1);
DHD_BLOG(dhd_version, strlen(dhd_version) + 1);
-
- /* Check and adjust IOCTL response timeout for Manufactring firmware */
- if (strstr(buf, MANUFACTRING_FW) != NULL) {
- dhd_os_set_ioctl_resp_timeout(IOCTL_RESP_TIMEOUT * 10);
- DHD_ERROR(("%s : adjust IOCTL response time for Manufactring Firmware\n", __FUNCTION__));
- }
}
done:
@@ -3470,7 +3325,6 @@ int dhd_change_mtu(dhd_pub_t *dhdp, int new_mtu, int ifidx)
}
#ifdef ARP_OFFLOAD_SUPPORT
-
/* add or remove AOE host ip(s) (up to 8 IPs on the interface) */
void
aoe_update_host_ipv4_table(dhd_pub_t *dhd_pub, u32 ipa, bool add)
@@ -3658,14 +3512,14 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
net->ethtool_ops = &dhd_ethtool_ops;
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) */
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
#if WIRELESS_EXT < 19
net->get_wireless_stats = dhd_get_wireless_stats;
#endif /* WIRELESS_EXT < 19 */
#if WIRELESS_EXT > 12
net->wireless_handlers = (struct iw_handler_def *)&wl_iw_handler_def;
#endif /* WIRELESS_EXT > 12 */
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
dhd->pub.rxsz = DBUS_RX_BUFFER_SIZE_DHD(net);
@@ -3675,7 +3529,6 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
memset(net->name,0,sizeof(net->name));
strcpy(net->name,"wlan%d");
}
-
if ((err = register_netdev(net)) != 0) {
DHD_ERROR(("couldn't register the net device, err %d\n", err));
goto fail;
@@ -3686,7 +3539,7 @@ dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
net->dev_addr[0], net->dev_addr[1], net->dev_addr[2],
net->dev_addr[3], net->dev_addr[4], net->dev_addr[5]);
-#if defined(SOFTAP) && defined(WL_WIRELESS_EXT) && !defined(WL_CFG80211)
+#if defined(SOFTAP) && defined(CONFIG_WIRELESS_EXT) && !defined(WL_CFG80211)
wl_iw_iscan_set_scan_broadcast_prep(net, 1);
#endif
@@ -3764,23 +3617,20 @@ void dhd_detach(dhd_pub_t *dhdp)
unregister_inetaddr_notifier(&dhd_notifier);
#endif /* ARP_OFFLOAD_SUPPORT */
-#if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
+#if defined(CONFIG_HAS_EARLYSUSPEND)
if (dhd->dhd_state & DHD_ATTACH_STATE_EARLYSUSPEND_DONE) {
if (dhd->early_suspend.suspend)
unregister_early_suspend(&dhd->early_suspend);
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
- cancel_work_sync(&dhd->work_hang);
-#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
if (dhd->dhd_state & DHD_ATTACH_STATE_WL_ATTACH) {
/* Detatch and unlink in the iw */
wl_iw_detach();
}
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
if (dhd->thr_sysioc_ctl.thr_pid >= 0) {
PROC_STOP(&dhd->thr_sysioc_ctl);
@@ -3867,7 +3717,6 @@ void dhd_detach(dhd_pub_t *dhdp)
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_destroy(&dhd->wl_wifi);
wake_lock_destroy(&dhd->wl_rxwake);
- wake_lock_destroy(&dhd->wl_ctrlwake);
#endif
}
}
@@ -3961,14 +3810,14 @@ dhd_module_init(void)
#endif
#if defined(WL_CFG80211)
wl_android_post_init();
-#endif /* defined(WL_CFG80211) */
+#endif
return error;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
+#if 1 && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
fail_2:
dhd_bus_unregister();
-#endif
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
fail_1:
#if defined(CONFIG_WIFI_CONTROL_FUNC)
wl_android_wifictrl_func_del();
@@ -4032,6 +3881,7 @@ int
dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
{
dhd_info_t * dhd = (dhd_info_t *)(pub->info);
+ DECLARE_WAITQUEUE(wait, current);
int timeout = dhd_ioctl_timeout_msec;
/* Convert timeout in millsecond to jiffies */
@@ -4042,7 +3892,24 @@ dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
#endif
/* Wait until control frame is available */
- timeout = wait_event_timeout(dhd->ioctl_resp_wait, (*condition), timeout);
+ add_wait_queue(&dhd->ioctl_resp_wait, &wait);
+ set_current_state(TASK_INTERRUPTIBLE);
+
+ /* Memory barrier to support multi-processing
+ * As the variable "condition", which points to dhd->rxlen (dhd_bus_rxctl[dhd_sdio.c])
+ * Can be changed by another processor.
+ */
+ smp_mb();
+ while (!(*condition) && (!signal_pending(current) && timeout)) {
+ timeout = schedule_timeout(timeout);
+ smp_mb();
+ }
+
+ if (signal_pending(current))
+ *pending = TRUE;
+
+ set_current_state(TASK_RUNNING);
+ remove_wait_queue(&dhd->ioctl_resp_wait, &wait);
return timeout;
}
@@ -4053,7 +3920,7 @@ dhd_os_ioctl_resp_wake(dhd_pub_t *pub)
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
if (waitqueue_active(&dhd->ioctl_resp_wait)) {
- wake_up(&dhd->ioctl_resp_wait);
+ wake_up_interruptible(&dhd->ioctl_resp_wait);
}
return 0;
@@ -4224,7 +4091,7 @@ void dhd_os_prefree(void *osh, void *addr, uint size)
}
#endif /* defined(CONFIG_WIFI_CONTROL_FUNC) */
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
struct iw_statistics *
dhd_get_wireless_stats(struct net_device *dev)
{
@@ -4242,7 +4109,7 @@ dhd_get_wireless_stats(struct net_device *dev)
else
return NULL;
}
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
static int
dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
@@ -4255,7 +4122,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
if (bcmerror != BCME_OK)
return (bcmerror);
-#if defined(WL_WIRELESS_EXT)
+#if defined(CONFIG_WIRELESS_EXT)
if (event->bsscfgidx == 0) {
/*
* Wireless ext is on primary interface only
@@ -4268,7 +4135,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
wl_iw_event(dhd->iflist[*ifidx]->net, event, *data);
}
}
-#endif /* defined(WL_WIRELESS_EXT) */
+#endif /* defined(CONFIG_WIRELESS_EXT) */
#ifdef WL_CFG80211
if ((ntoh32(event->event_type) == WLC_E_IF) &&
@@ -4406,14 +4273,12 @@ void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
{
#if 1 && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0))
struct dhd_info *dhdinfo = dhd->info;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
- int timeout = msecs_to_jiffies(2000);
-#else
- int timeout = 2 * HZ;
-#endif
dhd_os_sdunlock(dhd);
- wait_event_timeout(dhdinfo->ctrl_wait, (*lockvar == FALSE), timeout);
+
+ //printk("cg_unlock %s:%d\n", __func__, __LINE__);
+ wait_event_interruptible_timeout(dhdinfo->ctrl_wait, (*lockvar == FALSE), HZ * 2);
dhd_os_sdlock(dhd);
+ //printk("cg_unlock %s:%d\n", __func__, __LINE__);
#endif
return;
}
@@ -4423,7 +4288,7 @@ void dhd_wait_event_wakeup(dhd_pub_t *dhd)
#if 1 && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0))
struct dhd_info *dhdinfo = dhd->info;
if (waitqueue_active(&dhdinfo->ctrl_wait))
- wake_up(&dhdinfo->ctrl_wait);
+ wake_up_interruptible(&dhdinfo->ctrl_wait);
#endif
return;
}
@@ -4449,6 +4314,8 @@ int net_os_set_suspend_disable(struct net_device *dev, int val)
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int ret = 0;
+ wchg_trace
+
if (dhd) {
ret = dhd->pub.suspend_disable_flag;
dhd->pub.suspend_disable_flag = val;
@@ -4456,28 +4323,19 @@ int net_os_set_suspend_disable(struct net_device *dev, int val)
return ret;
}
-int net_os_get_suspend(struct net_device *dev)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- if (dhd) {
- return dhd->pub.in_suspend;
- } else
-
- return -1;
-}
-
-int net_os_set_suspend(struct net_device *dev, int val, int force)
+int net_os_set_suspend(struct net_device *dev, int val)
{
int ret = 0;
+
+ wchg_trace
+
+#if defined(CONFIG_HAS_EARLYSUSPEND)
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
if (dhd) {
-#if defined(CONFIG_HAS_EARLYSUSPEND) && defined(DHD_USE_EARLYSUSPEND)
ret = dhd_set_suspend(val, &dhd->pub);
-#else
- ret = dhd_suspend_resume_helper(dhd, val, force);
-#endif
}
+#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
return ret;
}
@@ -4497,8 +4355,7 @@ int net_os_rxfilter_add_remove(struct net_device *dev, int add_remove, int num)
char *filterp = NULL;
int ret = 0;
- if (!dhd || (num == DHD_UNICAST_FILTER_NUM) ||
- (num == DHD_MDNS_FILTER_NUM))
+ if (!dhd || (num == DHD_UNICAST_FILTER_NUM))
return ret;
if (num >= dhd->pub.pktfilter_count)
return -EINVAL;
@@ -4521,8 +4378,9 @@ int net_os_rxfilter_add_remove(struct net_device *dev, int add_remove, int num)
return ret;
}
-int dhd_os_set_packet_filter(dhd_pub_t *dhdp, int val)
+int net_os_set_packet_filter(struct net_device *dev, int val)
{
+ dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int ret = 0;
/* Packet filtering is set only if we still in early-suspend and
@@ -4530,29 +4388,22 @@ int dhd_os_set_packet_filter(dhd_pub_t *dhdp, int val)
* We can always turn it OFF in case of early-suspend, but we turn it
* back ON only if suspend_disable_flag was not set
*/
- if (dhdp && dhdp->up) {
- if (dhdp->in_suspend) {
- if (!val || (val && !dhdp->suspend_disable_flag))
- dhd_set_packet_filter(val, dhdp);
+ if (dhd && dhd->pub.up) {
+ if (dhd->pub.in_suspend) {
+ if (!val || (val && !dhd->pub.suspend_disable_flag))
+ dhd_set_packet_filter(val, &dhd->pub);
}
}
return ret;
-
}
-int net_os_set_packet_filter(struct net_device *dev, int val)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- return dhd_os_set_packet_filter(&dhd->pub, val);
-}
-
-int
+void
dhd_dev_init_ioctl(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- return(dhd_preinit_ioctls(&dhd->pub));
+ dhd_preinit_ioctls(&dhd->pub);
}
#ifdef PNO_SUPPORT
@@ -4586,17 +4437,6 @@ dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t* ssids_local, int nssid,
return (dhd_pno_set(&dhd->pub, ssids_local, nssid, scan_fr, pno_repeat, pno_freq_expo_max));
}
-/* Linux wrapper to call common dhd_pno_set_ex */
-int
-dhd_dev_pno_set_ex(struct net_device *dev, wl_pfn_t* ssidnet, int nssid,
- ushort pno_interval, int pno_repeat, int pno_expo_max, int pno_lost_time)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-
- return (dhd_pno_set_ex(&dhd->pub, ssidnet, nssid,
- pno_interval, pno_repeat, pno_expo_max, pno_lost_time));
-}
-
/* Linux wrapper to get pno status */
int
dhd_dev_get_pno_status(struct net_device *dev)
@@ -4608,28 +4448,6 @@ dhd_dev_get_pno_status(struct net_device *dev)
#endif /* PNO_SUPPORT */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (1 || 0)
-static void dhd_hang_process(struct work_struct *work)
-{
- dhd_info_t *dhd;
- struct net_device *dev;
-
- dhd = (dhd_info_t *)container_of(work, dhd_info_t, work_hang);
- dev = dhd->iflist[0]->net;
-
- if (dev) {
- rtnl_lock();
- dev_close(dev);
- rtnl_unlock();
-#if defined(WL_WIRELESS_EXT)
- wl_iw_send_priv_event(dev, "HANG");
-#endif
-#if defined(WL_CFG80211)
- wl_cfg80211_hang(dev, WLAN_REASON_UNSPECIFIED);
-#endif
- }
-}
-
int net_os_send_hang_message(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -4638,12 +4456,18 @@ int net_os_send_hang_message(struct net_device *dev)
if (dhd) {
if (!dhd->pub.hang_was_sent) {
dhd->pub.hang_was_sent = 1;
- schedule_work(&dhd->work_hang);
+#if defined(CONFIG_WIRELESS_EXT)
+ ret = wl_iw_send_priv_event(dev, "HANG");
+#endif
+#if defined(WL_CFG80211)
+ ret = wl_cfg80211_hang(dev, WLAN_REASON_UNSPECIFIED);
+ dev_close(dev);
+ dev_open(dev);
+#endif
}
}
return ret;
}
-#endif
void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec)
{
@@ -4653,6 +4477,26 @@ void dhd_bus_country_set(struct net_device *dev, wl_country_t *cspec)
memcpy(&dhd->pub.dhd_cspec, cspec, sizeof(wl_country_t));
}
+#ifdef WL_PROTECT
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
+void dhd_os_start_lock(dhd_pub_t *pub)
+{
+ dhd_info_t *dhd = (dhd_info_t *)(pub->info);
+
+ if (dhd)
+ mutex_lock(&dhd->wl_start_lock);
+}
+
+void dhd_os_start_unlock(dhd_pub_t *pub)
+{
+ dhd_info_t *dhd = (dhd_info_t *)(pub->info);
+
+ if (dhd)
+ mutex_unlock(&dhd->wl_start_lock);
+}
+#endif
+#endif
+
void dhd_net_if_lock(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -4667,7 +4511,7 @@ void dhd_net_if_unlock(struct net_device *dev)
static void dhd_net_if_lock_local(dhd_info_t *dhd)
{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && (1 || 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
if (dhd)
mutex_lock(&dhd->dhd_net_if_mutex);
#endif
@@ -4675,29 +4519,12 @@ static void dhd_net_if_lock_local(dhd_info_t *dhd)
static void dhd_net_if_unlock_local(dhd_info_t *dhd)
{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && (1 || 0)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
if (dhd)
mutex_unlock(&dhd->dhd_net_if_mutex);
#endif
}
-static void dhd_suspend_lock(dhd_pub_t *pub)
-{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && (1 || 0)
- dhd_info_t *dhd = (dhd_info_t *)(pub->info);
- if (dhd)
- mutex_lock(&dhd->dhd_suspend_mutex);
-#endif
-}
-
-static void dhd_suspend_unlock(dhd_pub_t *pub)
-{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && (1 || 0)
- dhd_info_t *dhd = (dhd_info_t *)(pub->info);
- if (dhd)
- mutex_unlock(&dhd->dhd_suspend_mutex);
-#endif
-}
unsigned long dhd_os_spin_lock(dhd_pub_t *pub)
{
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
@@ -4782,7 +4609,6 @@ exit:
}
#endif /* DHD_DEBUG */
-/* Function to take wake lock */
int dhd_os_wake_lock_timeout(dhd_pub_t *pub)
{
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
@@ -4791,18 +4617,13 @@ int dhd_os_wake_lock_timeout(dhd_pub_t *pub)
if (dhd) {
spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
- ret = dhd->wakelock_rx_timeout_enable > dhd->wakelock_ctrl_timeout_enable ?
- dhd->wakelock_rx_timeout_enable : dhd->wakelock_ctrl_timeout_enable;
+ ret = dhd->wakelock_timeout_enable;
#ifdef CONFIG_HAS_WAKELOCK
- if (dhd->wakelock_rx_timeout_enable)
+ if (dhd->wakelock_timeout_enable)
wake_lock_timeout(&dhd->wl_rxwake,
- msecs_to_jiffies(dhd->wakelock_rx_timeout_enable));
- if (dhd->wakelock_ctrl_timeout_enable)
- wake_lock_timeout(&dhd->wl_ctrlwake,
- msecs_to_jiffies(dhd->wakelock_ctrl_timeout_enable));
+ msecs_to_jiffies(dhd->wakelock_timeout_enable));
#endif
- dhd->wakelock_rx_timeout_enable = 0;
- dhd->wakelock_ctrl_timeout_enable = 0;
+ dhd->wakelock_timeout_enable = 0;
spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
}
return ret;
@@ -4818,53 +4639,27 @@ int net_os_wake_lock_timeout(struct net_device *dev)
return ret;
}
-/* Function to program wake lock for any RX packet */
-int dhd_os_wake_lock_rx_timeout_enable(dhd_pub_t *pub, int val)
+int dhd_os_wake_lock_timeout_enable(dhd_pub_t *pub, int val)
{
dhd_info_t *dhd = (dhd_info_t *)(pub->info);
unsigned long flags;
if (dhd) {
spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
- if (val > dhd->wakelock_rx_timeout_enable)
- dhd->wakelock_rx_timeout_enable = val;
+ if (val > dhd->wakelock_timeout_enable)
+ dhd->wakelock_timeout_enable = val;
spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
}
return 0;
}
-/* Function to program wake lock for any Event (ctrl) from Dongle */
-int dhd_os_wake_lock_ctrl_timeout_enable(dhd_pub_t *pub, int val)
-{
- dhd_info_t *dhd = (dhd_info_t *)(pub->info);
- unsigned long flags;
-
- if (dhd) {
- spin_lock_irqsave(&dhd->wakelock_spinlock, flags);
- if (val > dhd->wakelock_ctrl_timeout_enable)
- dhd->wakelock_ctrl_timeout_enable = val;
- spin_unlock_irqrestore(&dhd->wakelock_spinlock, flags);
- }
- return 0;
-}
-
-int net_os_wake_lock_rx_timeout_enable(struct net_device *dev, int val)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- int ret = 0;
-
- if (dhd)
- ret = dhd_os_wake_lock_rx_timeout_enable(&dhd->pub, val);
- return ret;
-}
-
-int net_os_wake_lock_ctrl_timeout_enable(struct net_device *dev, int val)
+int net_os_wake_lock_timeout_enable(struct net_device *dev, int val)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int ret = 0;
if (dhd)
- ret = dhd_os_wake_lock_ctrl_timeout_enable(&dhd->pub, val);
+ ret = dhd_os_wake_lock_timeout_enable(&dhd->pub, val);
return ret;
}
diff --git a/drivers/net/wireless/bcmdhd/dhd_proto.h b/drivers/net/wireless/bcmdhd/dhd_proto.h
index 04e99012486a..8b3391ec39d5 100755
--- a/drivers/net/wireless/bcmdhd/dhd_proto.h
+++ b/drivers/net/wireless/bcmdhd/dhd_proto.h
@@ -24,7 +24,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_proto.h 325560 2012-04-03 21:28:08Z $
+ * $Id: dhd_proto.h 277732 2011-08-16 17:36:42Z $
*/
#ifndef _dhd_proto_h_
@@ -34,7 +34,11 @@
#include <wlioctl.h>
#ifndef IOCTL_RESP_TIMEOUT
-#define IOCTL_RESP_TIMEOUT 2000 /* In milli second default value for Production FW */
+#ifndef WL_PROTECT
+#define IOCTL_RESP_TIMEOUT 20000 /* In milli second */
+#else
+#define IOCTL_RESP_TIMEOUT 2000 /* In milli second */
+#endif
#endif
/*
diff --git a/drivers/net/wireless/bcmdhd/dhd_sdio.c b/drivers/net/wireless/bcmdhd/dhd_sdio.c
index a3d7dfe6d2bd..28ceafeefc05 100755
--- a/drivers/net/wireless/bcmdhd/dhd_sdio.c
+++ b/drivers/net/wireless/bcmdhd/dhd_sdio.c
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_sdio.c 338148 2012-06-11 20:35:45Z $
+ * $Id: dhd_sdio.c 309234 2012-01-19 01:44:16Z $
*/
#include <typedefs.h>
@@ -317,7 +317,7 @@ static int tx_packets[NUMPRIO];
#endif /* DHD_DEBUG */
/* Deferred transmit */
-const uint dhd_deferred_tx = 1;
+const uint dhd_deferred_tx = 1; // 1
extern uint dhd_watchdog_ms;
extern void dhd_os_wd_timer(void *bus, uint wdtick);
@@ -834,8 +834,7 @@ dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok)
#ifdef DHD_DEBUG
if (dhd_console_ms == 0)
#endif /* DHD_DEBUG */
- if (bus->poll == 0)
- dhd_os_wd_timer(bus->dhd, 0);
+ dhd_os_wd_timer(bus->dhd, 0);
break;
}
#ifdef DHD_DEBUG
@@ -1182,6 +1181,38 @@ dhd_bus_txdata(struct dhd_bus *bus, void *pkt)
(bus->clkstate != CLK_AVAIL)) {
DHD_TRACE(("%s: deferring pktq len %d\n", __FUNCTION__,
pktq_len(&bus->txq)));
+
+
+ if(bus->clkstate != CLK_AVAIL)
+ //DHD_TRACE("clkstate =%d\n", bus->clkstate);
+
+
+ if(bus->clkstate == CLK_SDONLY)
+ {
+#ifdef WL_PROTECT
+ DHD_ERROR(("%s: Reset firmware\n", __FUNCTION__));
+ if (WIFI_FIRMWARE_ERROR != atomic_read(&g_fw_err_flag) &&
+ WIFI_FIRMWARE_ERROR != atomic_read(&g_fw_reload_over_flag))
+ {
+ atomic_set(&g_fw_err_flag, WIFI_FIRMWARE_ERROR);
+ DHD_ERROR(("up the semaphore\n"));
+ up(&g_wl_protect->wlp_sem);
+ }
+#endif //WL_PROTECT
+ }
+
+/*
+ printk("##########\n");
+ printk("bus->fcstate=%d, pktq_len(&bus->txq)=%d, bus->dpc_sched=%d\n", bus->fcstate, pktq_len(&bus->txq), bus->dpc_sched);
+ if(!DATAOK(bus))
+ printk("dataOK is failed\n");
+ if(bus->flowcontrol & NBITVAL(prec))
+ printk("flowcontrol is set\n");
+ if(bus->clkstate != CLK_AVAIL)
+ printk("clkstate =%d\n", bus->clkstate);
+ printk("##########\n");
+*/
+
bus->fcqueued++;
/* Priority based enq */
@@ -1396,13 +1427,27 @@ dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen)
htol32_ua_store(0, frame + SDPCM_FRAMETAG_LEN + sizeof(swheader));
if (!TXCTLOK(bus)) {
+#ifdef WL_PROTECT
+ DHD_ERROR(("%s: Reset firmware\n", __FUNCTION__));
+ if (WIFI_FIRMWARE_ERROR != atomic_read(&g_fw_err_flag) &&
+ WIFI_FIRMWARE_ERROR != atomic_read(&g_fw_reload_over_flag))
+ {
+ atomic_set(&g_fw_err_flag, WIFI_FIRMWARE_ERROR);
+ DHD_ERROR(("up the semaphore\n"));
+ up(&g_wl_protect->wlp_sem);
+ }
+#endif //WL_PROTECT
DHD_INFO(("%s: No bus credit bus->tx_max %d, bus->tx_seq %d\n",
__FUNCTION__, bus->tx_max, bus->tx_seq));
bus->ctrl_frame_stat = TRUE;
/* Send from dpc */
bus->ctrl_frame_buf = frame;
bus->ctrl_frame_len = len;
+
+#ifndef WL_PROTECT
dhd_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
+#endif //WL_PROTECT
+
if (bus->ctrl_frame_stat == FALSE) {
DHD_INFO(("%s: ctrl_frame_stat == FALSE\n", __FUNCTION__));
ret = 0;
@@ -1470,6 +1515,7 @@ done:
}
dhd_os_sdunlock(bus->dhd);
+ //printk("cg_unlock %s:%d\n", __func__, __LINE__);
if (ret)
bus->dhd->tx_ctlerrs++;
@@ -1487,7 +1533,7 @@ dhd_bus_rxctl(struct dhd_bus *bus, uchar *msg, uint msglen)
{
int timeleft;
uint rxlen = 0;
- bool pending = FALSE;
+ bool pending;
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
@@ -1498,6 +1544,7 @@ dhd_bus_rxctl(struct dhd_bus *bus, uchar *msg, uint msglen)
timeleft = dhd_os_ioctl_resp_wait(bus->dhd, &bus->rxlen, &pending);
dhd_os_sdlock(bus->dhd);
+
rxlen = bus->rxlen;
bcopy(bus->rxctl, msg, MIN(msglen, rxlen));
bus->rxlen = 0;
@@ -1508,15 +1555,24 @@ dhd_bus_rxctl(struct dhd_bus *bus, uchar *msg, uint msglen)
__FUNCTION__, rxlen, msglen));
} else if (timeleft == 0) {
DHD_ERROR(("%s: resumed on timeout\n", __FUNCTION__));
+#ifdef WL_PROTECT
+ DHD_ERROR(("%s: Reset firmware\n", __FUNCTION__));
+ if (WIFI_FIRMWARE_ERROR != atomic_read(&g_fw_err_flag) &&
+ WIFI_FIRMWARE_ERROR != atomic_read(&g_fw_reload_over_flag))
+ {
+ atomic_set(&g_fw_err_flag, WIFI_FIRMWARE_ERROR);
+ DHD_ERROR(("up the semaphore\n"));
+ up(&g_wl_protect->wlp_sem);
+ }
+#endif //WL_PROTECT
#ifdef DHD_DEBUG
dhd_os_sdlock(bus->dhd);
dhdsdio_checkdied(bus, NULL, 0);
dhd_os_sdunlock(bus->dhd);
#endif /* DHD_DEBUG */
} else if (pending == TRUE) {
- /* possibly fw hangs so never responsed back */
- DHD_ERROR(("%s: signal pending\n", __FUNCTION__));
- return -EINTR;
+ DHD_CTL(("%s: canceled\n", __FUNCTION__));
+ return -ERESTARTSYS;
} else {
DHD_CTL(("%s: resumed for unknown reason?\n", __FUNCTION__));
#ifdef DHD_DEBUG
@@ -2716,6 +2772,8 @@ exit:
}
dhd_os_sdunlock(bus->dhd);
+
+ //printk("cg_unlock %s:%d\n", __func__, __LINE__);
if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == FALSE)
dhd_preinit_ioctls((dhd_pub_t *) bus->dhd);
@@ -2820,8 +2878,6 @@ dhdsdio_download_state(dhd_bus_t *bus, bool enter)
uint retries;
int bcmerror = 0;
- if (!bus->sih)
- return BCME_ERROR;
/* To enter download state, disable ARM and reset SOCRAM.
* To exit download state, simply reset ARM (default is RAM boot).
*/
@@ -3095,8 +3151,6 @@ dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
bus->rxskip = FALSE;
bus->tx_seq = bus->rx_seq = 0;
- bus->tx_max = 4;
-
if (enforce_mutex)
dhd_os_sdunlock(bus->dhd);
}
@@ -3151,9 +3205,9 @@ dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
dhd_timeout_start(&tmo, DHD_WAIT_F2RDY * 1000);
ready = 0;
- do {
- ready = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IORDY, NULL);
- } while (ready != enable && !dhd_timeout_expired(&tmo));
+ while (ready != enable && !dhd_timeout_expired(&tmo))
+ ready = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIOD_CCCR_IORDY, NULL);
+
DHD_INFO(("%s: enable 0x%02x, ready 0x%02x (waited %uus)\n",
__FUNCTION__, enable, ready, tmo.elapsed));
@@ -4470,6 +4524,7 @@ dhdsdio_dpc(dhd_bus_t *bus)
intstatus = bus->intstatus;
dhd_os_sdlock(bus->dhd);
+
/* If waiting for HTAVAIL, check status */
if (bus->clkstate == CLK_PENDING) {
@@ -4624,32 +4679,8 @@ clkwait:
bcmsdh_intr_enable(sdh);
}
-#if defined(OOB_INTR_ONLY) && !defined(HW_OOB)
- /* In case of SW-OOB(using edge trigger),
- * Check interrupt status in the dongle again after enable irq on the host.
- * and rechedule dpc if interrupt is pended in the dongle.
- * There is a chance to miss OOB interrupt while irq is disabled on the host.
- * No need to do this with HW-OOB(level trigger)
- */
- R_SDREG(newstatus, &regs->intstatus, retries);
- if (bcmsdh_regfail(bus->sdh))
- newstatus = 0;
- if (newstatus & bus->hostintmask) {
- bus->ipend = TRUE;
- resched = TRUE;
- }
-#endif /* defined(OOB_INTR_ONLY) && !defined(HW_OOB) */
-
if (TXCTLOK(bus) && bus->ctrl_frame_stat && (bus->clkstate == CLK_AVAIL)) {
int ret, i;
- uint8* frame_seq = bus->ctrl_frame_buf + SDPCM_FRAMETAG_LEN;
-
- if (*frame_seq != bus->tx_seq) {
- DHD_INFO(("%s IOCTL frame seq lag detected!"
- " frm_seq:%d != bus->tx_seq:%d, corrected\n",
- __FUNCTION__, *frame_seq, bus->tx_seq));
- *frame_seq = bus->tx_seq;
- }
ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC,
(uint8 *)bus->ctrl_frame_buf, (uint32)bus->ctrl_frame_len,
@@ -4721,6 +4752,8 @@ clkwait:
}
dhd_os_sdunlock(bus->dhd);
+
+ //printk("cg_unlock %s:%d\n", __func__, __LINE__);
return resched;
}
@@ -5619,10 +5652,8 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva,
return TRUE;
fail:
- if (bus->sih != NULL) {
+ if (bus->sih != NULL)
si_detach(bus->sih);
- bus->sih = NULL;
- }
return FALSE;
}
@@ -5886,7 +5917,6 @@ dhdsdio_release_dongle(dhd_bus_t *bus, osl_t *osh, bool dongle_isolation, bool r
dhdsdio_clkctl(bus, CLK_NONE, FALSE);
}
si_detach(bus->sih);
- bus->sih = NULL;
if (bus->vars && bus->varsz)
MFREE(osh, bus->vars, bus->varsz);
bus->vars = NULL;
@@ -6025,7 +6055,7 @@ dhdsdio_download_code_file(struct dhd_bus *bus, char *pfw_path)
void *image = NULL;
uint8 *memblock = NULL, *memptr;
- DHD_ERROR(("%s: download firmware %s\n", __FUNCTION__, pfw_path));
+ DHD_INFO(("%s: download firmware %s\n", __FUNCTION__, pfw_path));
image = dhd_os_open_image(pfw_path);
if (image == NULL)
@@ -6099,7 +6129,6 @@ dhdsdio_download_nvram(struct dhd_bus *bus)
return (0);
if (nvram_file_exists) {
- DHD_ERROR(("%s: nvram file %s\n", __FUNCTION__, pnv_path));
image = dhd_os_open_image(pnv_path);
if (image == NULL)
goto err;
@@ -6250,7 +6279,6 @@ dhd_bcmsdh_send_buf(dhd_bus_t *bus, uint32 addr, uint fn, uint flags, uint8 *buf
uint
dhd_bus_chip(struct dhd_bus *bus)
{
- ASSERT(bus);
ASSERT(bus->sih != NULL);
return bus->sih->chip;
}
@@ -6258,7 +6286,6 @@ dhd_bus_chip(struct dhd_bus *bus)
void *
dhd_bus_pub(struct dhd_bus *bus)
{
- ASSERT(bus);
return bus->dhd;
}
@@ -6274,6 +6301,9 @@ dhd_bus_hdrlen(struct dhd_bus *bus)
return SDPCM_HDRLEN;
}
+
+#define wchg_trace printk("%s_%d\n", __func__, __LINE__);
+
int
dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
{
@@ -6284,31 +6314,43 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
if (flag == TRUE) {
if (!bus->dhd->dongle_reset) {
+ wchg_trace
dhd_os_sdlock(dhdp);
+ wchg_trace
dhd_os_wd_timer(dhdp, 0);
+ wchg_trace
#if !defined(IGNORE_ETH0_DOWN)
/* Force flow control as protection when stop come before ifconfig_down */
dhd_txflowcontrol(bus->dhd, ALL_INTERFACES, ON);
+wchg_trace
+
#endif /* !defined(IGNORE_ETH0_DOWN) */
/* Expect app to have torn down any connection before calling */
/* Stop the bus, disable F2 */
dhd_bus_stop(bus, FALSE);
+wchg_trace
#if defined(OOB_INTR_ONLY)
/* Clean up any pending IRQ */
bcmsdh_set_irq(FALSE);
#endif /* defined(OOB_INTR_ONLY) */
+ wchg_trace
/* Clean tx/rx buffer pointers, detach from the dongle */
dhdsdio_release_dongle(bus, bus->dhd->osh, TRUE, TRUE);
+ wchg_trace
bus->dhd->dongle_reset = TRUE;
bus->dhd->up = FALSE;
+ wchg_trace
dhd_os_sdunlock(dhdp);
+ wchg_trace
+
DHD_TRACE(("%s: WLAN OFF DONE\n", __FUNCTION__));
/* App can now remove power from device */
} else
bcmerror = BCME_SDIO_ERROR;
+ wchg_trace
} else {
/* App must have restored power to device before calling */
@@ -6331,6 +6373,7 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
dhdsdio_download_firmware(bus, bus->dhd->osh, bus->sdh)) {
/* Re-init bus, enable F2 transfer */
+
bcmerror = dhd_bus_init((dhd_pub_t *) bus->dhd, FALSE);
if (bcmerror == BCME_OK) {
#if defined(OOB_INTR_ONLY)
@@ -6375,15 +6418,6 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
return bcmerror;
}
-/* Get Chip ID version */
-uint dhd_bus_chip_id(dhd_pub_t *dhdp)
-{
- dhd_bus_t *bus = dhdp->bus;
-
- return bus->sih->chip;
-}
-
-
int
dhd_bus_membytes(dhd_pub_t *dhdp, bool set, uint32 address, uint8 *data, uint size)
{
diff --git a/drivers/net/wireless/bcmdhd/include/bcmdevs.h b/drivers/net/wireless/bcmdhd/include/bcmdevs.h
index cdfc5fe6c8fd..287f1c65fc9a 100755
--- a/drivers/net/wireless/bcmdhd/include/bcmdevs.h
+++ b/drivers/net/wireless/bcmdhd/include/bcmdevs.h
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmdevs.h 332966 2012-05-11 22:40:21Z $
+ * $Id: bcmdevs.h 295140 2011-11-09 17:22:01Z $
*/
@@ -373,7 +373,6 @@
#define BFL2_EXTLNA_TX 0x08000000
#define BFL2_4313_RADIOREG 0x10000000
-#define BFL2_SECI_LOPWR_DIS 0x20000000
diff --git a/drivers/net/wireless/bcmdhd/include/bcmsdh_sdmmc.h b/drivers/net/wireless/bcmdhd/include/bcmsdh_sdmmc.h
index db8ea596304c..4f251e8d25f4 100755
--- a/drivers/net/wireless/bcmdhd/include/bcmsdh_sdmmc.h
+++ b/drivers/net/wireless/bcmdhd/include/bcmsdh_sdmmc.h
@@ -21,13 +21,13 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh_sdmmc.h 314048 2012-02-09 20:31:56Z $
+ * $Id: bcmsdh_sdmmc.h 277737 2011-08-16 17:54:59Z $
*/
#ifndef __BCMSDH_SDMMC_H__
#define __BCMSDH_SDMMC_H__
-#define sd_err(x)
+#define sd_err(x) printk x
#define sd_trace(x)
#define sd_info(x)
#define sd_debug(x)
@@ -82,10 +82,9 @@ struct sdioh_info {
uint8 num_funcs; /* Supported funcs on client */
uint32 com_cis_ptr;
uint32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
-
-#define SDIOH_SDMMC_MAX_SG_ENTRIES 32
- struct scatterlist sg_list[SDIOH_SDMMC_MAX_SG_ENTRIES];
- bool use_rxchain;
+ uint max_dma_len;
+ uint max_dma_descriptors; /* DMA Descriptors supported by this controller. */
+// SDDMA_DESCRIPTOR SGList[32]; /* Scatter/Gather DMA List */
};
/************************************************************
diff --git a/drivers/net/wireless/bcmdhd/include/bcmsdstd.h b/drivers/net/wireless/bcmdhd/include/bcmsdstd.h
index c7382540b84f..c14444c57d36 100755
--- a/drivers/net/wireless/bcmdhd/include/bcmsdstd.h
+++ b/drivers/net/wireless/bcmdhd/include/bcmsdstd.h
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdstd.h 324819 2012-03-30 12:15:19Z $
+ * $Id: bcmsdstd.h 281604 2011-09-02 18:58:49Z $
*/
#ifndef _BCM_SD_STD_H
#define _BCM_SD_STD_H
@@ -180,9 +180,6 @@ struct sdioh_info {
#define DATA_TRANSFER_IDLE 0
#define DATA_TRANSFER_ONGOING 1
-#define CHECK_TUNING_PRE_DATA 1
-#define CHECK_TUNING_POST_DATA 2
-
/************************************************************
* Internal interfaces: per-port references into bcmsdstd.c
@@ -230,12 +227,10 @@ extern int sdstd_waitbits(sdioh_info_t *sd, uint16 norm, uint16 err, bool yield,
extern void sdstd_3_enable_retuning_int(sdioh_info_t *sd);
extern void sdstd_3_disable_retuning_int(sdioh_info_t *sd);
extern bool sdstd_3_is_retuning_int_set(sdioh_info_t *sd);
-extern void sdstd_3_check_and_do_tuning(sdioh_info_t *sd, int tuning_param);
extern bool sdstd_3_check_and_set_retuning(sdioh_info_t *sd);
extern int sdstd_3_get_tune_state(sdioh_info_t *sd);
extern int sdstd_3_get_data_state(sdioh_info_t *sd);
extern void sdstd_3_set_tune_state(sdioh_info_t *sd, int state);
-extern void sdstd_3_set_data_state(sdioh_info_t *sd, int state);
extern uint8 sdstd_3_get_tuning_exp(sdioh_info_t *sd);
extern uint32 sdstd_3_get_uhsi_clkmode(sdioh_info_t *sd);
extern int sdstd_3_clk_tuning(sdioh_info_t *sd, uint32 sd3ClkMode);
diff --git a/drivers/net/wireless/bcmdhd/include/dhdioctl.h b/drivers/net/wireless/bcmdhd/include/dhdioctl.h
index 175ff8545a0c..0312d2206013 100755
--- a/drivers/net/wireless/bcmdhd/include/dhdioctl.h
+++ b/drivers/net/wireless/bcmdhd/include/dhdioctl.h
@@ -25,7 +25,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhdioctl.h 323572 2012-03-26 06:28:14Z $
+ * $Id: dhdioctl.h 307573 2012-01-12 00:04:39Z $
*/
#ifndef _dhdioctl_h_
@@ -87,8 +87,7 @@ enum {
#define DHD_BTA_VAL 0x1000
#define DHD_ISCAN_VAL 0x2000
#define DHD_ARPOE_VAL 0x4000
-#define DHD_REORDER_VAL 0x8000
-#define DHD_WL_VAL 0x10000
+#define DHD_WL_VAL 0x8000
#ifdef SDTEST
/* For pktgen iovar */
diff --git a/drivers/net/wireless/bcmdhd/include/epivers.h b/drivers/net/wireless/bcmdhd/include/epivers.h
index da79807702a9..596ce7d861c9 100755
--- a/drivers/net/wireless/bcmdhd/include/epivers.h
+++ b/drivers/net/wireless/bcmdhd/include/epivers.h
@@ -33,17 +33,17 @@
#define EPI_RC_NUMBER 195
-#define EPI_INCREMENTAL_NUMBER 89
+#define EPI_INCREMENTAL_NUMBER 26
-#define EPI_BUILD_NUMBER 0
+#define EPI_BUILD_NUMBER 4
-#define EPI_VERSION 5, 90, 195, 89
+#define EPI_VERSION 5, 90, 195, 26
-#define EPI_VERSION_NUM 0x055ac359
+#define EPI_VERSION_NUM 0x055ac31a
#define EPI_VERSION_DEV 5.90.195
-#define EPI_VERSION_STR "5.90.195.89"
+#define EPI_VERSION_STR "5.90.195.26.1"
#endif
diff --git a/drivers/net/wireless/bcmdhd/include/epivers.sh b/drivers/net/wireless/bcmdhd/include/epivers.sh
deleted file mode 100755
index 714a725530a9..000000000000
--- a/drivers/net/wireless/bcmdhd/include/epivers.sh
+++ /dev/null
@@ -1,268 +0,0 @@
-#! /bin/bash
-#
-# Create the epivers.h file from epivers.h.in
-#
-# Epivers.h generation mechanism supports svn based checkouts
-#
-# $Id: epivers.sh 283097 2011-09-12 23:45:38Z $
-#
-# GetCompVer.py return value and action needed
-# i. trunk => use current date as version string
-# ii. local => use SVNURL expanded by HeadURL keyword
-# iii. <tag> => use it as as is
-# (some components can override and say give me native ver)
-# iv. empty =>
-# a) If TAG is specified use it
-# a) If no TAG is specified use date
-#
-
-# If the version header file already exists, increment its build number.
-# Otherwise, create a new file.
-if [ -f epivers.h ]; then
- build=`grep EPI_BUILD_NUMBER epivers.h | sed -e "s,.*BUILD_NUMBER[ ]*,,"`
- build=`expr ${build} + 1`
- echo build=${build}
- sed -e "s,.*_BUILD_NUMBER.*,#define EPI_BUILD_NUMBER ${build}," \
- < epivers.h > epivers.h.new
- mv epivers.h epivers.h.prev
- mv epivers.h.new epivers.h
- exit 0
-
-else # epivers.h doesn't exist
-
- NULL="/dev/null"
- svncmd="svn --non-interactive"
-
- # Check for the in file, if not there we're in the wrong directory
- if [ ! -f epivers.h.in ]; then
- echo No epivers.h.in found
- exit 1
- fi
-
- # Following SVNURL should be expanded on checkout
- SVNURL='$HeadURL: http://svn.sj.broadcom.com/svn/wlansvn/proj/tags/FALCON/FALCON_REL_5_90_195_89/src/include/epivers.sh $'
-
- # If SVNURL isn't expanded, extract it from svn info
- if echo "$SVNURL" | grep -vq "HeadURL.*/proj/.*"; then
- [ -n "$VERBOSE" ] && \
- echo "DBG: SVN URL wasn't expanded. Getting it from svn info"
- SVNURL=$($svncmd info epivers.sh 2> $NULL | egrep "^URL:")
- fi
-
- if echo "${TAG}" | grep -q "BRANCH\|TWIG"; then
- branchtag=$TAG
- else
- branchtag=""
- fi
-
- # If this is a tagged build, use the tag to supply the numbers
- # Tag should be in the form
- # <NAME>_REL_<MAJ>_<MINOR>
- # or
- # <NAME>_REL_<MAJ>_<MINOR>_RC<RCNUM>
- # or
- # <NAME>_REL_<MAJ>_<MINOR>_RC<RCNUM>_<INCREMENTAL>
-
- SRCBASE=..
- MERGERLOG=${SRCBASE}/../merger_sources.log
- GETCOMPVER=getcompver.py
- GETCOMPVER_NET=/projects/hnd_software/gallery/src/tools/build/$GETCOMPVER
- GETCOMPVER_NET_WIN=Z:${GETCOMPVER_NET}
-
- #
- # If there is a local copy GETCOMPVER use it ahead of network copy
- #
- if [ -s "$GETCOMPVER" ]; then
- GETCOMPVER_PATH="$GETCOMPVER"
- elif [ -s "${SRCBASE}/../src/tools/build/$GETCOMPVER" ]; then
- GETCOMPVER_PATH="${SRCBASE}/../src/tools/build/$GETCOMPVER"
- elif [ -s "$GETCOMPVER_NET" ]; then
- GETCOMPVER_PATH="$GETCOMPVER_NET"
- elif [ -s "$GETCOMPVER_NET_WIN" ]; then
- GETCOMPVER_PATH="$GETCOMPVER_NET_WIN"
- fi
-
- #
- # If $GETCOMPVER isn't found, fetch it from SVN
- # (this should be very rare)
- #
- if [ ! -s "$GETCOMPVER_PATH" ]; then
- [ -n "$VERBOSE" ] && \
- echo "DBG: Fetching $GETCOMPVER from trunk"
-
- $svncmd export -q \
- ^/proj/trunk/src/tools/build/${GETCOMPVER} \
- ${GETCOMPVER} 2> $NULL
-
- GETCOMPVER_PATH=$GETCOMPVER
- fi
-
- # Now get tag for src/include from automerger log
- [ -n "$VERBOSE" ] && \
- echo "DBG: python $GETCOMPVER_PATH $MERGERLOG src/include"
-
- COMPTAG=$(python $GETCOMPVER_PATH $MERGERLOG src/include 2> $NULL)
-
- echo "DBG: Component Tag String Derived = $COMPTAG"
-
- # Process COMPTAG values
- # Rule:
- # If trunk is returned, use date as component tag
- # If LOCAL_COMPONENT is returned, use SVN URL to get native tag
- # If component is returned or empty, assign it to SVNTAG
- # GetCompVer.py return value and action needed
- # i. trunk => use current date as version string
- # ii. local => use SVNURL expanded by HeadURL keyword
- # iii. <tag> => use it as as is
- # iv. empty =>
- # a) If TAG is specified use it
- # a) If no TAG is specified use SVNURL from HeadURL
-
- SVNURL_VER=false
-
- if [ "$COMPTAG" == "" ]; then
- SVNURL_VER=true
- elif [ "$COMPTAG" == "LOCAL_COMPONENT" ]; then
- SVNURL_VER=true
- elif [ "$COMPTAG" == "trunk" ]; then
- SVNTAG=$(date '+TRUNKCOMP_REL_%Y_%m_%d')
- else
- SVNTAG=$COMPTAG
- fi
-
- # TODO Some of the echo statements will be removed, once
- # TODO SVN transition matures
- if [ "$SVNURL_VER" == "true" ]; then
- case "${SVNURL}" in
- */branches/*)
- SVNTAG=$(echo $SVNURL | sed -e 's%.*/branches/\(.*\)/src.*%\1%g' | xargs printf "%s")
- ;;
- */tags/*)
- SVNTAG=$(echo $SVNURL | sed -e 's%.*/tags/.*/\(.*\)/src.*%\1%g' | xargs printf "%s")
- ;;
- */trunk/*)
- SVNTAG=$(date '+TRUNKURL_REL_%Y_%m_%d')
- ;;
- *)
- SVNTAG=$(date '+OTHER_REL_%Y_%m_%d')
- ;;
- esac
- echo "DBG: Native Tag String Derived from URL: $SVNTAG"
- else
- echo "DBG: Native Tag String Derived: $SVNTAG"
- fi
-
- TAG=${SVNTAG}
-
- # Normalize the branch name portion to "D11" in case it has underscores in it
- branch_name=`expr match "$TAG" '\(.*\)_\(BRANCH\|TWIG\|REL\)_.*'`
- TAG=`echo $TAG | sed -e "s%^$branch_name%D11%"`
-
- # Split the tag into an array on underbar or whitespace boundaries.
- IFS="_ " tag=(${TAG})
- unset IFS
-
- tagged=1
- if [ ${#tag[*]} -eq 0 ]; then
- tag=(`date '+TOT REL %Y %m %d 0 %y'`);
- # reconstruct a TAG from the date
- TAG=${tag[0]}_${tag[1]}_${tag[2]}_${tag[3]}_${tag[4]}_${tag[5]}
- tagged=0
- fi
-
- # Allow environment variable to override values.
- # Missing values default to 0
- #
- maj=${EPI_MAJOR_VERSION:-${tag[2]:-0}}
- min=${EPI_MINOR_VERSION:-${tag[3]:-0}}
- rcnum=${EPI_RC_NUMBER:-${tag[4]:-0}}
-
- # If increment field is 0, set it to date suffix if on TOB
- if [ -n "$branchtag" ]; then
- [ "${tag[5]:-0}" -eq 0 ] && echo "Using date suffix for incr"
- today=`date '+%Y%m%d'`
- incremental=${EPI_INCREMENTAL_NUMBER:-${tag[5]:-${today:-0}}}
- else
- incremental=${EPI_INCREMENTAL_NUMBER:-${tag[5]:-0}}
- fi
- origincr=${EPI_INCREMENTAL_NUMBER:-${tag[5]:-0}}
- build=${EPI_BUILD_NUMBER:-0}
-
- # Strip 'RC' from front of rcnum if present
- rcnum=${rcnum/#RC/}
-
- # strip leading zero off the number (otherwise they look like octal)
- maj=${maj/#0/}
- min=${min/#0/}
- rcnum=${rcnum/#0/}
- incremental=${incremental/#0/}
- origincr=${origincr/#0/}
- build=${build/#0/}
-
- # some numbers may now be null. replace with with zero.
- maj=${maj:-0}
- min=${min:-0}
-
- rcnum=${rcnum:-0}
- incremental=${incremental:-0}
- origincr=${origincr:-0}
- build=${build:-0}
-
- if [ ${tagged} -eq 1 ]; then
- # vernum is 32chars max
- vernum=`printf "0x%02x%02x%02x%02x" ${maj} ${min} ${rcnum} ${origincr}`
- else
- vernum=`printf "0x00%02x%02x%02x" ${tag[7]} ${min} ${rcnum}`
- fi
-
- # make sure the size of vernum is under 32 bits.
- # Otherwise, truncate. The string will keep full information.
- vernum=${vernum:0:10}
-
- # build the string directly from the tag, irrespective of its length
- # remove the name , the tag type, then replace all _ by .
- tag_ver_str=${TAG/${tag[0]}_}
- tag_ver_str=${tag_ver_str/${tag[1]}_}
- tag_ver_str=${tag_ver_str//_/.}
-
- # record tag type
- tagtype=
-
- if [ "${tag[1]}" = "BRANCH" -o "${tag[1]}" = "TWIG" ]; then
- tagtype=" (TOB)"
- echo "tag type: $tagtype"
- fi
-
- echo "Effective version string: $tag_ver_str"
-
- if [ "$(uname -s)" == "Darwin" ]; then
- # Mac does not like 2-digit numbers so convert the number to single
- # digit. 5.100 becomes 5.1
- if [ $min -gt 99 ]; then
- minmac=`expr $min / 100`
- else
- minmac=$min
- fi
- epi_ver_dev="${maj}.${minmac}.0"
- else
- epi_ver_dev="${maj}.${min}.${rcnum}"
- fi
-
- # OK, go do it
- echo "maj=${maj}, min=${min}, rc=${rcnum}, inc=${incremental}, build=${build}"
-
- sed \
- -e "s;@EPI_MAJOR_VERSION@;${maj};" \
- -e "s;@EPI_MINOR_VERSION@;${min};" \
- -e "s;@EPI_RC_NUMBER@;${rcnum};" \
- -e "s;@EPI_INCREMENTAL_NUMBER@;${incremental};" \
- -e "s;@EPI_BUILD_NUMBER@;${build};" \
- -e "s;@EPI_VERSION@;${maj}, ${min}, ${rcnum}, ${incremental};" \
- -e "s;@EPI_VERSION_STR@;${tag_ver_str};" \
- -e "s;@EPI_VERSION_TYPE@;${tagtype};" \
- -e "s;@VERSION_TYPE@;${tagtype};" \
- -e "s;@EPI_VERSION_NUM@;${vernum};" \
- -e "s;@EPI_VERSION_DEV@;${epi_ver_dev};" \
- < epivers.h.in > epivers.h
-
-fi # epivers.h
diff --git a/drivers/net/wireless/bcmdhd/include/hndpmu.h b/drivers/net/wireless/bcmdhd/include/hndpmu.h
index 9bfc8c9275a9..69a834c6b7eb 100755
--- a/drivers/net/wireless/bcmdhd/include/hndpmu.h
+++ b/drivers/net/wireless/bcmdhd/include/hndpmu.h
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: hndpmu.h 335486 2012-05-28 09:47:55Z $
+ * $Id: hndpmu.h 277737 2011-08-16 17:54:59Z $
*/
#ifndef _hndpmu_h_
@@ -31,7 +31,4 @@
extern void si_pmu_otp_power(si_t *sih, osl_t *osh, bool on);
extern void si_sdiod_drive_strength_init(si_t *sih, osl_t *osh, uint32 drivestrength);
-extern void si_pmu_set_otp_wr_volts(si_t *sih);
-extern void si_pmu_set_otp_rd_volts(si_t *sih);
-
#endif /* _hndpmu_h_ */
diff --git a/drivers/net/wireless/bcmdhd/include/epivers.h.in b/drivers/net/wireless/bcmdhd/include/htsf.h
index b9452316f4d1..d875edb816c9 100755
--- a/drivers/net/wireless/bcmdhd/include/epivers.h.in
+++ b/drivers/net/wireless/bcmdhd/include/htsf.h
@@ -1,4 +1,6 @@
/*
+ * Time stamps for latency measurements
+ *
* Copyright (C) 1999-2011, Broadcom Corporation
*
* Unless you and Broadcom execute a separate written software license
@@ -19,31 +21,54 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: epivers.h.in 277737 2011-08-16 17:54:59Z $
- *
-*/
-
-
-#ifndef _epivers_h_
-#define _epivers_h_
-
-#define EPI_MAJOR_VERSION @EPI_MAJOR_VERSION@
-
-#define EPI_MINOR_VERSION @EPI_MINOR_VERSION@
-
-#define EPI_RC_NUMBER @EPI_RC_NUMBER@
-
-#define EPI_INCREMENTAL_NUMBER @EPI_INCREMENTAL_NUMBER@
-
-#define EPI_BUILD_NUMBER @EPI_BUILD_NUMBER@
-
-#define EPI_VERSION @EPI_VERSION@
-
-#define EPI_VERSION_NUM @EPI_VERSION_NUM@
+ * $Id: htsf.h 277737 2011-08-16 17:54:59Z $
+ */
+#ifndef _HTSF_H_
+#define _HTSF_H_
-#define EPI_VERSION_DEV @EPI_VERSION_DEV@
+#define HTSFMAGIC 0xCDCDABAB /* in network order for tcpdump */
+#define HTSFENDMAGIC 0xEFEFABAB /* to distinguish from RT2 magic */
+#define HTSF_HOSTOFFSET 102
+#define HTSF_DNGLOFFSET HTSF_HOSTOFFSET - 4
+#define HTSF_DNGLOFFSET2 HTSF_HOSTOFFSET + 106
+#define HTSF_MIN_PKTLEN 200
+#define ETHER_TYPE_BRCM_PKTDLYSTATS 0x886d
+typedef enum htsfts_type {
+ T10,
+ T20,
+ T30,
+ T40,
+ T50,
+ T60,
+ T70,
+ T80,
+ T90,
+ TA0,
+ TE0
+} htsf_timestamp_t;
-#define EPI_VERSION_STR "@EPI_VERSION_STR@@EPI_VERSION_TYPE@"
+typedef struct {
+ uint32 magic;
+ uint32 prio;
+ uint32 seqnum;
+ uint32 misc;
+ uint32 c10;
+ uint32 t10;
+ uint32 c20;
+ uint32 t20;
+ uint32 t30;
+ uint32 t40;
+ uint32 t50;
+ uint32 t60;
+ uint32 t70;
+ uint32 t80;
+ uint32 t90;
+ uint32 cA0;
+ uint32 tA0;
+ uint32 cE0;
+ uint32 tE0;
+ uint32 endmagic;
+} htsfts_t;
-#endif
+#endif /* _HTSF_H_ */
diff --git a/drivers/net/wireless/bcmdhd/include/sbchipc.h b/drivers/net/wireless/bcmdhd/include/sbchipc.h
index aa4df443e139..8f757509b95d 100755
--- a/drivers/net/wireless/bcmdhd/include/sbchipc.h
+++ b/drivers/net/wireless/bcmdhd/include/sbchipc.h
@@ -5,7 +5,7 @@
* JTAG, 0/1/2 UARTs, clock frequency control, a watchdog interrupt timer,
* GPIO interface, extbus, and support for serial and parallel flashes.
*
- * $Id: sbchipc.h 333924 2012-05-18 04:48:52Z $
+ * $Id: sbchipc.h 311371 2012-01-28 05:47:25Z $
*
* Copyright (C) 1999-2011, Broadcom Corporation
*
@@ -1441,17 +1441,17 @@ typedef volatile struct {
#define CCTRL4331_EXT_LNA_G (1<<2)
#define CCTRL4331_SPROM_GPIO13_15 (1<<3)
#define CCTRL4331_EXTPA_EN (1<<4)
-#define CCTRL4331_GPIOCLK_ON_SPROMCS (1<<5)
+#define CCTRL4331_GPIOCLK_ON_SPROMCS <1<<5)
#define CCTRL4331_PCIE_MDIO_ON_SPROMCS (1<<6)
#define CCTRL4331_EXTPA_ON_GPIO2_5 (1<<7)
#define CCTRL4331_OVR_PIPEAUXCLKEN (1<<8)
#define CCTRL4331_OVR_PIPEAUXPWRDOWN (1<<9)
-#define CCTRL4331_PCIE_AUXCLKEN (1<<10)
-#define CCTRL4331_PCIE_PIPE_PLLDOWN (1<<11)
+#define CCTRL4331_PCIE_AUXCLKEN <1<<10)
+#define CCTRL4331_PCIE_PIPE_PLLDOWN <1<<11)
#define CCTRL4331_EXTPA_EN2 (1<<12)
#define CCTRL4331_EXT_LNA_A (1<<13)
-#define CCTRL4331_BT_SHD0_ON_GPIO4 (1<<16)
-#define CCTRL4331_BT_SHD1_ON_GPIO5 (1<<17)
+#define CCTRL4331_BT_SHD0_ON_GPIO4 <1<<16)
+#define CCTRL4331_BT_SHD1_ON_GPIO5 <1<<17)
#define CCTRL4331_EXTPA_ANA_EN (1<<24)
diff --git a/drivers/net/wireless/bcmdhd/include/siutils.h b/drivers/net/wireless/bcmdhd/include/siutils.h
index 4e7aeb71cb02..6a7b93c7b977 100755
--- a/drivers/net/wireless/bcmdhd/include/siutils.h
+++ b/drivers/net/wireless/bcmdhd/include/siutils.h
@@ -22,7 +22,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: siutils.h 335486 2012-05-28 09:47:55Z $
+ * $Id: siutils.h 285387 2011-09-21 18:38:37Z $
*/
@@ -222,8 +222,6 @@ static INLINE void * si_seci_init(si_t *sih, uint8 use_seci) {return NULL;}
extern bool si_is_otp_disabled(si_t *sih);
extern bool si_is_otp_powered(si_t *sih);
extern void si_otp_power(si_t *sih, bool on);
-extern void si_set_otp_wr_volts(si_t *sih);
-extern void si_set_otp_rd_volts(si_t *sih);
extern bool si_is_sprom_available(si_t *sih);
diff --git a/drivers/net/wireless/bcmdhd/include/wlioctl.h b/drivers/net/wireless/bcmdhd/include/wlioctl.h
index fd2dbb7d42f6..29fc5a99245c 100755
--- a/drivers/net/wireless/bcmdhd/include/wlioctl.h
+++ b/drivers/net/wireless/bcmdhd/include/wlioctl.h
@@ -24,7 +24,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: wlioctl.h 331292 2012-05-04 09:04:23Z $
+ * $Id: wlioctl.h 307468 2012-01-11 18:29:27Z $
*/
@@ -1225,7 +1225,7 @@ typedef struct {
#define WL_AUTH_OPEN_SYSTEM 0
#define WL_AUTH_SHARED_KEY 1
-#define WL_AUTH_OPEN_SHARED 2
+#define WL_AUTH_OPEN_SHARED 3
#define WL_RADIO_SW_DISABLE (1<<0)
@@ -1472,14 +1472,6 @@ typedef struct wl_sampledata {
} wl_sampledata_t;
-#define WL_CHAN_VALID_HW (1 << 0)
-#define WL_CHAN_VALID_SW (1 << 1)
-#define WL_CHAN_BAND_5G (1 << 2)
-#define WL_CHAN_RADAR (1 << 3)
-#define WL_CHAN_INACTIVE (1 << 4)
-#define WL_CHAN_PASSIVE (1 << 5)
-#define WL_CHAN_RESTRICTED (1 << 6)
-
#define WL_ERROR_VAL 0x00000001
#define WL_TRACE_VAL 0x00000002
diff --git a/drivers/net/wireless/bcmdhd/mk.sh b/drivers/net/wireless/bcmdhd/mk.sh
new file mode 100755
index 000000000000..6b361f0850dd
--- /dev/null
+++ b/drivers/net/wireless/bcmdhd/mk.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+make -C /opt/google/ics/kernel/omap M=`pwd` ARCH=arm CROSS_COMPILE=/opt/google/ics/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- $1
+
diff --git a/drivers/net/wireless/bcmdhd/siutils.c b/drivers/net/wireless/bcmdhd/siutils.c
index 838a219279c9..dc2607edcb46 100755
--- a/drivers/net/wireless/bcmdhd/siutils.c
+++ b/drivers/net/wireless/bcmdhd/siutils.c
@@ -170,7 +170,7 @@ si_buscore_prep(si_info_t *sii, uint bustype, uint devid, void *sdh)
}
/* Also, disable the extra SDIO pull-ups */
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SDIOPULLUP, 0, NULL);
+ bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SDIOPULLUP, 1, NULL);
}
diff --git a/drivers/net/wireless/bcmdhd/wl_android.c b/drivers/net/wireless/bcmdhd/wl_android.c
index b39a93811f21..cbf518f052ee 100755
--- a/drivers/net/wireless/bcmdhd/wl_android.c
+++ b/drivers/net/wireless/bcmdhd/wl_android.c
@@ -67,16 +67,12 @@
#define CMD_BTCOEXSCAN_STOP "BTCOEXSCAN-STOP"
#define CMD_BTCOEXMODE "BTCOEXMODE"
#define CMD_SETSUSPENDOPT "SETSUSPENDOPT"
-#define CMD_SETSUSPENDMODE "SETSUSPENDMODE"
#define CMD_P2P_DEV_ADDR "P2P_DEV_ADDR"
#define CMD_SETFWPATH "SETFWPATH"
#define CMD_SETBAND "SETBAND"
#define CMD_GETBAND "GETBAND"
#define CMD_COUNTRY "COUNTRY"
#define CMD_P2P_SET_NOA "P2P_SET_NOA"
-#if !defined WL_ENABLE_P2P_IF
-#define CMD_P2P_GET_NOA "P2P_GET_NOA"
-#endif
#define CMD_P2P_SET_PS "P2P_SET_PS"
#define CMD_SET_AP_WPS_P2P_IE "SET_AP_WPS_P2P_IE"
@@ -115,7 +111,7 @@ typedef struct android_wifi_priv_cmd {
*/
void dhd_customer_gpio_wlan_ctrl(int onoff);
uint dhd_dev_reset(struct net_device *dev, uint8 flag);
-int dhd_dev_init_ioctl(struct net_device *dev);
+void dhd_dev_init_ioctl(struct net_device *dev);
#ifdef WL_CFG80211
int wl_cfg80211_get_p2p_dev_addr(struct net_device *net, struct ether_addr *p2pdev_addr);
int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, char *command);
@@ -205,7 +201,7 @@ static int wl_android_set_suspendopt(struct net_device *dev, char *command, int
ret_now = net_os_set_suspend_disable(dev, suspend_flag);
if (ret_now != suspend_flag) {
- if (!(ret = net_os_set_suspend(dev, ret_now, 1)))
+ if (!(ret = net_os_set_suspend(dev, ret_now)))
DHD_INFO(("%s: Suspend Flag %d -> %d\n",
__FUNCTION__, ret_now, suspend_flag));
else
@@ -214,25 +210,6 @@ static int wl_android_set_suspendopt(struct net_device *dev, char *command, int
return ret;
}
-static int wl_android_set_suspendmode(struct net_device *dev, char *command, int total_len)
-{
- int ret = 0;
-
-#if !defined(CONFIG_HAS_EARLYSUSPEND) || !defined(DHD_USE_EARLYSUSPEND)
- int suspend_flag;
-
- suspend_flag = *(command + strlen(CMD_SETSUSPENDMODE) + 1) - '0';
-
- if (suspend_flag != 0)
- suspend_flag = 1;
-
- if (!(ret = net_os_set_suspend(dev, suspend_flag, 0)))
- DHD_INFO(("%s: Suspend Mode %d\n",__FUNCTION__,suspend_flag));
- else
- DHD_ERROR(("%s: failed %d\n",__FUNCTION__,ret));
-#endif
- return ret;
-}
static int wl_android_get_band(struct net_device *dev, char *command, int total_len)
{
uint band;
@@ -246,7 +223,7 @@ static int wl_android_get_band(struct net_device *dev, char *command, int total_
return bytes_written;
}
-#if defined(PNO_SUPPORT) && !defined(WL_SCHED_SCAN)
+#ifdef PNO_SUPPORT
static int wl_android_set_pno_setup(struct net_device *dev, char *command, int total_len)
{
wlc_ssid_t ssids_local[MAX_PFN_LIST_COUNT];
@@ -353,7 +330,7 @@ static int wl_android_set_pno_setup(struct net_device *dev, char *command, int t
exit_proc:
return res;
}
-#endif /* PNO_SUPPORT && !WL_SCHED_SCAN */
+#endif /* PNO_SUPPORT */
static int wl_android_get_p2p_dev_addr(struct net_device *ndev, char *command, int total_len)
{
@@ -387,10 +364,8 @@ int wl_android_wifi_on(struct net_device *dev)
sdioh_start(NULL, 0);
ret = dhd_dev_reset(dev, FALSE);
sdioh_start(NULL, 1);
- if (!ret) {
- if ((dhd_dev_init_ioctl(dev)) < 0)
- ret = -EFAULT;
- }
+ if (!ret)
+ dhd_dev_init_ioctl(dev);
g_wifi_on = 1;
}
dhd_net_if_unlock(dev);
@@ -416,7 +391,7 @@ int wl_android_wifi_off(struct net_device *dev)
g_wifi_on = 0;
}
dhd_net_if_unlock(dev);
- bcm_mdelay(500);
+
return ret;
}
@@ -531,9 +506,6 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
else if (strnicmp(command, CMD_SETSUSPENDOPT, strlen(CMD_SETSUSPENDOPT)) == 0) {
bytes_written = wl_android_set_suspendopt(net, command, priv_cmd.total_len);
}
- else if (strnicmp(command, CMD_SETSUSPENDMODE, strlen(CMD_SETSUSPENDMODE)) == 0) {
- bytes_written = wl_android_set_suspendmode(net, command, priv_cmd.total_len);
- }
else if (strnicmp(command, CMD_SETBAND, strlen(CMD_SETBAND)) == 0) {
uint band = *(command + strlen(CMD_SETBAND) + 1) - '0';
bytes_written = wldev_set_band(net, band);
@@ -544,11 +516,8 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
else if (strnicmp(command, CMD_COUNTRY, strlen(CMD_COUNTRY)) == 0) {
char *country_code = command + strlen(CMD_COUNTRY) + 1;
bytes_written = wldev_set_country(net, country_code);
-#ifdef WL_CFG80211
- wl_update_wiphybands(NULL);
-#endif
}
-#if defined(PNO_SUPPORT) && !defined(WL_SCHED_SCAN)
+#ifdef PNO_SUPPORT
else if (strnicmp(command, CMD_PNOSSIDCLR_SET, strlen(CMD_PNOSSIDCLR_SET)) == 0) {
bytes_written = dhd_dev_pno_reset(net);
}
@@ -568,11 +537,6 @@ int wl_android_priv_cmd(struct net_device *net, struct ifreq *ifr, int cmd)
bytes_written = wl_cfg80211_set_p2p_noa(net, command + skip,
priv_cmd.total_len - skip);
}
-#if !defined WL_ENABLE_P2P_IF
- else if (strnicmp(command, CMD_P2P_GET_NOA, strlen(CMD_P2P_GET_NOA)) == 0) {
- bytes_written = wl_cfg80211_get_p2p_noa(net, command, priv_cmd.total_len);
- }
-#endif
else if (strnicmp(command, CMD_P2P_SET_PS, strlen(CMD_P2P_SET_PS)) == 0) {
int skip = strlen(CMD_P2P_SET_PS) + 1;
bytes_written = wl_cfg80211_set_p2p_ps(net, command + skip,
@@ -624,7 +588,7 @@ int wl_android_init(void)
{
int ret = 0;
- dhd_msg_level |= DHD_ERROR_VAL;
+ dhd_msg_level = DHD_ERROR_VAL;
#ifdef ENABLE_INSMOD_NO_FW_LOAD
dhd_download_fw_on_driverload = FALSE;
#endif /* ENABLE_INSMOD_NO_FW_LOAD */
@@ -648,10 +612,8 @@ void wl_android_post_init(void)
{
if (!dhd_download_fw_on_driverload) {
/* Call customer gpio to turn off power with WL_REG_ON signal */
-
- msleep(100); //add for insmod driver fail magic
+ msleep(100);
sdioh_stop(NULL);
-
dhd_customer_gpio_wlan_ctrl(WLAN_RESET_OFF);
g_wifi_on = 0;
}
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
index efb1267a0a2f..c4209e7d4f17 100755
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c
@@ -86,11 +86,6 @@
#ifndef IW_AUTH_KEY_MGMT_WAPI_CERT
#define IW_AUTH_KEY_MGMT_WAPI_CERT 8
#endif
-
-#ifndef BCMWAPI_CONFIG_RETRY
-#define BCMWAPI_CONFIG_RETRY 4
-#endif
-
#endif /* BCMWAPI_WPI */
#ifdef BCMWAPI_WPI
@@ -107,20 +102,25 @@ struct wl_priv *wlcfg_drv_priv = NULL;
static u8 ap_resp_ie[256];
static int ap_resp_ie_len = 0;
-u32 wl_dbg_level = WL_DBG_ERR;
+u32 wl_dbg_level = WL_DBG_ERR; //| WL_DBG_TRACE | WL_DBG_INFO;
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAX_WAIT_TIME 1500
#define WL_SCAN_ACTIVE_TIME 40
#define WL_SCAN_PASSIVE_TIME 130
-#define WL_FRAME_LEN 300
+
#define DNGL_FUNC(func, parameters) func parameters;
#define COEX_DHCP
+/* Set this to 1 to use a seperate interface (p2p0)
+ * for p2p operations.
+ */
+#define ENABLE_P2P_INTERFACE 0
+
/* This is to override regulatory domains defined in cfg80211 module (reg.c)
* By default world regulatory domain defined in reg.c puts the flags NL80211_RRF_PASSIVE_SCAN
* and NL80211_RRF_NO_IBSS for 5GHz channels (for 36..48 and 149..165).
@@ -128,19 +128,19 @@ u32 wl_dbg_level = WL_DBG_ERR;
* All the chnages in world regulatory domain are to be done here.
*/
static const struct ieee80211_regdomain brcm_regdom = {
- .n_reg_rules = 4,
+ .n_reg_rules = 5,
.alpha2 = "99",
.reg_rules = {
/* IEEE 802.11b/g, channels 1..11 */
- REG_RULE(2412-10, 2472+10, 40, 6, 20, 0),
+ REG_RULE(2412-10, 2462+10, 40, 6, 20, 0),
/* IEEE 802.11b/g, channels 12..13. No HT40
* channel fits here.
*/
- /* If any */
- /*
- * IEEE 802.11 channel 14 - is for JP only,
- * we need cfg80211 to allow it (reg_flags = 0); so that
- * hostapd could request auto channel by sending down ch 14
+ REG_RULE(2467-10, 2472+10, 20, 6, 20,
+ NL80211_RRF_PASSIVE_SCAN |
+ NL80211_RRF_NO_IBSS),
+ /* IEEE 802.11 channel 14 - Only JP enables
+ * this and for 802.11b only
*/
REG_RULE(2484-10, 2484+10, 20, 6, 20,
NL80211_RRF_PASSIVE_SCAN |
@@ -242,8 +242,7 @@ static s32 wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa);
static s32 wl_cfg80211_flush_pmksa(struct wiphy *wiphy,
struct net_device *dev);
-static s32 wl_notify_escan_complete(struct wl_priv *wl,
- struct net_device *ndev, bool aborted, bool fw_abort);
+static void wl_notify_escan_complete(struct wl_priv *wl, struct net_device *ndev, bool aborted);
/*
* event & event Q handlers for cfg80211 interfaces
*/
@@ -273,17 +272,10 @@ static s32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data);
static s32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data, bool completed);
-static s32 wl_ibss_join_done(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data, bool completed);
static s32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data);
static s32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data);
-#ifdef WL_SCHED_SCAN
-static s32
-wl_notify_sched_scan_results(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data);
-#endif /* WL_SCHED_SCAN */
#ifdef PNO_SUPPORT
static s32 wl_notify_pfn_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data);
@@ -344,7 +336,6 @@ static void wl_free_wdev(struct wl_priv *wl);
static s32 wl_inform_bss(struct wl_priv *wl);
static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi);
-static s32 wl_inform_ibss(struct wl_priv *wl, const u8 *bssid);
static s32 wl_update_bss_info(struct wl_priv *wl, struct net_device *ndev);
static chanspec_t wl_cfg80211_get_shared_freq(struct wiphy *wiphy);
@@ -384,6 +375,8 @@ static void wl_link_up(struct wl_priv *wl);
static void wl_link_down(struct wl_priv *wl);
static s32 wl_config_ifmode(struct wl_priv *wl, struct net_device *ndev, s32 iftype);
static void wl_init_conf(struct wl_conf *conf);
+static s32 wl_update_wiphybands(struct wl_priv *wl);
+
/*
* iscan handler
*/
@@ -562,6 +555,22 @@ static struct ieee80211_supported_band __wl_band_2ghz = {
.n_channels = ARRAY_SIZE(__wl_2ghz_channels),
.bitrates = wl_g_rates,
.n_bitrates = wl_g_rates_size
+#if ENABLE_P2P_INTERFACE
+ ,
+ /* wpa_supplicant sets wmm_enabled based on whether ht_cap
+ * is present or not. The wmm_enabled is inturn used to
+ * set the replay counters in the RSN IE. Without this
+ * the 4way handshake will fail complaining that IE in beacon
+ * doesn't match with the IE present in the 3/4 EAPOL msg.
+ */
+ .ht_cap = {
+ IEEE80211_HT_CAP_SGI_20 |
+ IEEE80211_HT_CAP_DSSSCCK40 | IEEE80211_HT_CAP_MAX_AMSDU,
+ .ht_supported = TRUE,
+ .ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
+ .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16
+ }
+#endif
};
static struct ieee80211_supported_band __wl_band_5ghz_a = {
@@ -570,6 +579,22 @@ static struct ieee80211_supported_band __wl_band_5ghz_a = {
.n_channels = ARRAY_SIZE(__wl_5ghz_a_channels),
.bitrates = wl_a_rates,
.n_bitrates = wl_a_rates_size
+#if ENABLE_P2P_INTERFACE
+ ,
+ /* wpa_supplicant sets wmm_enabled based on whether ht_cap
+ * is present or not. The wmm_enabled is inturn used to
+ * set the replay counters in the RSN IE. Without this
+ * the 4way handshake will fail complaining that IE in beacon
+ * doesn't match with the IE present in the 3/4 EAPOL msg.
+ */
+ .ht_cap = {
+ IEEE80211_HT_CAP_SGI_20 |
+ IEEE80211_HT_CAP_DSSSCCK40 | IEEE80211_HT_CAP_MAX_AMSDU,
+ .ht_supported = TRUE,
+ .ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K,
+ .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16
+ }
+#endif
};
static const u32 __wl_cipher_suites[] = {
@@ -755,7 +780,7 @@ static chanspec_t wl_cfg80211_get_shared_freq(struct wiphy *wiphy)
*(u32 *) wl->extra_buf = htod32(WL_EXTRA_BUF_MAX);
if ((err = wldev_ioctl(dev, WLC_GET_BSS_INFO, wl->extra_buf,
- WL_EXTRA_BUF_MAX, false))) {
+ sizeof(WL_EXTRA_BUF_MAX), false))) {
WL_ERR(("Failed to get associated bss info, use temp channel \n"));
chspec = wf_chspec_aton(WL_P2P_TEMP_CHAN);
}
@@ -787,9 +812,6 @@ wl_cfg80211_add_virtual_iface(struct wiphy *wiphy, char *name,
s32 timeout = -1;
s32 wlif_type = -1;
s32 mode = 0;
-#if defined(WL_ENABLE_P2P_IF)
- s32 dhd_mode = 0;
-#endif /* (WL_ENABLE_P2P_IF) */
chanspec_t chspec;
struct wl_priv *wl = wiphy_priv(wiphy);
struct net_device *_ndev;
@@ -861,7 +883,7 @@ wl_cfg80211_add_virtual_iface(struct wiphy *wiphy, char *name,
return ERR_PTR(-EAGAIN);
}
}
- if (wl->p2p && !wl->p2p->on && strstr(name, WL_P2P_INTERFACE_PREFIX)) {
+ if (!p2p_is_on(wl) && strstr(name, WL_P2P_INTERFACE_PREFIX)) {
p2p_on(wl) = true;
wl_cfgp2p_set_firm_p2p(wl);
wl_cfgp2p_init_discovery(wl);
@@ -873,8 +895,7 @@ wl_cfg80211_add_virtual_iface(struct wiphy *wiphy, char *name,
memset(wl->p2p->vir_ifname, 0, IFNAMSIZ);
strncpy(wl->p2p->vir_ifname, name, IFNAMSIZ - 1);
- wldev_iovar_setint(_ndev, "mpc", 0);
- wl_notify_escan_complete(wl, _ndev, true, true);
+
/* In concurrency case, STA may be already associated in a particular channel.
* so retrieve the current channel of primary interface and then start the virtual
* interface on that.
@@ -923,21 +944,8 @@ wl_cfg80211_add_virtual_iface(struct wiphy *wiphy, char *name,
}
if (net_attach && !net_attach(wl->pub, _ndev->ifindex)) {
wl_alloc_netinfo(wl, _ndev, vwdev, mode);
- WL_ERR((" virtual interface(%s) is "
+ WL_DBG((" virtual interface(%s) is "
"created net attach done\n", wl->p2p->vir_ifname));
-#if defined(WL_ENABLE_P2P_IF)
- if (type == NL80211_IFTYPE_P2P_CLIENT)
- dhd_mode = P2P_GC_ENABLED;
- else if (type == NL80211_IFTYPE_P2P_GO)
- dhd_mode = P2P_GO_ENABLED;
- DNGL_FUNC(dhd_cfg80211_set_p2p_info, (wl, dhd_mode));
-#endif /* (WL_ENABLE_P2P_IF) */
- /* Start the P2P I/F with PM disabled. Enable PM from
- * the framework
- */
- if ((type == NL80211_IFTYPE_P2P_CLIENT) || (
- type == NL80211_IFTYPE_P2P_GO))
- vwdev->ps = NL80211_PS_DISABLED;
} else {
/* put back the rtnl_lock again */
if (rollback_lock)
@@ -978,14 +986,9 @@ wl_cfg80211_del_virtual_iface(struct wiphy *wiphy, struct net_device *dev)
if (wl->p2p_supported) {
memcpy(p2p_mac.octet, wl->p2p->int_addr.octet, ETHER_ADDR_LEN);
-
- /* Clear GO_NEG_PHASE bit to take care of GO-NEG-FAIL cases
- */
- WL_DBG(("P2P: GO_NEG_PHASE status cleared "));
- wl_clr_p2p_status(wl, GO_NEG_PHASE);
if (wl->p2p->vif_created) {
if (wl_get_drv_status(wl, SCANNING, dev)) {
- wl_notify_escan_complete(wl, dev, true, true);
+ wl_cfg80211_scan_abort(wl, dev);
}
wldev_iovar_setint(dev, "mpc", 1);
wl_set_p2p_status(wl, IF_DELETING);
@@ -1006,13 +1009,10 @@ wl_cfg80211_del_virtual_iface(struct wiphy *wiphy, struct net_device *dev)
/* Wait for any pending scan req to get aborted from the sysioc context */
timeout = wait_event_interruptible_timeout(wl->netif_change_event,
- (wl->p2p->vif_created == false),
+ (wl_get_p2p_status(wl, IF_DELETING) == false),
msecs_to_jiffies(MAX_WAIT_TIME));
- if (timeout > 0 && (wl->p2p->vif_created == false)) {
+ if (timeout > 0 && !wl_get_p2p_status(wl, IF_DELETING)) {
WL_DBG(("IFDEL operation done\n"));
-#if defined(WL_ENABLE_P2P_IF)
- DNGL_FUNC(dhd_cfg80211_clean_p2p_info, (wl));
-#endif /* (WL_ENABLE_P2P_IF)) */
} else {
WL_ERR(("IFDEL didn't complete properly\n"));
}
@@ -1036,7 +1036,7 @@ wl_cfg80211_change_virtual_iface(struct wiphy *wiphy, struct net_device *ndev,
chanspec_t chspec;
struct wl_priv *wl = wiphy_priv(wiphy);
- WL_DBG(("Enter type %d\n", type));
+ WL_DBG(("Enter \n"));
switch (type) {
case NL80211_IFTYPE_MONITOR:
case NL80211_IFTYPE_WDS:
@@ -1062,23 +1062,20 @@ wl_cfg80211_change_virtual_iface(struct wiphy *wiphy, struct net_device *ndev,
default:
return -EINVAL;
}
- WL_DBG(("%s : ap (%d), infra (%d), iftype: (%d)\n", ndev->name, ap, infra, type));
if (ap) {
wl_set_mode_by_netdev(wl, ndev, mode);
if (wl->p2p_supported && wl->p2p->vif_created) {
WL_DBG(("p2p_vif_created (%d) p2p_on (%d)\n", wl->p2p->vif_created,
- p2p_on(wl)));
+ p2p_on(wl)));
wldev_iovar_setint(ndev, "mpc", 0);
- wl_notify_escan_complete(wl, ndev, true, true);
-
/* In concurrency case, STA may be already associated in a particular
* channel. so retrieve the current channel of primary interface and
* then start the virtual interface on that.
*/
chspec = wl_cfg80211_get_shared_freq(wiphy);
- wlif_type = WL_P2P_IF_GO;
+ wlif_type = ap ? WL_P2P_IF_GO : WL_P2P_IF_CLIENT;
WL_ERR(("%s : ap (%d), infra (%d), iftype: (%d)\n",
ndev->name, ap, infra, type));
wl_set_p2p_status(wl, IF_CHANGING);
@@ -1102,14 +1099,6 @@ wl_cfg80211_change_virtual_iface(struct wiphy *wiphy, struct net_device *ndev,
WL_ERR(("Cannot change the interface for GO or SOFTAP\n"));
return -EINVAL;
}
- } else {
- infra = htod32(infra);
- err = wldev_ioctl(ndev, WLC_SET_INFRA, &infra, sizeof(s32), true);
- if (err) {
- WL_ERR(("WLC_SET_INFRA error (%d)\n", err));
- return -EAGAIN;
- }
- wl_set_mode_by_netdev(wl, ndev, mode);
}
ndev->ieee80211_ptr->iftype = type;
@@ -1146,18 +1135,7 @@ wl_cfg80211_notify_ifadd(struct net_device *ndev, s32 idx, s32 bssidx,
}
s32
-wl_cfg80211_notify_ifdel(void)
-{
- struct wl_priv *wl = wlcfg_drv_priv;
-
- WL_DBG(("Enter \n"));
- wl_clr_p2p_status(wl, IF_DELETING);
-
- return 0;
-}
-
-s32
-wl_cfg80211_ifdel_ops(struct net_device *ndev)
+wl_cfg80211_notify_ifdel(struct net_device *ndev)
{
struct wl_priv *wl = wlcfg_drv_priv;
bool rollback_lock = false;
@@ -1178,7 +1156,7 @@ wl_cfg80211_ifdel_ops(struct net_device *ndev)
rollback_lock = true;
}
WL_DBG(("ESCAN COMPLETED\n"));
- wl_notify_escan_complete(wl, ndev, true, false);
+ wl_notify_escan_complete(wl, ndev, true);
if (rollback_lock)
rtnl_unlock();
}
@@ -1192,10 +1170,10 @@ wl_cfg80211_ifdel_ops(struct net_device *ndev)
wl->p2p->vif_created = false;
wl_cfgp2p_clear_management_ie(wl,
index);
+ wl_clr_p2p_status(wl, IF_DELETING);
WL_DBG(("index : %d\n", index));
}
-
/* Wake up any waiting thread */
wake_up_interruptible(&wl->netif_change_event);
@@ -1234,53 +1212,6 @@ wl_cfg80211_notify_ifchange(void)
return 0;
}
-#ifdef DHD_BCM_WIFI_HDMI
-static bool
-wl_cfg80211_is_whdmi_active(struct wiphy *wiphy, struct net_device *dev)
-{
- bool is_whdmi_on = false;
- s32 err = 0;
- struct wl_priv *wl;
- struct ether_addr bssid;
- struct station_info sinfo;
-
- /* Check if WHDMI is enabled */
- if (!dhd_bcm_whdmi_enable) {
- WL_INFO(("%s: whdmi not enabled\n", __FUNCTION__));
- goto done;
- }
-
- /* Check if we are associated as a STA */
- wl = wiphy_priv(wiphy);
- err = wldev_ioctl(dev, WLC_GET_BSSID, &bssid, ETHER_ADDR_LEN, false);
- if (err) {
- WL_INFO(("%s: not associated, no BSSID (%d)\n",
- __FUNCTION__, err));
- goto done;
- }
- WL_INFO(("%s: bssid=" MACSTR "\n", __FUNCTION__, MAC2STR(bssid.octet)));
- err = wl_cfg80211_get_station(wiphy, dev, bssid.octet, &sinfo);
- if (err) {
- WL_INFO(("%s: not associated, get_station err %d\n",
- __FUNCTION__, err));
- goto done;
- }
-
- /* Check if we have a WHDMI softAP bsscfg up */
- if (!wl_cfgp2p_bss_isup(dev, DHD_WHDMI_SOFTAP_IF_NUM)) {
- WL_INFO(("%s: softAP bss not up\n", __FUNCTION__));
- goto done;
- }
-
- is_whdmi_on = true;
-
-done:
- return is_whdmi_on;
-}
-#else /* !DHD_BCM_WIFI_HDMI */
-#define wl_cfg80211_is_whdmi_active(wiphy, dev) (0)
-#endif /* DHD_BCM_WIFI_HDMI */
-
static void wl_scan_prep(struct wl_scan_params *params, struct cfg80211_scan_request *request)
{
u32 n_ssids;
@@ -1344,9 +1275,9 @@ static void wl_scan_prep(struct wl_scan_params *params, struct cfg80211_scan_req
params->channel_list[i] = channel;
params->channel_list[i] &= WL_CHANSPEC_CHAN_MASK;
- //params->channel_list[i] |= chanspec; penguin???
+ params->channel_list[i] |= chanspec;
WL_SCAN(("Chan : %d, Channel spec: %x \n",
- channel, params->channel_list[i]));
+ channel, params->channel_list[i]));
params->channel_list[i] = htod16(params->channel_list[i]);
}
} else {
@@ -1405,10 +1336,12 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct cfg80211_scan_request *request,
}
params = (struct wl_iscan_params *)kzalloc(params_size, GFP_KERNEL);
if (!params) {
- return -ENOMEM;
+ err = -ENOMEM;
+ goto done;
}
- wl_scan_prep(&params->params, request);
+ if (request != NULL)
+ wl_scan_prep(&params->params, request);
params->version = htod32(ISCAN_REQ_VERSION);
params->action = htod16(action);
@@ -1428,8 +1361,8 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct cfg80211_scan_request *request,
WL_ERR(("error (%d)\n", err));
}
}
-done:
kfree(params);
+done:
return err;
}
@@ -1520,7 +1453,8 @@ wl_run_escan(struct wl_priv *wl, struct net_device *ndev,
goto exit;
}
- wl_scan_prep(&params->params, request);
+ if (request != NULL)
+ wl_scan_prep(&params->params, request);
params->version = htod32(ESCAN_REQ_VERSION);
params->action = htod16(action);
params->sync_id = htod16(0x1234);
@@ -1698,8 +1632,6 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
wl_cfgp2p_generate_bss_mac(&primary_mac,
&wl->p2p->dev_addr, &wl->p2p->int_addr);
}
- wl_clr_p2p_status(wl, GO_NEG_PHASE);
- WL_DBG(("P2P: GO_NEG_PHASE status cleared \n"));
p2p_scan(wl) = true;
}
} else {
@@ -1738,13 +1670,10 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
} else {
wpsie_len = 0;
}
- if (wpsie_len > 0) {
- err = wl_cfgp2p_set_management_ie(wl,
- ndev, -1, VNDR_IE_PRBREQ_FLAG,
- wpsie, wpsie_len);
- if (unlikely(err)) {
- goto scan_out;
- }
+ err = wl_cfgp2p_set_management_ie(wl, ndev, -1,
+ VNDR_IE_PRBREQ_FLAG, wpsie, wpsie_len);
+ if (unlikely(err)) {
+ goto scan_out;
}
}
}
@@ -1832,13 +1761,6 @@ wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
WL_DBG(("Enter \n"));
CHECK_SYS_UP(wl);
-#ifdef DHD_BCM_WIFI_HDMI
- if (wl_cfg80211_is_whdmi_active(wiphy, ndev)) {
- WL_ERR(("%s: omitting scan because whdmi is on\n", __FUNCTION__));
- return BCME_EPERM;
- }
-#endif /* DHD_BCM_WIFI_HDMI */
-
err = __wl_cfg80211_scan(wiphy, ndev, request, NULL);
if (unlikely(err)) {
WL_ERR(("scan error (%d)\n", err));
@@ -1931,192 +1853,86 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params)
{
struct wl_priv *wl = wiphy_priv(wiphy);
+ struct cfg80211_bss *bss;
+ struct ieee80211_channel *chan;
struct wl_join_params join_params;
- struct wlc_ssid ssid;
- struct ether_addr bssid;
- size_t join_params_size = 0;
- s32 wsec = 0;
- s32 bcnprd;
+ struct cfg80211_ssid ssid;
+ s32 scan_retry = 0;
s32 err = 0;
+ bool rollback_lock = false;
WL_TRACE(("In\n"));
CHECK_SYS_UP(wl);
-
- /*
- * Cancel ongoing scan to sync up with sme state machine of cfg80211.
- */
- if (wl->scan_request) {
- wl_notify_escan_complete(wl, dev, true, true);
+ if (params->bssid) {
+ WL_ERR(("Invalid bssid\n"));
+ return -EOPNOTSUPP;
}
- /* Clean BSSID */
- bzero(&bssid, sizeof(bssid));
- wl_update_prof(wl, dev, NULL, (void *)&bssid, WL_PROF_BSSID);
-
- if (params->ssid)
- WL_INFO(("SSID: %s\n", params->ssid));
- else {
- WL_ERR(("SSID: NULL, Not supported\n"));
- err = -EOPNOTSUPP;
- goto CleanUp;
+ bss = cfg80211_get_ibss(wiphy, NULL, params->ssid, params->ssid_len);
+ if (!bss) {
+ memcpy(ssid.ssid, params->ssid, params->ssid_len);
+ ssid.ssid_len = params->ssid_len;
+ do {
+ if (unlikely
+ (__wl_cfg80211_scan(wiphy, dev, NULL, &ssid) ==
+ -EBUSY)) {
+ wl_delay(150);
+ } else {
+ break;
+ }
+ } while (++scan_retry < WL_SCAN_RETRY_MAX);
+ /* to allow scan_inform to propagate to cfg80211 plane */
+ if (rtnl_is_locked()) {
+ rtnl_unlock();
+ rollback_lock = true;
+ }
+
+ /* wait 4 secons till scan done.... */
+ schedule_timeout_interruptible(4 * HZ);
+ if (rollback_lock)
+ rtnl_lock();
+ bss = cfg80211_get_ibss(wiphy, NULL,
+ params->ssid, params->ssid_len);
+ }
+ if (bss) {
+ wl->ibss_starter = false;
+ WL_DBG(("Found IBSS\n"));
+ } else {
+ wl->ibss_starter = true;
}
-
+ chan = params->channel;
+ if (chan)
+ wl->channel = ieee80211_frequency_to_channel(chan->center_freq);
+ /*
+ * Join with specific BSSID and cached SSID
+ * If SSID is zero join based on BSSID only
+ */
+ memset(&join_params, 0, sizeof(join_params));
+ memcpy((void *)join_params.ssid.SSID, (void *)params->ssid,
+ params->ssid_len);
+ join_params.ssid.SSID_len = htod32(params->ssid_len);
if (params->bssid)
- WL_INFO(("BSSID: %02X:%02X:%02X:%02X:%02X:%02X\n",
- params->bssid[0], params->bssid[1], params->bssid[2],
- params->bssid[3], params->bssid[4], params->bssid[5]));
-
- if (params->channel)
- WL_INFO(("channel: %d\n", params->channel->center_freq));
-
- if (params->channel_fixed)
- WL_INFO(("fixed channel required\n"));
-
- if (params->ie && params->ie_len)
- WL_INFO(("ie len: %d\n", params->ie_len));
-
- if (params->beacon_interval)
- WL_INFO(("beacon interval: %d\n", params->beacon_interval));
-
- if (params->basic_rates)
- WL_INFO(("basic rates: %08X\n", params->basic_rates));
-
- if (params->privacy)
- WL_INFO(("privacy required\n"));
-
- wl_set_drv_status(wl, CONNECTING, dev);
-
- /* Configure Privacy for starter */
- if (params->privacy)
- wsec |= WEP_ENABLED;
-
- err = wldev_iovar_setint(dev, "wsec", wsec);
- if (err) {
- WL_ERR(("wsec failed (%d)\n", err));
- goto CleanUp;
- }
-
- err = wldev_iovar_setint(dev, "auth", WL_AUTH_OPEN_SYSTEM);
- if (err) {
- WL_ERR(("auth failed (%d)\n", err));
- goto CleanUp;
- }
-
- err = wldev_iovar_setint(dev, "wpa_auth", 0);
- if (err) {
- WL_ERR(("wpa_auth failed (%d)\n", err));
- goto CleanUp;
- }
-
- /* Configure Beacon Interval for starter */
- if (params->beacon_interval)
- bcnprd = params->beacon_interval;
+ memcpy(&join_params.params.bssid, params->bssid,
+ ETHER_ADDR_LEN);
else
- bcnprd = 100;
-
- bcnprd = htod32(bcnprd);
- err = wldev_ioctl(dev, WLC_SET_BCNPRD, &bcnprd, sizeof(bcnprd), true);
- if (err) {
- WL_ERR(("WLC_SET_BCNPRD failed (%d)\n", err));
- goto CleanUp;
- }
-
- /* Configure required join parameter */
- memset(&join_params, 0, sizeof(struct wl_join_params));
-
- /* SSID */
- memset(&ssid, 0, sizeof(struct wlc_ssid));
- ssid.SSID_len = MIN(params->ssid_len, 32);
- join_params.ssid.SSID_len = htod32(ssid.SSID_len);
- memcpy(ssid.SSID, params->ssid, ssid.SSID_len);
- memcpy(join_params.ssid.SSID, params->ssid, ssid.SSID_len);
- join_params_size = sizeof(join_params.ssid);
-
- wl_update_prof(wl, dev, NULL, &ssid, WL_PROF_SSID);
-
- /* BSSID */
- if (params->bssid) {
- memcpy(&join_params.params.bssid, params->bssid, ETHER_ADDR_LEN);
- join_params_size = sizeof(join_params.ssid) +
- WL_ASSOC_PARAMS_FIXED_SIZE;
-
- wl_update_prof(wl, dev, NULL, params->bssid, WL_PROF_BSSID);
- } else {
- memcpy(&join_params.params.bssid, &ether_bcast, ETHER_ADDR_LEN);
- }
-
- /* Channel */
- if (params->channel) {
- u32 target_channel;
+ memset(&join_params.params.bssid, 0, ETHER_ADDR_LEN);
- target_channel = ieee80211_frequency_to_channel(
- params->channel->center_freq);
- if (params->channel_fixed) {
- /* adding chanspec */
- wl_ch_to_chanspec(target_channel,
- &join_params, &join_params_size);
- }
-
- /* set channel for starter */
- target_channel = htod32(target_channel);
- err = wldev_ioctl(dev, WLC_SET_CHANNEL,
- &target_channel, sizeof(target_channel), true);
- if (err) {
- WL_ERR(("WLC_SET_CHANNEL failed (%d)\n", err));
- goto CleanUp;
- }
- }
-
- wl->ibss_starter = false;
-
- err = wldev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size, true);
- if (err) {
- WL_ERR(("WLC_SET_SSID failed (%d)\n", err));
- goto CleanUp;
+ err = wldev_ioctl(dev, WLC_SET_SSID, &join_params,
+ sizeof(join_params), false);
+ if (unlikely(err)) {
+ WL_ERR(("Error (%d)\n", err));
+ return err;
}
-
-CleanUp:
-
- if (err)
- wl_clr_drv_status(wl, CONNECTING, dev);
-
- WL_TRACE(("Exit\n"));
return err;
}
static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
{
struct wl_priv *wl = wiphy_priv(wiphy);
- scb_val_t scbval;
- bool act = false;
s32 err = 0;
- u8 *curbssid;
-
- WL_TRACE(("Enter\n"));
CHECK_SYS_UP(wl);
- act = *(bool *) wl_read_prof(wl, dev, WL_PROF_ACT);
- curbssid = wl_read_prof(wl, dev, WL_PROF_BSSID);
- if (act) {
- /*
- * Cancel ongoing scan to sync up with sme state machine of cfg80211.
- */
- if (wl->scan_request) {
- wl_notify_escan_complete(wl, dev, true, true);
- }
- wl_set_drv_status(wl, DISCONNECTING, dev);
- scbval.val = DOT11_RC_DISASSOC_LEAVING;
- memcpy(&scbval.ea, curbssid, ETHER_ADDR_LEN);
- scbval.val = htod32(scbval.val);
- err = wldev_ioctl(dev, WLC_DISASSOC, &scbval,
- sizeof(scb_val_t), true);
- if (unlikely(err)) {
- wl_clr_drv_status(wl, DISCONNECTING, dev);
- WL_ERR(("error (%d)\n", err));
- return err;
- }
- }
+ wl_link_down(wl);
- WL_TRACE(("Exit\n"));
return err;
}
@@ -2191,21 +2007,21 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
s32 bssidx = wl_cfgp2p_find_idx(wl, dev);
switch (sme->auth_type) {
case NL80211_AUTHTYPE_OPEN_SYSTEM:
- val = WL_AUTH_OPEN_SYSTEM;
+ val = 0;
WL_DBG(("open system\n"));
break;
case NL80211_AUTHTYPE_SHARED_KEY:
- val = WL_AUTH_SHARED_KEY;
+ val = 1;
WL_DBG(("shared key\n"));
break;
case NL80211_AUTHTYPE_AUTOMATIC:
- val = WL_AUTH_OPEN_SHARED;
+ val = 2;
WL_DBG(("automatic\n"));
break;
case NL80211_AUTHTYPE_NETWORK_EAP:
WL_DBG(("network eap\n"));
default:
- val = WL_AUTH_OPEN_SHARED;
+ val = 2;
WL_ERR(("invalid auth type (%d)\n", sme->auth_type));
break;
}
@@ -2291,11 +2107,7 @@ wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
WL_DBG(("pval (%d) gval (%d)\n", pval, gval));
if (is_wps_conn(sme)) {
- if (sme->privacy)
- err = wldev_iovar_setint_bsscfg(dev, "wsec", 4, bssidx);
- else
- /* WPS-2.0 allowes no security */
- err = wldev_iovar_setint_bsscfg(dev, "wsec", 0, bssidx);
+ err = wldev_iovar_setint_bsscfg(dev, "wsec", 4, bssidx);
} else {
#ifdef BCMWAPI_WPI
if (sme->crypto.cipher_group == WLAN_CIPHER_SUITE_SMS4) {
@@ -2460,9 +2272,9 @@ wl_set_set_sharedkey(struct net_device *dev,
WL_ERR(("WLC_SET_KEY error (%d)\n", err));
return err;
}
- if (sec->auth_type == NL80211_AUTHTYPE_SHARED_KEY) {
+ if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) {
WL_DBG(("set auth_type to shared key\n"));
- val = WL_AUTH_SHARED_KEY; /* shared key */
+ val = 1; /* shared key */
err = wldev_iovar_setint_bsscfg(dev, "auth", val, bssidx);
if (unlikely(err)) {
WL_ERR(("set auth failed (%d)\n", err));
@@ -2500,7 +2312,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
* Cancel ongoing scan to sync up with sme state machine of cfg80211.
*/
if (wl->scan_request) {
- wl_notify_escan_complete(wl, dev, true, true);
+ wl_cfg80211_scan_abort(wl, dev);
}
/* Clean BSSID */
bzero(&bssid, sizeof(bssid));
@@ -2528,9 +2340,6 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
*/
WL_DBG(("ASSOC2 p2p index : %d sme->ie_len %d\n",
wl_cfgp2p_find_idx(wl, dev), sme->ie_len));
- wl_cfgp2p_set_management_ie(wl, dev,
- wl_cfgp2p_find_idx(wl, dev), VNDR_IE_PRBREQ_FLAG,
- sme->ie, sme->ie_len);
wl_cfgp2p_set_management_ie(wl, dev, wl_cfgp2p_find_idx(wl, dev),
VNDR_IE_ASSOCREQ_FLAG, sme->ie, sme->ie_len);
}
@@ -2746,7 +2555,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
* Cancel ongoing scan to sync up with sme state machine of cfg80211.
*/
if (wl->scan_request) {
- wl_notify_escan_complete(wl, dev, true, true);
+ wl_cfg80211_scan_abort(wl, dev);
}
wl_set_drv_status(wl, DISCONNECTING, dev);
scbval.val = reason_code;
@@ -2845,29 +2654,15 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
s32 wsec;
s32 err = 0;
s32 bssidx = wl_cfgp2p_find_idx(wl, dev);
-#ifdef BCMWAPI_WPI
- int i;
-#endif /* BCMWAPI_WPI */
+
WL_DBG(("key index (%d)\n", key_idx));
CHECK_SYS_UP(wl);
err = wldev_iovar_getint_bsscfg(dev, "wsec", &wsec, bssidx);
-#ifdef BCMWAPI_WPI
- if(unlikely(err) && (SMS4_ENABLED == wsec)) {
- for(i =0; i < BCMWAPI_CONFIG_RETRY; i++) {
- OSL_DELAY(10*1000);
- err = wldev_iovar_getint_bsscfg(dev, "wsec", &wsec, bssidx);
- if(0 == err) {
- WL_ERR(("recovery (%d)\n", i));
- break;
- }
- }
- }
-#endif /* BCMWAPI_WPI */
if (unlikely(err)) {
WL_ERR(("WLC_GET_WSEC error (%d)\n", err));
return err;
}
- if (wsec == WEP_ENABLED) {
+ if (wsec & WEP_ENABLED) {
/* Just select a new current key */
index = (u32) key_idx;
index = htod32(index);
@@ -2889,9 +2684,6 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
s32 err = 0;
s32 bssidx = wl_cfgp2p_find_idx(wl, dev);
s32 mode = wl_get_mode_by_netdev(wl, dev);
-#ifdef BCMWAPI_WPI
- int i;
-#endif
memset(&key, 0, sizeof(key));
key.index = (u32) key_idx;
@@ -2973,21 +2765,6 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
#endif
wldev_iovar_setbuf_bsscfg(dev, "wsec_key", &key, sizeof(key),
wl->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &wl->ioctl_buf_sync);
-
-#ifdef BCMWAPI_WPI
- if(unlikely(err) && (CRYPTO_ALGO_SMS4 == key.algo)) {
- for(i =0; i < BCMWAPI_CONFIG_RETRY; i++) {
- OSL_DELAY(10*1000);
- err = wldev_iovar_setbuf_bsscfg(dev, "wsec_key", &key, sizeof(key),
- wl->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &wl->ioctl_buf_sync);
- if(0 == err) {
- WL_ERR(("recovery (%d)\n", i));
- break;
- }
- }
- }
-#endif
-
if (unlikely(err)) {
WL_ERR(("WLC_SET_KEY error (%d)\n", err));
return err;
@@ -3007,9 +2784,6 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
s32 err = 0;
u8 keybuf[8];
s32 bssidx = 0;
-#ifdef BCMWAPI_WPI
- int i;
-#endif
struct wl_priv *wl = wiphy_priv(wiphy);
s32 mode = wl_get_mode_by_netdev(wl, dev);
WL_DBG(("key index (%d)\n", key_idx));
@@ -3083,22 +2857,6 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
swap_key_from_BE(&key);
err = wldev_iovar_setbuf_bsscfg(dev, "wsec_key", &key, sizeof(key), wl->ioctl_buf,
WLC_IOCTL_MAXLEN, bssidx, &wl->ioctl_buf_sync);
-
-#ifdef BCMWAPI_WPI
- if(unlikely(err) && (WLAN_CIPHER_SUITE_SMS4 == params->cipher)) {
- for(i =0; i < BCMWAPI_CONFIG_RETRY; i++) {
- OSL_DELAY(10*1000);
- err = wldev_iovar_setbuf_bsscfg(dev, "wsec_key", &key, sizeof(key), wl->ioctl_buf,
- WLC_IOCTL_MAXLEN, bssidx, &wl->ioctl_buf_sync);
- if(0 == err) {
- WL_ERR(("recovery (%d)\n", i));
- break;
- }
- }
- }
-#endif /* BCMWAPI_WPI */
-
-
if (unlikely(err)) {
WL_ERR(("WLC_SET_KEY error (%d)\n", err));
return err;
@@ -3106,20 +2864,6 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
exit:
err = wldev_iovar_getint_bsscfg(dev, "wsec", &wsec, bssidx);
-
-#ifdef BCMWAPI_WPI
- if(unlikely(err) && (WLAN_CIPHER_SUITE_SMS4 == params->cipher)) {
- for(i =0; i < BCMWAPI_CONFIG_RETRY; i++) {
- OSL_DELAY(10*1000);
- err = wldev_iovar_getint_bsscfg(dev, "wsec", &wsec, bssidx);
- if(0 == err) {
- WL_ERR(("recovery (%d)\n", i));
- break;
- }
- }
- }
-#endif /* BCMWAPI_WPI */
-
if (unlikely(err)) {
WL_ERR(("get wsec error (%d)\n", err));
return err;
@@ -3127,20 +2871,6 @@ exit:
wsec |= val;
err = wldev_iovar_setint_bsscfg(dev, "wsec", wsec, bssidx);
-
-#ifdef BCMWAPI_WPI
- if(unlikely(err) && (WLAN_CIPHER_SUITE_SMS4 == params->cipher)) {
- for(i =0; i < BCMWAPI_CONFIG_RETRY; i++) {
- OSL_DELAY(10*1000);
- err = wldev_iovar_setint_bsscfg(dev, "wsec", wsec, bssidx);
- if(0 == err) {
- WL_ERR(("recovery (%d)\n", i));
- break;
- }
- }
- }
-#endif /* BCMWAPI_WPI */
-
if (unlikely(err)) {
WL_ERR(("set wsec error (%d)\n", err));
return err;
@@ -3296,10 +3026,11 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
#endif
} else if (wl_get_mode_by_netdev(wl, dev) == WL_MODE_BSS) {
u8 *curmacp = wl_read_prof(wl, dev, WL_PROF_BSSID);
- err = -ENODEV;
if (!wl_get_drv_status(wl, CONNECTED, dev) ||
- (dhd_is_associated(dhd, NULL, &err) == FALSE)) {
- WL_ERR(("NOT assoc: %d\n", err));
+ (dhd_is_associated(dhd, NULL) == FALSE)) {
+
+ WL_ERR(("NOT assoc\n"));
+ err = -ENODEV;
goto get_station_err;
}
if (memcmp(mac, curmacp, ETHER_ADDR_LEN)) {
@@ -3332,9 +3063,9 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
WL_DBG(("RSSI %d dBm\n", rssi));
get_station_err:
- if (err && (err != -ETIMEDOUT) && (err != -EIO)) {
+ if (err) {
/* Disconnect due to zero BSSID or error to get RSSI */
- WL_ERR(("force cfg80211_disconnected: %d\n", err));
+ WL_ERR(("force cfg80211_disconnected\n"));
wl_clr_drv_status(wl, CONNECTED, dev);
cfg80211_disconnected(dev, 0, NULL, 0, GFP_KERNEL);
wl_link_down(wl);
@@ -3344,8 +3075,6 @@ get_station_err:
return err;
}
-extern int net_os_get_suspend(struct net_device *dev);
-
static s32
wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
bool enabled, s32 timeout)
@@ -3356,7 +3085,6 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
CHECK_SYS_UP(wl);
- WL_DBG(("Enter : power save %s\n", (enabled ? "enable" : "disable")));
if (wl->p2p_net == dev) {
return err;
}
@@ -3365,11 +3093,10 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
/* Do not enable the power save after assoc if it is p2p interface */
if (wl->p2p && wl->p2p->vif_created) {
WL_DBG(("Do not enable the power save for p2p interfaces even after assoc\n"));
- //pm = PM_OFF; penguin, take off this case
- } else if(net_os_get_suspend(dev) == 1 && (pm == PM_FAST))
- pm = PM_MAX;
-
+ pm = PM_OFF;
+ }
pm = htod32(pm);
+ WL_DBG(("power save %s\n", (pm ? "enabled" : "disabled")));
err = wldev_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm), true);
if (unlikely(err)) {
if (err == -ENODEV)
@@ -3378,7 +3105,6 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
WL_ERR(("error (%d)\n", err));
return err;
}
- WL_DBG(("power save %s\n", (pm ? "enabled" : "disabled")));
return err;
}
@@ -3627,12 +3353,45 @@ wl_cfg80211_scan_alloc_params(int channel, int nprobes, int *out_params_size)
/* Our scan params have 1 channel and 0 ssids */
params->channel_num = htod32((0 << WL_SCAN_PARAMS_NSSID_SHIFT) |
- (num_chans & WL_SCAN_PARAMS_COUNT_MASK));
+ (num_chans & WL_SCAN_PARAMS_COUNT_MASK));
*out_params_size = params_size; /* rtn size to the caller */
return params;
}
+s32
+wl_cfg80211_scan_abort(struct wl_priv *wl, struct net_device *ndev)
+{
+ wl_scan_params_t *params = NULL;
+ s32 params_size = 0;
+ s32 err = BCME_OK;
+ unsigned long flags;
+
+ WL_DBG(("Enter\n"));
+ /* Our scan params only need space for 1 channel and 0 ssids */
+ params = wl_cfg80211_scan_alloc_params(-1, 0, &params_size);
+ if (params == NULL) {
+ WL_ERR(("scan params allocation failed \n"));
+ err = -ENOMEM;
+ } else {
+ /* Do a scan abort to stop the driver's scan engine */
+ err = wldev_ioctl(ndev, WLC_SCAN, params, params_size, true);
+ if (err < 0) {
+ WL_ERR(("scan abort failed \n"));
+ }
+ }
+ del_timer_sync(&wl->scan_timeout);
+ spin_lock_irqsave(&wl->cfgdrv_lock, flags);
+ if (wl->scan_request) {
+ cfg80211_scan_done(wl->scan_request, true);
+ wl->scan_request = NULL;
+ }
+ wl_clr_drv_status(wl, SCANNING, ndev);
+ spin_unlock_irqrestore(&wl->cfgdrv_lock, flags);
+ if (params)
+ kfree(params);
+ return err;
+}
static s32
wl_cfg80211_remain_on_channel(struct wiphy *wiphy, struct net_device *dev,
struct ieee80211_channel * channel,
@@ -3655,8 +3414,9 @@ wl_cfg80211_remain_on_channel(struct wiphy *wiphy, struct net_device *dev,
}
if (wl_get_drv_status(wl, SCANNING, ndev)) {
- wl_notify_escan_complete(wl, ndev, true, true);
+ wl_cfg80211_scan_abort(wl, ndev);
}
+
target_channel = ieee80211_frequency_to_channel(channel->center_freq);
memcpy(&wl->remain_on_chan, channel, sizeof(struct ieee80211_channel));
wl->remain_on_chan_type = channel_type;
@@ -3666,7 +3426,7 @@ wl_cfg80211_remain_on_channel(struct wiphy *wiphy, struct net_device *dev,
*cookie = id;
cfg80211_ready_on_channel(dev, *cookie, channel,
channel_type, duration, GFP_KERNEL);
- if (wl->p2p && !wl->p2p->on) {
+ if (!p2p_is_on(wl)) {
get_primary_mac(wl, &primary_mac);
wl_cfgp2p_generate_bss_mac(&primary_mac, &wl->p2p->dev_addr, &wl->p2p->int_addr);
@@ -3718,7 +3478,7 @@ wl_cfg80211_send_pending_tx_act_frm(struct wl_priv *wl)
*/
wl_clr_drv_status(wl, SENDING_ACT_FRM, wl->afx_hdl->dev);
wl_clr_drv_status(wl, SCANNING, wl->afx_hdl->dev);
- wl_notify_escan_complete(wl, dev, true, true);
+ wl_cfg80211_scan_abort(wl, dev);
wl_cfgp2p_discover_enable_search(wl, false);
tx_act_frm->channel = wl->afx_hdl->peer_chan;
wl->afx_hdl->ack_recv = (wl_cfgp2p_tx_action_frame(wl, dev,
@@ -3772,8 +3532,8 @@ wl_cfg80211_send_at_common_channel(struct wl_priv *wl,
if (wl->afx_hdl->peer_chan != WL_INVALID)
wl_cfg80211_send_pending_tx_act_frm(wl);
else {
- WL_ERR(("Couldn't find the peer " MACSTR " after %d retries\n",
- MAC2STR(wl->afx_hdl->pending_tx_dst_addr.octet), wl->afx_hdl->retry));
+ WL_ERR(("Couldn't find the peer after %d retries\n",
+ wl->afx_hdl->retry));
}
wl->afx_hdl->dev = NULL;
wl->afx_hdl->bssidx = WL_INVALID;
@@ -3789,11 +3549,7 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
struct ieee80211_channel *channel, bool offchan,
enum nl80211_channel_type channel_type,
bool channel_type_valid, unsigned int wait,
- const u8* buf, size_t len,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
- bool no_cck,
-#endif
- u64 *cookie)
+ const u8* buf, size_t len, u64 *cookie)
{
wl_action_frame_t *action_frame;
wl_af_params_t *af_params;
@@ -3814,7 +3570,6 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
wifi_p2p_action_frame_t *p2p_act_frm = NULL;
wifi_p2psd_gas_pub_act_frame_t *sd_act_frm = NULL;
s8 eabuf[ETHER_ADDR_STR_LEN];
- int retry_cnt = 0;
WL_DBG(("Enter \n"));
@@ -3877,14 +3632,8 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
scb_val.val = mgmt->u.disassoc.reason_code;
wldev_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON, &scb_val,
sizeof(scb_val_t), true);
- WL_DBG(("Disconnect STA : %s scb_val.val %d\n",
- bcm_ether_ntoa((const struct ether_addr *)mgmt->da, eabuf),
- scb_val.val));
- /* Wait for the deauth event to come, supplicant will do the
- * delete iface immediately and we will have problem in sending
- * deauth frame if we delete the bss in firmware
- */
- wl_delay(400);
+ WL_DBG(("Disconnect STA : %s\n",
+ bcm_ether_ntoa((const struct ether_addr *)mgmt->da, eabuf)));
cfg80211_mgmt_tx_status(ndev, *cookie, buf, len, true, GFP_KERNEL);
goto exit;
@@ -3896,7 +3645,7 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
* tx is still in progress (including the dwell time),
* then this new action frame will not be sent out.
*/
- wl_notify_escan_complete(wl, dev, true, true);
+ wl_cfg80211_scan_abort(wl, dev);
}
@@ -3931,7 +3680,6 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
ieee80211_frequency_to_channel(channel->center_freq);
if (channel->band == IEEE80211_BAND_5GHZ) {
- WL_DBG(("5GHz channel %d", af_params->channel));
err = wldev_ioctl(dev, WLC_SET_CHANNEL,
&af_params->channel, sizeof(af_params->channel), true);
if (err < 0) {
@@ -3951,36 +3699,6 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
WL_DBG(("P2P PUB action_frame->len: %d chan %d category %d subtype %d\n",
action_frame->len, af_params->channel,
act_frm->category, act_frm->subtype));
- if (act_frm && ((act_frm->subtype == P2P_PAF_GON_REQ) ||
- (act_frm->subtype == P2P_PAF_GON_RSP) ||
- (act_frm->subtype == P2P_PAF_GON_CONF) ||
- (act_frm->subtype == P2P_PAF_PROVDIS_REQ))) {
- wldev_iovar_setint(dev, "mpc", 0);
- }
-
- if (act_frm->subtype == P2P_PAF_GON_REQ) {
- WL_DBG(("P2P: GO_NEG_PHASE status set \n"));
- wl_set_p2p_status(wl, GO_NEG_PHASE);
- } else if (act_frm->subtype == P2P_PAF_GON_CONF) {
- /* If we reached till GO Neg confirmation
- * reset the filter
- */
- WL_DBG(("P2P: GO_NEG_PHASE status cleared \n"));
- wl_clr_p2p_status(wl, GO_NEG_PHASE);
- }
-
- if (act_frm->subtype == P2P_PAF_GON_RSP)
- retry_cnt = 1;
- else retry_cnt = WL_ACT_FRAME_RETRY;
-
- if (act_frm && act_frm->subtype == P2P_PAF_DEVDIS_REQ) {
- af_params->dwell_time = WL_LONG_DWELL_TIME;
- } else if (act_frm &&
- (act_frm->subtype == P2P_PAF_PROVDIS_REQ ||
- act_frm->subtype == P2P_PAF_PROVDIS_RSP ||
- act_frm->subtype == P2P_PAF_GON_RSP)) {
- af_params->dwell_time = WL_MED_DWELL_TIME;
- }
} else if (wl_cfgp2p_is_p2p_action(action_frame->data, action_frame->len)) {
p2p_act_frm = (wifi_p2p_action_frame_t *) (action_frame->data);
WL_DBG(("P2P action_frame->len: %d chan %d category %d subtype %d\n",
@@ -3991,15 +3709,31 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
WL_DBG(("Service Discovery action_frame->len: %d chan %d category %d action %d\n",
action_frame->len, af_params->channel,
sd_act_frm->category, sd_act_frm->action));
- af_params->dwell_time = WL_MED_DWELL_TIME;
- retry_cnt = WL_ACT_FRAME_RETRY;
+
}
wl_cfgp2p_print_actframe(true, action_frame->data, action_frame->len);
- /*
- * To make sure to send successfully action frame, we have to turn off mpc
- */
+ /*
+ * To make sure to send successfully action frame, we have to turn off mpc
+ */
+
+ if (act_frm && ((act_frm->subtype == P2P_PAF_GON_REQ) ||
+ (act_frm->subtype == P2P_PAF_GON_RSP) ||
+ (act_frm->subtype == P2P_PAF_GON_CONF) ||
+ (act_frm->subtype == P2P_PAF_PROVDIS_REQ))) {
+ wldev_iovar_setint(dev, "mpc", 0);
+ }
+
+ if (act_frm && act_frm->subtype == P2P_PAF_DEVDIS_REQ) {
+ af_params->dwell_time = WL_LONG_DWELL_TIME;
+ } else if (act_frm &&
+ (act_frm->subtype == P2P_PAF_PROVDIS_REQ ||
+ act_frm->subtype == P2P_PAF_PROVDIS_RSP ||
+ act_frm->subtype == P2P_PAF_GON_RSP)) {
+ af_params->dwell_time = WL_MED_DWELL_TIME;
+ }
+
if (IS_P2P_SOCIAL(af_params->channel) &&
- (IS_P2P_PUB_ACT_REQ(act_frm, &act_frm->elts[0], action_frame->len) ||
+ (IS_P2P_PUB_ACT_REQ(act_frm, action_frame->len) ||
IS_GAS_REQ(sd_act_frm, action_frame->len)) &&
wl_to_p2p_bss_saved_ie(wl, P2PAPI_BSSCFG_DEVICE).p2p_probe_req_ie_len) {
/* channel offload require P2P IE for Probe request
@@ -4009,27 +3743,26 @@ wl_cfg80211_mgmt_tx(struct wiphy *wiphy, struct net_device *ndev,
/* channel offload for action request frame */
ack = wl_cfg80211_send_at_common_channel(wl, dev, af_params);
- /* We need to retry Service discovery frames as they don't get retried immediately by supplicant*/
- if ((!ack) && (IS_GAS_REQ(sd_act_frm, action_frame->len))) {
- for (retry = 1; retry < retry_cnt; retry++) {
- WL_DBG(("Service Discovery action_frame retry %d len: %d chan %d category %d action %d\n",
- retry, action_frame->len, af_params->channel,
- sd_act_frm->category, sd_act_frm->action));
- ack = (wl_cfgp2p_tx_action_frame(wl, dev,
- af_params, bssidx)) ? false : true;
- if (ack)
- break;
- }
- }
} else {
ack = (wl_cfgp2p_tx_action_frame(wl, dev, af_params, bssidx)) ? false : true;
if (!ack) {
- for (retry = 1; retry < retry_cnt; retry++) {
+ if (wl_to_p2p_bss_saved_ie(wl, P2PAPI_BSSCFG_DEVICE).p2p_probe_req_ie_len) {
+ /* if the NO ACK occurs, the peer device will be on
+ * listen channel of the peer
+ * So, we have to find the peer and send action frame on
+ * that channel.
+ */
+ ack = wl_cfg80211_send_at_common_channel(wl, dev, af_params);
+ } else {
+ for (retry = 0; retry < WL_CHANNEL_SYNC_RETRY; retry++) {
ack = (wl_cfgp2p_tx_action_frame(wl, dev,
af_params, bssidx)) ? false : true;
if (ack)
break;
}
+
+ }
+
}
}
@@ -4096,15 +3829,6 @@ wl_cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev,
dev = wl_to_prmry_ndev(wl);
}
channel = ieee80211_frequency_to_channel(chan->center_freq);
-
- if (wl_get_drv_status(wl, AP_CREATING, dev)) {
- WL_TRACE(("<0> %s: as!!! in AP creating mode, save chan num:%d\n",
- __FUNCTION__, channel));
- wl->hostapd_chan = channel;
- if (channel == 14)
- return err; /* hostapd requested ch auto-select, will be done later */
- }
-
WL_DBG(("netdev_ifidx(%d), chan_type(%d) target channel(%d) \n",
dev->ifindex, channel_type, channel));
err = wldev_ioctl(dev, WLC_SET_CHANNEL, &channel, sizeof(channel), true);
@@ -4119,7 +3843,7 @@ wl_validate_wpa2ie(struct net_device *dev, bcm_tlv_t *wpa2ie, s32 bssidx)
{
s32 len = 0;
s32 err = BCME_OK;
- u16 auth = WL_AUTH_OPEN_SYSTEM; /* d11 open authentication */
+ u16 auth = 0; /* d11 open authentication */
u32 wsec;
u32 pval = 0;
u32 gval = 0;
@@ -4233,7 +3957,7 @@ wl_validate_wpaie(struct net_device *dev, wpa_ie_fixed_t *wpaie, s32 bssidx)
wpa_suite_mcast_t *mcast;
wpa_suite_ucast_t *ucast;
wpa_suite_auth_key_mgmt_t *mgmt;
- u16 auth = WL_AUTH_OPEN_SYSTEM; /* d11 open authentication */
+ u16 auth = 0; /* d11 open authentication */
u16 count;
s32 err = BCME_OK;
s32 len = 0;
@@ -4501,26 +4225,6 @@ wl_cfg80211_add_set_beacon(struct wiphy *wiphy, struct net_device *dev,
WL_ERR(("setting AP mode failed %d \n", err));
return err;
}
-
- /* if requested, do softap ch autoselect */
- if (wl->hostapd_chan == 14) {
- int auto_chan;
- if ((err = wldev_get_auto_channel(dev, &auto_chan)) != 0) {
- WL_ERR(("softap: auto chan select failed,"
- " will use ch 6\n"));
- auto_chan = 6;
- } else {
- printf("<0>softap: got auto ch:%d\n", auto_chan);
- }
- err = wldev_ioctl(dev, WLC_SET_CHANNEL,
- &auto_chan, sizeof(auto_chan), true);
- if (err < 0) {
- WL_ERR(("softap: WLC_SET_CHANNEL error %d chip"
- " may not be supporting this channel\n", err));
- return err;
- }
- }
-
/* find the RSN_IE */
if ((wpa2_ie = bcm_parse_tlvs((u8 *)info->tail, info->tail_len,
DOT11_MNG_RSN_ID)) != NULL) {
@@ -4719,107 +4423,6 @@ exit:
wldev_iovar_setint(dev, "mpc", 1);
return err;
}
-#ifdef WL_SCHED_SCAN
-#define PNO_TIME 30
-#define PNO_REPEAT 4
-#define PNO_FREQ_EXPO_MAX 2
-int wl_cfg80211_sched_scan_start(struct wiphy *wiphy,
- struct net_device *dev,
- struct cfg80211_sched_scan_request *request)
-{
- ushort pno_time = PNO_TIME;
- int pno_repeat = PNO_REPEAT;
- int pno_freq_expo_max = PNO_FREQ_EXPO_MAX;
- wlc_ssid_t ssids_local[MAX_PFN_LIST_COUNT];
- struct wl_priv *wl = wiphy_priv(wiphy);
- struct cfg80211_ssid *ssid = NULL;
- int ssid_count = 0;
- int i;
- int ret = 0;
-
- WL_DBG(("Enter n_match_sets:%d n_ssids:%d \n",
- request->n_match_sets, request->n_ssids));
- WL_DBG(("ssids:%d pno_time:%d pno_repeat:%d pno_freq:%d \n",
- request->n_ssids, pno_time, pno_repeat, pno_freq_expo_max));
-
-#if defined(WL_ENABLE_P2P_IF)
- /* While GO is operational, PNO is not supported */
- if (dhd_cfg80211_get_opmode(wl) & P2P_GO_ENABLED) {
- WL_DBG(("PNO not enabled! op_mode: P2P GO"));
- return -1;
- }
-#endif /* BCMDONGLEHOST */
-
- if (!request || !request->n_ssids || !request->n_match_sets) {
- WL_ERR(("Invalid sched scan req!! n_ssids:%d \n", request->n_ssids));
- return -EINVAL;
- }
-
- memset(&ssids_local, 0, sizeof(ssids_local));
-
- if (request->n_match_sets > 0) {
- for (i = 0; i < request->n_match_sets; i++) {
- ssid = &request->match_sets[i].ssid;
- memcpy(ssids_local[i].SSID, ssid->ssid, ssid->ssid_len);
- ssids_local[i].SSID_len = ssid->ssid_len;
- WL_DBG((">>> PNO filter set for ssid (%s) \n", ssid->ssid));
- ssid_count++;
- }
- }
-
- if (request->n_ssids > 0) {
- for (i = 0; i < request->n_ssids; i++) {
- /* Active scan req for ssids */
- WL_DBG((">>> Active scan req for ssid (%s) \n", request->ssids[i].ssid));
-
- /* match_set ssids is a supert set of n_ssid list, so we need
- * not add these set seperately
- */
- }
- }
-
- if (ssid_count) {
- if ((ret = dhd_dev_pno_set(dev, ssids_local, request->n_match_sets,
- pno_time, pno_repeat, pno_freq_expo_max)) < 0) {
- WL_ERR(("PNO setup failed!! ret=%d \n", ret));
- return -EINVAL;
- }
-
- /* Enable the PNO */
- if (dhd_dev_pno_enable(dev, 1) < 0) {
- WL_ERR(("PNO enable failed!! ret=%d \n", ret));
- return -EINVAL;
- }
- wl->sched_scan_req = request;
- } else {
- return -EINVAL;
- }
-
- return 0;
-}
-
-int wl_cfg80211_sched_scan_stop(struct wiphy *wiphy, struct net_device *dev)
-{
- struct wl_priv *wl = wiphy_priv(wiphy);
-
- WL_DBG(("Enter \n"));
-
- if (dhd_dev_pno_enable(dev, 0) < 0)
- WL_ERR(("PNO disable failed"));
-
- if (dhd_dev_pno_reset(dev) < 0)
- WL_ERR(("PNO reset failed"));
-
- if (wl->scan_request && wl->sched_scan_running) {
- wl_notify_escan_complete(wl, dev, true, true);
- }
-
- wl->sched_scan_req = NULL;
- wl->sched_scan_running = FALSE;
-
- return 0;
-}
-#endif /* WL_SCHED_SCAN */
static struct cfg80211_ops wl_cfg80211_ops = {
.add_virtual_intf = wl_cfg80211_add_virtual_iface,
@@ -4853,10 +4456,6 @@ static struct cfg80211_ops wl_cfg80211_ops = {
.set_channel = wl_cfg80211_set_channel,
.set_beacon = wl_cfg80211_add_set_beacon,
.add_beacon = wl_cfg80211_add_set_beacon,
-#ifdef WL_SCHED_SCAN
- .sched_scan_start = wl_cfg80211_sched_scan_start,
- .sched_scan_stop = wl_cfg80211_sched_scan_stop,
-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) */
};
s32 wl_mode_to_nl80211_iftype(s32 mode)
@@ -4892,12 +4491,6 @@ static s32 wl_setup_wiphy(struct wireless_dev *wdev, struct device *sdiofunc_dev
/* Report how many SSIDs Driver can support per Scan request */
wdev->wiphy->max_scan_ssids = WL_SCAN_PARAMS_SSID_MAX;
wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
-#ifdef WL_SCHED_SCAN
- wdev->wiphy->max_sched_scan_ssids = MAX_PFN_LIST_COUNT;
- wdev->wiphy->max_match_sets = MAX_PFN_LIST_COUNT;
- wdev->wiphy->max_sched_scan_ie_len = WL_SCAN_IE_LEN_MAX;
- wdev->wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
-#endif /* WL_SCHED_SCAN */
wdev->wiphy->interface_modes =
BIT(NL80211_IFTYPE_STATION)
| BIT(NL80211_IFTYPE_AP) | BIT(NL80211_IFTYPE_MONITOR);
@@ -5005,11 +4598,6 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
band = wiphy->bands[IEEE80211_BAND_2GHZ];
else
band = wiphy->bands[IEEE80211_BAND_5GHZ];
- if (!band) {
- WL_ERR(("No valid band"));
- kfree(notif_bss_info);
- return -EINVAL;
- }
notif_bss_info->rssi = dtoh16(bi->RSSI);
memcpy(mgmt->bssid, &bi->BSSID, ETHER_ADDR_LEN);
mgmt_type = wl->active_scan ?
@@ -5046,13 +4634,11 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
signal = notif_bss_info->rssi * 100;
-#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+#if defined(WLP2P) && ENABLE_P2P_INTERFACE
if (wl->p2p_net && wl->scan_request &&
- ((wl->scan_request->dev == wl->p2p_net) ||
- (wl->scan_request->dev == wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION)))) {
+ wl->scan_request->dev == wl->p2p_net) {
#else
- if (p2p_is_on(wl) && (p2p_scan(wl) ||
- (wl->scan_request->dev == wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION)))) {
+ if (p2p_is_on(wl) && p2p_scan(wl)) {
#endif
/* find the P2PIE, if we do not find it, we will discard this frame */
wifi_p2p_ie_t * p2p_ie;
@@ -5062,19 +4648,6 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
kfree(notif_bss_info);
return err;
}
- else if( wl_cfgp2p_retreive_p2pattrib(p2p_ie, P2P_SEID_DEV_INFO) == NULL)
- {
- WL_DBG(("Couldn't find P2P_SEID_DEV_INFO in probe response/beacon\n"));
- kfree(notif_bss_info);
- return err;
- }
- }
- if (!mgmt->u.probe_resp.timestamp) {
- struct timeval tv;
-
- do_gettimeofday(&tv);
- mgmt->u.probe_resp.timestamp = ((u64)tv.tv_sec * 1000000)
- + tv.tv_usec;
}
cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt,
@@ -5091,129 +4664,21 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
return err;
}
-static s32 wl_inform_ibss(struct wl_priv *wl, const u8 *bssid)
-{
- struct net_device *ndev = wl_to_prmry_ndev(wl);
- struct wiphy *wiphy = wl_to_wiphy(wl);
- struct wl_bss_info *bi = NULL;
- struct ieee80211_channel *notify_channel;
- struct ieee80211_supported_band *band;
- struct cfg80211_bss *bss;
- s32 err = 0;
- u16 channel;
- u32 freq;
- u32 wsec = 0;
- u16 notify_capability;
- u16 notify_interval;
- u8 *notify_ie;
- size_t notify_ielen;
- s32 notify_signal;
-
- WL_TRACE(("Enter\n"));
-
- if (wl->scan_request) {
- wl_notify_escan_complete(wl, ndev, true, true);
- }
-
- mutex_lock(&wl->usr_sync);
-
- *(u32 *)wl->extra_buf = htod32(WL_EXTRA_BUF_MAX);
- err = wldev_ioctl(ndev, WLC_GET_BSS_INFO, wl->extra_buf,
- WL_EXTRA_BUF_MAX, false);
- if (err) {
- WL_ERR(("Failed to get bss info for IBSS\n"));
- err = -EIO;
- goto CleanUp;
- }
- bi = (struct wl_bss_info *)(wl->extra_buf + 4);
-
- if (memcmp(bssid, &bi->BSSID, ETHER_ADDR_LEN)) {
- WL_ERR(("BSSID mismatch: Inform %02x:%02x:%02x:%02x:%02x:%02x,"
- "%02x:%02x:%02x:%02x:%02x:%02x\n",
- bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5],
- bi->BSSID.octet[0], bi->BSSID.octet[1], bi->BSSID.octet[2],
- bi->BSSID.octet[3], bi->BSSID.octet[4],
- bi->BSSID.octet[5]));
- err = -EINVAL;
- goto CleanUp;
- }
-
- err = wldev_iovar_getint(ndev, "wsec", &wsec);
- if (err) {
- WL_ERR(("wsec failed: %d\n", err));
- err = -EIO;
- goto CleanUp;
- }
-
- channel = bi->ctl_ch ? bi->ctl_ch :
- CHSPEC_CHANNEL(dtohchanspec(bi->chanspec));
- if (channel <= CH_MAX_2G_CHANNEL)
- band = wiphy->bands[IEEE80211_BAND_2GHZ];
- else
- band = wiphy->bands[IEEE80211_BAND_5GHZ];
-
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 38) && !defined(WL_COMPAT_WIRELESS)
- freq = ieee80211_channel_to_frequency(channel);
- (void)band->band;
-#else
- freq = ieee80211_channel_to_frequency(channel, band->band);
-#endif
- notify_channel = ieee80211_get_channel(wiphy, freq);
-
- notify_capability = dtoh16(bi->capability);
- notify_interval = dtoh16(bi->beacon_period);
- notify_ie = (u8 *)bi + dtoh16(bi->ie_offset);
- notify_ielen = dtoh32(bi->ie_length);
- notify_signal = (int16)dtoh16(bi->RSSI) * 100;
-
- if (wl->p2p_supported) {
- notify_capability |= DOT11_CAP_IBSS;
- if (wsec)
- notify_capability |= DOT11_CAP_PRIVACY;
- }
-
- WL_DBG(("BSSID %02x:%02x:%02x:%02x:%02x:%02x",
- bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]));
- WL_INFO(("channel: %d(%d)\n", channel, freq));
- WL_INFO(("capability: %X\n", notify_capability));
- WL_INFO(("beacon interval: %d ms\n", notify_interval));
- WL_INFO(("signal: %d dBm\n", notify_signal));
- WL_INFO(("ie_len: %d\n", notify_ielen));
- bss = cfg80211_inform_bss(wiphy, notify_channel, bssid, 0,
- notify_capability, notify_interval,
- notify_ie, notify_ielen, notify_signal, GFP_KERNEL);
- if (!bss) {
- WL_ERR(("cfg80211_inform_bss() Failed\n"));
- err = -ENOMEM;
- goto CleanUp;
- }
-
- cfg80211_put_bss(bss);
- err = 0;
-
-CleanUp:
-
- mutex_unlock(&wl->usr_sync);
-
- WL_TRACE(("Exit\n"));
- return err;
-}
-
static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e, struct net_device *ndev)
{
u32 event = ntoh32(e->event_type);
u32 status = ntoh32(e->status);
u16 flags = ntoh16(e->flags);
- WL_DBG(("event %d, status %d flags %x\n", event, status, flags));
+ WL_DBG(("event %d, status %d\n", event, status));
if (event == WLC_E_SET_SSID) {
if (status == WLC_E_STATUS_SUCCESS) {
- return true;
+ if (!wl_is_ibssmode(wl, ndev))
+ return true;
}
} else if (event == WLC_E_LINK) {
if (flags & WLC_EVENT_MSG_LINK)
- if (!wl_is_ibssmode(wl, ndev))
- return true;
+ return true;
}
WL_DBG(("wl_is_linkup false\n"));
@@ -5253,9 +4718,11 @@ static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e)
/* The mainline kernel >= 3.2.0 has support for indicating new/del station
* to AP/P2P GO via events. If this change is backported to kernel for which
- * this driver is being built, then define WL_CFG80211_STA_EVENT. You
- * should use this new/del sta event mechanism for BRCM supplicant >= 22.
+ * this driver is being built, set CFG80211_STA_EVENT_AVAILABLE to 1. You
+ * should use this new/del sta event mechanism for BRCM supplicant from BRANCH
+ * HOSTAP_BRANCH_0_15 (ver >= 15_1).
*/
+#define CFG80211_STA_EVENT_AVAILABLE 0
static s32
wl_notify_connect_status_ap(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data)
@@ -5265,13 +4732,13 @@ wl_notify_connect_status_ap(struct wl_priv *wl, struct net_device *ndev,
u32 reason = ntoh32(e->reason);
u32 len = ntoh32(e->datalen);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)) && !defined(WL_CFG80211_STA_EVENT)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)) && !CFG80211_STA_EVENT_AVAILABLE
bool isfree = false;
u8 *mgmt_frame;
u8 bsscfgidx = e->bsscfgidx;
s32 freq;
s32 channel;
- u8 body[WL_FRAME_LEN];
+ u8 body[WL_ASSOC_INFO_MAX];
u16 fc = 0;
struct ieee80211_supported_band *band;
struct ether_addr da;
@@ -5280,20 +4747,19 @@ wl_notify_connect_status_ap(struct wl_priv *wl, struct net_device *ndev,
channel_info_t ci;
#else
struct station_info sinfo;
-#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)) && !WL_CFG80211_STA_EVENT */
+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)) && !CFG80211_STA_EVENT_AVAILABLE */
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)) && !defined(WL_CFG80211_STA_EVENT)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)) && !CFG80211_STA_EVENT_AVAILABLE
memset(body, 0, sizeof(body));
memset(&bssid, 0, ETHER_ADDR_LEN);
- WL_DBG(("Enter event %d ndev %p\n", event, ndev));
+ WL_DBG(("Enter \n"));
if (wl_get_mode_by_netdev(wl, ndev) == WL_INVALID)
return WL_INVALID;
- if (len > WL_FRAME_LEN) {
- WL_ERR(("Received frame length %d from dongle is greater than"
- " allocated body buffer len %d", len, WL_FRAME_LEN));
- goto exit;
+ if (unlikely(len > WL_ASSOC_INFO_MAX)) {
+ WL_ERR(("%s(): event len %d > %d\n", __func__, len, WL_ASSOC_INFO_MAX));
+ return -ENOMEM;
}
memcpy(body, data, len);
wldev_iovar_getbuf_bsscfg(ndev, "cur_etheraddr",
@@ -5328,10 +4794,7 @@ wl_notify_connect_status_ap(struct wl_priv *wl, struct net_device *ndev,
band = wiphy->bands[IEEE80211_BAND_2GHZ];
else
band = wiphy->bands[IEEE80211_BAND_5GHZ];
- if (!band) {
- WL_ERR(("No valid band"));
- return -EINVAL;
- }
+
#if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 38) && !defined(WL_COMPAT_WIRELESS)
freq = ieee80211_channel_to_frequency(channel);
(void)band->band;
@@ -5357,7 +4820,7 @@ exit:
if (isfree)
kfree(mgmt_frame);
return err;
-#else /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) && !WL_CFG80211_STA_EVENT */
+#else /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) && !CFG80211_STA_EVENT_AVAILABLE */
sinfo.filled = 0;
if (((event == WLC_E_ASSOC_IND) || (event == WLC_E_REASSOC_IND)) &&
reason == DOT11_SC_SUCCESS) {
@@ -5374,7 +4837,7 @@ exit:
} else if ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH)) {
cfg80211_del_sta(ndev, e->addr.octet, GFP_ATOMIC);
}
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) && !WL_CFG80211_STA_EVENT */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) && !CFG80211_STA_EVENT_AVAILABLE */
return err;
}
@@ -5385,29 +4848,22 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
bool act;
s32 err = 0;
u32 event = ntoh32(e->event_type);
- u32 reason;
if (wl_get_mode_by_netdev(wl, ndev) == WL_MODE_AP) {
wl_notify_connect_status_ap(wl, ndev, e, data);
} else {
- WL_DBG(("wl_notify_connect_status : event %d status : %d ndev %p\n",
- ntoh32(e->event_type), ntoh32(e->status), ndev));
- if((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DISASSOC_IND)) {
- reason = ntoh32(e->reason);
- wl->deauth_reason = reason;
- WL_ERR(("Received %s event with reason code: %d\n",
- (event == WLC_E_DEAUTH_IND)?
- "WLC_E_DEAUTH_IND":"WLC_E_DISASSOC_IND", reason));
- }
+ WL_DBG(("wl_notify_connect_status : event %d status : %d \n",
+ ntoh32(e->event_type), ntoh32(e->status)));
if (wl_is_linkup(wl, e, ndev)) {
wl_link_up(wl);
act = true;
wl_update_prof(wl, ndev, e, &act, WL_PROF_ACT);
wl_update_prof(wl, ndev, NULL, (void *)&e->addr, WL_PROF_BSSID);
- wl->deauth_reason = 0;
if (wl_is_ibssmode(wl, ndev)) {
- wl_ibss_join_done(wl, ndev, e, data, true);
- WL_DBG(("wl_ibss_join_done succeeded\n"));
+ printk("cfg80211_ibss_joined\n");
+ cfg80211_ibss_joined(ndev, (s8 *)&e->addr,
+ GFP_KERNEL);
+ WL_DBG(("joined in IBSS network\n"));
} else {
if (!wl_get_drv_status(wl, DISCONNECTING, ndev)) {
printk("wl_bss_connect_done succeeded\n");
@@ -5417,44 +4873,35 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
wl_read_prof(wl, ndev, WL_PROF_SSID))->SSID));
}
}
+
} else if (wl_is_linkdown(wl, e)) {
if (wl->scan_request) {
+ del_timer_sync(&wl->scan_timeout);
if (wl->escan_on) {
- wl_notify_escan_complete(wl, ndev, true, true);
- } else {
- del_timer_sync(&wl->scan_timeout);
+ wl_notify_escan_complete(wl, ndev, true);
+ } else
wl_iscan_aborted(wl);
- }
}
if (wl_get_drv_status(wl, CONNECTED, ndev)) {
scb_val_t scbval;
u8 *curbssid = wl_read_prof(wl, ndev, WL_PROF_BSSID);
+ printk("link down, call cfg80211_disconnected\n");
wl_clr_drv_status(wl, CONNECTED, ndev);
- if (! wl_get_drv_status(wl, DISCONNECTING, ndev)) {
- /* To make sure disconnect, explictly send dissassoc
- * for BSSID 00:00:00:00:00:00 issue
- */
- scbval.val = WLAN_REASON_DEAUTH_LEAVING;
-
- memcpy(&scbval.ea, curbssid, ETHER_ADDR_LEN);
- scbval.val = htod32(scbval.val);
- wldev_ioctl(ndev, WLC_DISASSOC, &scbval,
- sizeof(scb_val_t), true);
- WL_ERR(("link down, calling cfg80211_disconnected"
- " with deauth_reason:%d\n", wl->deauth_reason));
- if (!wl_is_ibssmode(wl, ndev))
- cfg80211_disconnected(ndev, wl->deauth_reason,
- NULL, 0, GFP_KERNEL);
- wl_link_down(wl);
- wl_init_prof(wl, ndev);
- }
- }
- else if (wl_get_drv_status(wl, CONNECTING, ndev)) {
+ /* To make sure disconnect, explictly send dissassoc
+ * for BSSID 00:00:00:00:00:00 issue
+ */
+ scbval.val = WLAN_REASON_DEAUTH_LEAVING;
+
+ memcpy(&scbval.ea, curbssid, ETHER_ADDR_LEN);
+ scbval.val = htod32(scbval.val);
+ wldev_ioctl(ndev, WLC_DISASSOC, &scbval,
+ sizeof(scb_val_t), true);
+ cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
+ wl_link_down(wl);
+ wl_init_prof(wl, ndev);
+ } else if (wl_get_drv_status(wl, CONNECTING, ndev)) {
printk("link down, during connecting\n");
- if (wl_is_ibssmode(wl, ndev))
- wl_ibss_join_done(wl, ndev, e, data, false);
- else
- wl_bss_connect_done(wl, ndev, e, data, false);
+ wl_bss_connect_done(wl, ndev, e, data, false);
}
wl_clr_drv_status(wl, DISCONNECTING, ndev);
@@ -5463,12 +4910,11 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
event, (int)ntoh32(e->status));
/* Clean up any pending scan request */
if (wl->scan_request) {
+ del_timer_sync(&wl->scan_timeout);
if (wl->escan_on) {
- wl_notify_escan_complete(wl, ndev, true, true);
- } else {
- del_timer_sync(&wl->scan_timeout);
+ wl_notify_escan_complete(wl, ndev, true);
+ } else
wl_iscan_aborted(wl);
- }
}
if (wl_get_drv_status(wl, CONNECTING, ndev))
wl_bss_connect_done(wl, ndev, e, data, false);
@@ -5729,7 +5175,7 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
WL_DBG((" enter\n"));
if (wl->scan_request) {
- wl_notify_escan_complete(wl, ndev, true, true);
+ wl_cfg80211_scan_abort(wl, ndev);
}
if (wl_get_drv_status(wl, CONNECTING, ndev)) {
wl_clr_drv_status(wl, CONNECTING, ndev);
@@ -5758,35 +5204,6 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
}
static s32
-wl_ibss_join_done(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data, bool completed)
-{
- s32 err = 0;
-
- WL_TRACE(("Enter\n"));
-
- if (wl->scan_request) {
- wl_notify_escan_complete(wl, ndev, true, true);
- }
- if (wl_get_drv_status(wl, CONNECTING, ndev)) {
- wl_clr_drv_status(wl, CONNECTING, ndev);
- if (completed) {
- err = wl_inform_ibss(wl, (u8 *)&e->addr);
- if (err) {
- WL_ERR(("wl_inform_ibss() failed: %d\n", err));
- }
- wl_set_drv_status(wl, CONNECTED, ndev);
-
- cfg80211_ibss_joined(ndev, (u8 *)&e->addr, GFP_KERNEL);
- WL_DBG(("cfg80211_ibss_joined() called with valid BSSID\n"));
- }
- }
-
- WL_TRACE(("Exit\n"));
- return err;
-}
-
-static s32
wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
const wl_event_msg_t *e, void *data)
{
@@ -5814,15 +5231,8 @@ wl_notify_pfn_status(struct wl_priv *wl, struct net_device *ndev,
WL_ERR((" PNO Event\n"));
mutex_lock(&wl->usr_sync);
-#ifndef WL_SCHED_SCAN
/* TODO: Use cfg80211_sched_scan_results(wiphy); */
cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
-#else
- /* If cfg80211 scheduled scan is supported, report the pno results via sched
- * scan results
- */
- wl_notify_sched_scan_results(wl, ndev, e, data);
-#endif /* WL_SCHED_SCAN */
mutex_unlock(&wl->usr_sync);
return 0;
}
@@ -5964,16 +5374,6 @@ wl_notify_rx_mgmt_frame(struct wl_priv *wl, struct net_device *ndev,
band = wiphy->bands[IEEE80211_BAND_2GHZ];
else
band = wiphy->bands[IEEE80211_BAND_5GHZ];
- if (!band) {
- WL_ERR(("No valid band"));
- return -EINVAL;
- }
-
- if ((event == WLC_E_P2P_PROBREQ_MSG) &&
- wl->p2p && wl_get_p2p_status(wl, GO_NEG_PHASE)) {
- WL_DBG(("Filtering P2P probe_req while being in GO-Neg state\n"));
- goto exit;
- }
#if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 38) && !defined(WL_COMPAT_WIRELESS)
freq = ieee80211_channel_to_frequency(channel);
@@ -6017,14 +5417,9 @@ wl_notify_rx_mgmt_frame(struct wl_priv *wl, struct net_device *ndev,
* After complete GO Negotiation, roll back to mpc mode
*/
if (act_frm && ((act_frm->subtype == P2P_PAF_GON_CONF) ||
- (act_frm->subtype == P2P_PAF_PROVDIS_RSP))) {
+ (act_frm->subtype == P2P_PAF_PROVDIS_RSP))) {
wldev_iovar_setint(dev, "mpc", 1);
}
-
- if (act_frm && (act_frm->subtype == P2P_PAF_GON_CONF)) {
- WL_DBG(("P2P: GO_NEG_PHASE status cleared \n"));
- wl_clr_p2p_status(wl, GO_NEG_PHASE);
- }
} else {
mgmt_frame = (u8 *)((wl_event_rx_frame_data_t *)rxframe + 1);
}
@@ -6040,119 +5435,6 @@ exit:
return 0;
}
-#ifdef WL_SCHED_SCAN
-/* If target scan is not reliable, set the below define to "1" to do a
- * full escan
- */
-#define FULL_ESCAN_ON_PFN_NET_FOUND 0
-static s32
-wl_notify_sched_scan_results(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data)
-{
- wl_pfn_net_info_t *netinfo, *pnetinfo;
- struct cfg80211_scan_request request;
- struct wiphy *wiphy = wl_to_wiphy(wl);
- int err = 0;
- struct cfg80211_ssid ssid[MAX_PFN_LIST_COUNT];
- struct ieee80211_channel *channel = NULL;
- int channel_req = 0;
- int band = 0;
- struct wl_pfn_scanresults *pfn_result = (struct wl_pfn_scanresults *)data;
-
- WL_DBG(("Enter\n"));
-
- if (e->event_type == WLC_E_PFN_NET_LOST) {
- WL_DBG(("PFN NET LOST event. Do Nothing \n"));
- return 0;
- }
- WL_DBG(("PFN NET FOUND event. count:%d \n", pfn_result->count));
- if (pfn_result->count > 0) {
- int i;
-
- memset(&request, 0x00, sizeof(struct cfg80211_scan_request));
- memset(&ssid, 0x00, sizeof(ssid));
- request.wiphy = wiphy;
-
- pnetinfo = (wl_pfn_net_info_t *)(data + sizeof(wl_pfn_scanresults_t)
- - sizeof(wl_pfn_net_info_t));
- channel = (struct ieee80211_channel *)kzalloc(
- (sizeof(struct ieee80211_channel) * MAX_PFN_LIST_COUNT),
- GFP_KERNEL);
- if (!channel) {
- WL_ERR(("No memory"));
- err = -ENOMEM;
- goto out_err;
- }
-
- for (i = 0; i < pfn_result->count; i++) {
- netinfo = &pnetinfo[i];
- if (!netinfo) {
- WL_ERR(("Invalid netinfo ptr. index:%d", i));
- err = -EINVAL;
- goto out_err;
- }
- WL_DBG(("SSID:%s Channel:%d \n",
- netinfo->pfnsubnet.SSID, netinfo->pfnsubnet.channel));
- /* PFN result doesn't have all the info which are required by the supplicant
- * (For e.g IEs) Do a target Escan so that sched scan results are reported
- * via wl_inform_single_bss in the required format. Escan does require the
- * scan request in the form of cfg80211_scan_request. For timebeing, create
- * cfg80211_scan_request one out of the received PNO event.
- */
- memcpy(ssid[i].ssid, netinfo->pfnsubnet.SSID,
- netinfo->pfnsubnet.SSID_len);
- ssid[i].ssid_len = netinfo->pfnsubnet.SSID_len;
- request.n_ssids++;
-
- channel_req = netinfo->pfnsubnet.channel;
- band = (channel_req <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ
- : NL80211_BAND_5GHZ;
- channel[i].center_freq = ieee80211_channel_to_frequency(channel_req, band);
- channel[i].band = band;
- channel[i].flags |= IEEE80211_CHAN_NO_HT40;
- request.channels[i] = &channel[i];
- request.n_channels++;
- }
-
- /* assign parsed ssid array */
- if (request.n_ssids)
- request.ssids = &ssid[0];
-
- if (wl_get_drv_status_all(wl, SCANNING)) {
- /* Abort any on-going scan */
- wl_notify_escan_complete(wl, ndev, true, true);
- }
-
- if (wl_get_p2p_status(wl, DISCOVERY_ON)) {
- err = wl_cfgp2p_discover_enable_search(wl, false);
- if (unlikely(err)) {
- wl_clr_drv_status(wl, SCANNING, ndev);
- goto out_err;
- }
- }
-
- wl_set_drv_status(wl, SCANNING, ndev);
-#if FULL_ESCAN_ON_PFN_NET_FOUND
- err = wl_do_escan(wl, wiphy, ndev, NULL);
-#else
- err = wl_do_escan(wl, wiphy, ndev, &request);
-#endif
- if (err) {
- wl_clr_drv_status(wl, SCANNING, ndev);
- goto out_err;
- }
- wl->sched_scan_running = TRUE;
- }
- else {
- WL_ERR(("FALSE PNO Event. (pfn_count == 0) \n"));
- }
-out_err:
- if (channel)
- kfree(channel);
- return err;
-}
-#endif /* WL_SCHED_SCAN */
-
static void wl_init_conf(struct wl_conf *conf)
{
WL_DBG(("Enter \n"));
@@ -6497,7 +5779,7 @@ static void wl_scan_timeout(unsigned long data)
if (wl->scan_request) {
WL_ERR(("timer expired\n"));
if (wl->escan_on)
- wl_notify_escan_complete(wl, wl->escan_info.ndev, true, false);
+ wl_notify_escan_complete(wl, wl->escan_info.ndev, true);
else
wl_notify_iscan_complete(wl_to_iscan(wl), true);
}
@@ -6552,99 +5834,49 @@ wl_cfg80211_netdev_notifier_call(struct notifier_block * nb,
struct wl_priv *wl = wlcfg_drv_priv;
WL_DBG(("Enter \n"));
- if (!wdev || !wl || dev == wl_to_prmry_ndev(wl))
+ if (!wdev || dev == wl_to_prmry_ndev(wl))
return NOTIFY_DONE;
switch (state) {
case NETDEV_UNREGISTER:
- /* after calling list_del_rcu(&wdev->list) */
- wl_dealloc_netinfo(wl, ndev);
- break;
+ /* after calling list_del_rcu(&wdev->list) */
+ wl_dealloc_netinfo(wl, ndev);
+ break;
case NETDEV_GOING_DOWN:
- /* At NETDEV_DOWN state, wdev_cleanup_work work will be called.
- * In front of door, the function checks
- * whether current scan is working or not.
- * If the scanning is still working, wdev_cleanup_work call WARN_ON and
- * make the scan done forcibly.
- */
- if (wl_get_drv_status(wl, SCANNING, dev)) {
- if (wl->escan_on) {
- wl_notify_escan_complete(wl, dev, true, true);
+ /* At NETDEV_DOWN state, wdev_cleanup_work work will be called.
+ * In front of door, the function checks
+ * whether current scan is working or not.
+ * If the scanning is still working, wdev_cleanup_work call WARN_ON and
+ * make the scan done forcibly.
+ */
+ if (wl_get_drv_status(wl, SCANNING, dev)) {
+ if (wl->escan_on) {
+ wl_notify_escan_complete(wl, dev, true);
+ }
}
- }
- break;
+ break;
}
return NOTIFY_DONE;
}
static struct notifier_block wl_cfg80211_netdev_notifier = {
.notifier_call = wl_cfg80211_netdev_notifier_call,
};
-
-static s32 wl_notify_escan_complete(struct wl_priv *wl,
+static void wl_notify_escan_complete(struct wl_priv *wl,
struct net_device *ndev,
- bool aborted, bool fw_abort)
+ bool aborted)
{
- wl_scan_params_t *params = NULL;
- s32 params_size = 0;
- s32 err = BCME_OK;
unsigned long flags;
- struct net_device *dev;
WL_DBG(("Enter \n"));
+ wl_clr_drv_status(wl, SCANNING, ndev);
+ if (p2p_is_on(wl))
+ wl_clr_p2p_status(wl, SCANNING);
- if (wl->scan_request) {
- if (wl->scan_request->dev == wl->p2p_net)
- dev = wl_to_prmry_ndev(wl);
- else
- dev = wl->scan_request->dev;
- }
- else {
- WL_ERR(("wl->scan_request is NULL may be internal scan."
- "doing scan_abort for ndev %p primary %p p2p_net %p",
- ndev, wl_to_prmry_ndev(wl), wl->p2p_net));
- dev = ndev;
- }
- if (fw_abort && !in_atomic()) {
- /* Our scan params only need space for 1 channel and 0 ssids */
- params = wl_cfg80211_scan_alloc_params(-1, 0, &params_size);
- if (params == NULL) {
- WL_ERR(("scan params allocation failed \n"));
- err = -ENOMEM;
- } else {
- /* Do a scan abort to stop the driver's scan engine */
- err = wldev_ioctl(dev, WLC_SCAN, params, params_size, true);
- if (err < 0) {
- WL_ERR(("scan abort failed \n"));
- }
- }
- }
- if (timer_pending(&wl->scan_timeout))
- del_timer_sync(&wl->scan_timeout);
spin_lock_irqsave(&wl->cfgdrv_lock, flags);
-
-#ifdef WL_SCHED_SCAN
- if (wl->sched_scan_req && !wl->scan_request) {
- WL_DBG((" REPORTING SCHED SCAN RESULTS \n"));
- if (aborted)
- cfg80211_sched_scan_stopped(wl->sched_scan_req->wiphy);
- else
- cfg80211_sched_scan_results(wl->sched_scan_req->wiphy);
- wl->sched_scan_running = FALSE;
- wl->sched_scan_req = NULL;
- }
-#endif /* WL_SCHED_SCAN */
-
if (likely(wl->scan_request)) {
cfg80211_scan_done(wl->scan_request, aborted);
wl->scan_request = NULL;
}
- if (p2p_is_on(wl))
- wl_clr_p2p_status(wl, SCANNING);
- wl_clr_drv_status(wl, SCANNING, dev);
spin_unlock_irqrestore(&wl->cfgdrv_lock, flags);
- if (params)
- kfree(params);
-
- return err;
}
static s32 wl_escan_handler(struct wl_priv *wl,
@@ -6660,6 +5892,7 @@ static s32 wl_escan_handler(struct wl_priv *wl,
u32 bi_length;
u32 i;
u8 *p2p_dev_addr = NULL;
+
WL_DBG((" enter event type : %d, status : %d \n",
ntoh32(e->event_type), ntoh32(e->status)));
/* P2P SCAN is coming from primary interface */
@@ -6701,7 +5934,7 @@ static s32 wl_escan_handler(struct wl_priv *wl,
if (!(wl_to_wiphy(wl)->interface_modes & BIT(NL80211_IFTYPE_ADHOC))) {
if (dtoh16(bi->capability) & DOT11_CAP_IBSS) {
- WL_DBG(("Ignoring IBSS result\n"));
+ WL_ERR(("Ignoring IBSS result\n"));
goto exit;
}
}
@@ -6711,8 +5944,7 @@ static s32 wl_escan_handler(struct wl_priv *wl,
if (p2p_dev_addr && !memcmp(p2p_dev_addr,
wl->afx_hdl->pending_tx_dst_addr.octet, ETHER_ADDR_LEN)) {
s32 channel = CHSPEC_CHANNEL(dtohchanspec(bi->chanspec));
- WL_DBG(("ACTION FRAME SCAN : Peer " MACSTR " found, channel : %d\n",
- MAC2STR(wl->afx_hdl->pending_tx_dst_addr.octet), channel));
+ WL_DBG(("ACTION FRAME SCAN : Peer found, channel : %d\n", channel));
wl_clr_p2p_status(wl, SCANNING);
wl->afx_hdl->peer_chan = channel;
complete(&wl->act_frm_scan);
@@ -6768,12 +6000,13 @@ static s32 wl_escan_handler(struct wl_priv *wl,
wl_clr_drv_status(wl, SCANNING, wl->afx_hdl->dev);
if (wl->afx_hdl->peer_chan == WL_INVALID)
complete(&wl->act_frm_scan);
- } else if ((likely(wl->scan_request)) || (wl->sched_scan_running)) {
+ } else if (likely(wl->scan_request)) {
mutex_lock(&wl->usr_sync);
+ del_timer_sync(&wl->scan_timeout);
WL_INFO(("ESCAN COMPLETED\n"));
wl->bss_list = (wl_scan_results_t *)wl->escan_info.escan_buf;
wl_inform_bss(wl);
- wl_notify_escan_complete(wl, ndev, false, false);
+ wl_notify_escan_complete(wl, ndev, false);
mutex_unlock(&wl->usr_sync);
}
}
@@ -6785,12 +6018,13 @@ static s32 wl_escan_handler(struct wl_priv *wl,
wl_clr_p2p_status(wl, SCANNING);
if (wl->afx_hdl->peer_chan == WL_INVALID)
complete(&wl->act_frm_scan);
- } else if ((likely(wl->scan_request)) || (wl->sched_scan_running)) {
+ } else if (likely(wl->scan_request)) {
mutex_lock(&wl->usr_sync);
+ del_timer_sync(&wl->scan_timeout);
WL_INFO(("ESCAN ABORTED\n"));
wl->bss_list = (wl_scan_results_t *)wl->escan_info.escan_buf;
wl_inform_bss(wl);
- wl_notify_escan_complete(wl, ndev, true, false);
+ wl_notify_escan_complete(wl, ndev, true);
mutex_unlock(&wl->usr_sync);
}
}
@@ -6803,11 +6037,12 @@ static s32 wl_escan_handler(struct wl_priv *wl,
wl_clr_drv_status(wl, SCANNING, wl->afx_hdl->dev);
if (wl->afx_hdl->peer_chan == WL_INVALID)
complete(&wl->act_frm_scan);
- } else if ((likely(wl->scan_request)) || (wl->sched_scan_running)) {
+ } else if (likely(wl->scan_request)) {
mutex_lock(&wl->usr_sync);
+ del_timer_sync(&wl->scan_timeout);
wl->bss_list = (wl_scan_results_t *)wl->escan_info.escan_buf;
wl_inform_bss(wl);
- wl_notify_escan_complete(wl, ndev, true, false);
+ wl_notify_escan_complete(wl, ndev, true);
mutex_unlock(&wl->usr_sync);
}
}
@@ -6862,7 +6097,6 @@ static s32 wl_init_priv(struct wl_priv *wl)
wl->iscan_kickstart = false;
wl->active_scan = true;
wl->rf_blocked = false;
- wl->deauth_reason = 0;
spin_lock_init(&wl->cfgdrv_lock);
mutex_init(&wl->ioctl_buf_sync);
init_waitqueue_head(&wl->netif_change_event);
@@ -6897,7 +6131,7 @@ static void wl_deinit_priv(struct wl_priv *wl)
unregister_netdevice_notifier(&wl_cfg80211_netdev_notifier);
}
-#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+#if defined(WLP2P) && ENABLE_P2P_INTERFACE
static s32 wl_cfg80211_attach_p2p(void)
{
struct wl_priv *wl = wlcfg_drv_priv;
@@ -6932,7 +6166,7 @@ static s32 wl_cfg80211_detach_p2p(void)
return 0;
}
-#endif /* defined(WLP2P) && defined(WL_ENABLE_P2P_IF) */
+#endif /* defined(WLP2P) && (ENABLE_P2P_INTERFACE) */
s32 wl_cfg80211_attach_post(struct net_device *ndev)
{
@@ -6947,7 +6181,7 @@ s32 wl_cfg80211_attach_post(struct net_device *ndev)
if (wl && !wl_get_drv_status(wl, READY, ndev)) {
if (wl->wdev &&
wl_cfgp2p_supported(wl, ndev)) {
-#if !defined(WL_ENABLE_P2P_IF)
+#if !ENABLE_P2P_INTERFACE
wl->wdev->wiphy->interface_modes |=
(BIT(NL80211_IFTYPE_P2P_CLIENT)|
BIT(NL80211_IFTYPE_P2P_GO));
@@ -6955,7 +6189,7 @@ s32 wl_cfg80211_attach_post(struct net_device *ndev)
if ((err = wl_cfgp2p_init_priv(wl)) != 0)
goto fail;
-#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+#if defined(WLP2P) && ENABLE_P2P_INTERFACE
if (wl->p2p_net) {
/* Update MAC addr for p2p0 interface here. */
memcpy(wl->p2p_net->dev_addr, ndev->dev_addr, ETH_ALEN);
@@ -6967,7 +6201,7 @@ s32 wl_cfg80211_attach_post(struct net_device *ndev)
" Couldn't update the MAC Address for p2p0 \n"));
return -ENODEV;
}
-#endif /* defined(WLP2P) && (WL_ENABLE_P2P_IF) */
+#endif /* defined(WLP2P) && (ENABLE_P2P_INTERFACE) */
wl->p2p_supported = true;
}
@@ -7039,7 +6273,7 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
wlcfg_drv_priv = wl;
-#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+#if defined(WLP2P) && ENABLE_P2P_INTERFACE
err = wl_cfg80211_attach_p2p();
if (err)
goto cfg80211_attach_out;
@@ -7066,7 +6300,7 @@ void wl_cfg80211_detach(void *para)
wl_cfg80211_btcoex_deinit(wl);
#endif
-#if defined(WLP2P) && defined(WL_ENABLE_P2P_IF)
+#if defined(WLP2P) && ENABLE_P2P_INTERFACE
wl_cfg80211_detach_p2p();
#endif
wl_setup_rfkill(wl, FALSE);
@@ -7183,11 +6417,7 @@ wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t * e, void *data)
switch (event_type) {
case WLC_E_PFN_NET_FOUND:
- WL_DBG((" PNOEVENT: PNO_NET_FOUND\n"));
- break;
- case WLC_E_PFN_NET_LOST:
- WL_DBG((" PNOEVENT: PNO_NET_LOST\n"));
- break;
+ WL_ERR((" PNO Event\n"));
case WLC_E_ASSOCREQ_IE:
WL_ERR(("WLC_E_ASSOCREQ_IE\n"));
if (!ap_resp_ie_len)
@@ -7362,198 +6592,33 @@ eventmsg_out:
}
-static int wl_construct_reginfo(struct wl_priv *wl, s32 bw_cap)
-{
- struct net_device *dev = wl_to_prmry_ndev(wl);
- struct ieee80211_channel *band_chan_arr = NULL;
- wl_uint32_list_t *list;
- u32 i, j, index, n_2g, n_5g, band, channel, array_size;
- u32 *n_cnt = NULL;
- chanspec_t c = 0;
- s32 err = BCME_OK;
- bool update;
- bool ht40_allowed;
- u8 *pbuf = NULL;
-
-#define LOCAL_BUF_LEN 1024
- pbuf = kzalloc(LOCAL_BUF_LEN, GFP_KERNEL);
- if (pbuf == NULL) {
- WL_ERR(("failed to allocate local buf\n"));
- return -ENOMEM;
- }
-
- list = (wl_uint32_list_t *)(void *)pbuf;
- list->count = htod32(WL_NUMCHANSPECS);
-
- err = wldev_iovar_getbuf_bsscfg(dev, "chanspecs", NULL,
- 0, pbuf, LOCAL_BUF_LEN, 0, &wl->ioctl_buf_sync);
- if (err != 0) {
- WL_ERR(("get chanspecs failed with %d\n", err));
- kfree(pbuf);
- return err;
- }
-#undef LOCAL_BUF_LEN
-
- band = array_size = n_2g = n_5g = 0;
- for (i = 0; i < dtoh32(list->count); i++) {
- index = 0;
- update = FALSE;
- ht40_allowed = FALSE;
- c = (chanspec_t)dtoh32(list->element[i]);
- channel = CHSPEC_CHANNEL(c);
- if (CHSPEC_IS40(c)) {
- if (CHSPEC_SB_UPPER(c))
- channel += CH_10MHZ_APART;
- else
- channel -= CH_10MHZ_APART;
- }
-
- if (CHSPEC_IS2G(c) && channel <= CH_MAX_2G_CHANNEL) {
- band_chan_arr = __wl_2ghz_channels;
- array_size = ARRAYSIZE(__wl_2ghz_channels);
- n_cnt = &n_2g;
- band = IEEE80211_BAND_2GHZ;
- ht40_allowed = (bw_cap == WLC_N_BW_40ALL) ? TRUE : FALSE;
- } else if (CHSPEC_IS5G(c) && channel > CH_MAX_2G_CHANNEL) {
- band_chan_arr = __wl_5ghz_a_channels;
- array_size = ARRAYSIZE(__wl_5ghz_a_channels);
- n_cnt = &n_5g;
- band = IEEE80211_BAND_5GHZ;
- ht40_allowed = (bw_cap == WLC_N_BW_20ALL) ? FALSE : TRUE;
- }
-
- for (j = 0; (j < *n_cnt && (*n_cnt < array_size)); j++) {
- if (band_chan_arr[j].hw_value == channel) {
- update = TRUE;
- break;
- }
- }
-
- if (update)
- index = j;
- else
- index = *n_cnt;
-
- if (index < array_size) {
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 38) && !defined(WL_COMPAT_WIRELESS)
- band_chan_arr[index].center_freq =
- ieee80211_channel_to_frequency(channel);
-#else
- band_chan_arr[index].center_freq =
- ieee80211_channel_to_frequency(channel, band);
-#endif
- band_chan_arr[index].hw_value = channel;
-
- if (CHSPEC_IS40(c) && ht40_allowed) {
- u32 ht40_flag = band_chan_arr[index].flags & IEEE80211_CHAN_NO_HT40;
- if (CHSPEC_SB_UPPER(c)) {
- if (ht40_flag == IEEE80211_CHAN_NO_HT40)
- band_chan_arr[index].flags &= ~IEEE80211_CHAN_NO_HT40;
- band_chan_arr[index].flags |= IEEE80211_CHAN_NO_HT40PLUS;
- } else {
- band_chan_arr[index].flags &= ~IEEE80211_CHAN_NO_HT40;
- if (ht40_flag == IEEE80211_CHAN_NO_HT40)
- band_chan_arr[index].flags |= IEEE80211_CHAN_NO_HT40MINUS;
- }
- } else {
- band_chan_arr[index].flags = IEEE80211_CHAN_NO_HT40;
- if (band == IEEE80211_BAND_2GHZ)
- channel |= WL_CHANSPEC_BAND_2G;
- else
- channel |= WL_CHANSPEC_BAND_5G;
- err = wldev_iovar_getint(dev, "per_chan_info", &channel);
- if (!err) {
- if (channel & WL_CHAN_RADAR) {
- band_chan_arr[index].flags |= IEEE80211_CHAN_RADAR | IEEE80211_CHAN_NO_IBSS;
- }
- if (channel & WL_CHAN_PASSIVE) {
- band_chan_arr[index].flags |= IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_NO_IBSS;
- }
- }
- }
-
- if (!update)
- (*n_cnt)++;
- }
- }
-
- __wl_band_2ghz.n_channels = n_2g;
- __wl_band_5ghz_a.n_channels = n_5g;
-
- kfree(pbuf);
- return err;
-}
-
s32 wl_update_wiphybands(struct wl_priv *wl)
{
struct wiphy *wiphy;
- struct net_device *dev;
u32 bandlist[3];
u32 nband = 0;
u32 i = 0;
s32 err = 0;
- int nmode = 0;
- int bw_cap = 0;
- int index = 0;
-
WL_DBG(("Entry"));
-
- if (wl == NULL)
- wl = wlcfg_drv_priv;
- dev = wl_to_prmry_ndev(wl);
-
memset(bandlist, 0, sizeof(bandlist));
- err = wldev_ioctl(dev, WLC_GET_BANDLIST, bandlist,
+ err = wldev_ioctl(wl_to_prmry_ndev(wl), WLC_GET_BANDLIST, bandlist,
sizeof(bandlist), false);
if (unlikely(err)) {
- WL_ERR(("error read bandlist (%d)\n", err));
- return err;
- }
-
- err = wldev_iovar_getint(dev, "nmode", &nmode);
- if (unlikely(err)) {
- WL_ERR(("error reading nmode (%d)\n", err));
- } else {
- /* For nmodeonly check bw cap */
- err = wldev_iovar_getint(dev, "mimo_bw_cap", &bw_cap);
- if (unlikely(err)) {
- WL_ERR(("error get mimo_bw_cap (%d)\n", err));
- }
- }
-
- err = wl_construct_reginfo(wl, bw_cap);
- if (err) {
- WL_ERR(("wl_construct_reginfo() fails err=%d\n", err));
+ WL_ERR(("error (%d)\n", err));
return err;
}
wiphy = wl_to_wiphy(wl);
nband = bandlist[0];
- wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
- for (i = 1; i <= nband && i < sizeof(bandlist)/sizeof(u32); i++) {
- index = -1;
- if (bandlist[i] == WLC_BAND_5G && __wl_band_5ghz_a.n_channels > 0) {
+ wiphy->bands[IEEE80211_BAND_2GHZ] = NULL;
+ for (i = 1; i <= nband && i < sizeof(bandlist); i++) {
+ if (bandlist[i] == WLC_BAND_5G)
wiphy->bands[IEEE80211_BAND_5GHZ] =
&__wl_band_5ghz_a;
- index = IEEE80211_BAND_5GHZ;
- if (bw_cap == WLC_N_BW_40ALL || bw_cap == WLC_N_BW_20IN2G_40IN5G)
- wiphy->bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40;
- } else if (bandlist[i] == WLC_BAND_2G && __wl_band_2ghz.n_channels > 0) {
+ else if (bandlist[i] == WLC_BAND_2G)
wiphy->bands[IEEE80211_BAND_2GHZ] =
&__wl_band_2ghz;
- index = IEEE80211_BAND_2GHZ;
- if (bw_cap == WLC_N_BW_40ALL)
- wiphy->bands[index]->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40;
- }
- if ((index >= 0) && nmode) {
- wiphy->bands[index]->ht_cap.cap |=
- IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_DSSSCCK40;
- wiphy->bands[index]->ht_cap.ht_supported = TRUE;
- wiphy->bands[index]->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
- wiphy->bands[index]->ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_16;
- }
}
-
wiphy_apply_custom_regulatory(wiphy, &brcm_regdom);
return err;
}
@@ -7591,10 +6656,6 @@ static s32 __wl_cfg80211_down(struct wl_priv *wl)
unsigned long flags;
struct net_info *iter, *next;
struct net_device *ndev = wl_to_prmry_ndev(wl);
-#ifdef WL_ENABLE_P2P_IF
- struct wiphy *wiphy = wl_to_prmry_ndev(wl)->ieee80211_ptr->wiphy;
- struct net_device *p2p_net = wl->p2p_net;
-#endif
WL_DBG(("In\n"));
/* Check if cfg80211 interface is already down */
@@ -7621,15 +6682,6 @@ static s32 __wl_cfg80211_down(struct wl_priv *wl)
}
wl_to_prmry_ndev(wl)->ieee80211_ptr->iftype =
NL80211_IFTYPE_STATION;
-#ifdef WL_ENABLE_P2P_IF
- wiphy->interface_modes = (wiphy->interface_modes)
- & (~(BIT(NL80211_IFTYPE_P2P_CLIENT)|
- BIT(NL80211_IFTYPE_P2P_GO)));
- if ((p2p_net) && (p2p_net->flags & IFF_UP)) {
- /* p2p0 interface is still UP. Bring it down */
- p2p_net->flags &= ~IFF_UP;
- }
-#endif /* WL_ENABLE_P2P_IF */
spin_unlock_irqrestore(&wl->cfgdrv_lock, flags);
DNGL_FUNC(dhd_cfg80211_down, (wl));
@@ -7879,14 +6931,14 @@ static void wl_init_eq_lock(struct wl_priv *wl)
static void wl_delay(u32 ms)
{
- if (in_atomic() || ms < 1000 / HZ) {
+ if (ms < 1000 / HZ) {
+ cond_resched();
mdelay(ms);
} else {
msleep(ms);
}
}
-
s32 wl_cfg80211_get_p2p_dev_addr(struct net_device *net, struct ether_addr *p2pdev_addr)
{
struct wl_priv *wl = wlcfg_drv_priv;
@@ -7935,44 +6987,17 @@ s32 wl_cfg80211_set_wps_p2p_ie(struct net_device *net, char *buf, int len,
{
struct wl_priv *wl;
struct net_device *ndev = NULL;
- struct ether_addr primary_mac;
s32 ret = 0;
s32 bssidx = 0;
s32 pktflag = 0;
wl = wlcfg_drv_priv;
-
- if (wl_get_drv_status(wl, AP_CREATING, net) ||
+ if (wl->p2p && wl->p2p->vif_created) {
+ ndev = wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION);
+ bssidx = wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_CONNECTION);
+ } else if (wl_get_drv_status(wl, AP_CREATING, net) ||
wl_get_drv_status(wl, AP_CREATED, net)) {
ndev = net;
bssidx = 0;
- } else if (wl->p2p) {
- if (net == wl->p2p_net) {
- net = wl_to_prmry_ndev(wl);
- }
-
- if (!wl->p2p->on) {
- get_primary_mac(wl, &primary_mac);
- wl_cfgp2p_generate_bss_mac(&primary_mac, &wl->p2p->dev_addr,
- &wl->p2p->int_addr);
- /* In case of p2p_listen command, supplicant send remain_on_channel
- * without turning on P2P
- */
- p2p_on(wl) = true;
- ret = wl_cfgp2p_enable_discovery(wl, ndev, NULL, 0);
-
- if (unlikely(ret)) {
- goto exit;
- }
- }
- if (net != wl_to_prmry_ndev(wl)) {
- if (wl_get_mode_by_netdev(wl, net) == WL_MODE_AP) {
- ndev = wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION);
- bssidx = wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_CONNECTION);
- }
- } else {
- ndev = wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_PRIMARY);
- bssidx = wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE);
- }
}
if (ndev != NULL) {
switch (type) {
@@ -7989,7 +7014,7 @@ s32 wl_cfg80211_set_wps_p2p_ie(struct net_device *net, char *buf, int len,
if (pktflag)
ret = wl_cfgp2p_set_management_ie(wl, ndev, bssidx, pktflag, buf, len);
}
-exit:
+
return ret;
}
diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.h b/drivers/net/wireless/bcmdhd/wl_cfg80211.h
index b471f14c901e..119a039d1f04 100755
--- a/drivers/net/wireless/bcmdhd/wl_cfg80211.h
+++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.h
@@ -131,21 +131,9 @@ do { \
#define IFACE_MAX_CNT 2
#define WL_SCAN_TIMER_INTERVAL_MS 8000 /* Scan timeout */
-#define WL_CHANNEL_SYNC_RETRY 3
-#define WL_ACT_FRAME_RETRY 4
-
+#define WL_CHANNEL_SYNC_RETRY 5
#define WL_INVALID -1
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0) && defined(PNO_SUPPORT) && 0
-#define WL_SCHED_SCAN 1
-#endif
-
-/* Bring down SCB Timeout to 20secs from 60secs default */
-#ifndef WL_SCB_TIMEOUT
-#define WL_SCB_TIMEOUT 20
-#endif
-
-
/* driver status */
enum wl_status {
WL_STATUS_READY = 0,
@@ -454,12 +442,6 @@ struct wl_priv {
bool p2p_supported;
struct btcoex_info *btcoex_info;
struct timer_list scan_timeout; /* Timer for catch scan event timeout */
-#ifdef WL_SCHED_SCAN
- struct cfg80211_sched_scan_request *sched_scan_req; /* scheduled scan req */
-#endif /* WL_SCHED_SCAN */
- bool sched_scan_running; /* scheduled scan req status */
- u16 hostapd_chan; /* remember chan requested by framework for hostapd */
- u16 deauth_reason; /* Place holder to save deauth/disassoc reasons */
};
@@ -654,7 +636,7 @@ extern s32 wl_cfg80211_down(void *para);
extern s32 wl_cfg80211_notify_ifadd(struct net_device *ndev, s32 idx, s32 bssidx,
void* _net_attach);
extern s32 wl_cfg80211_ifdel_ops(struct net_device *net);
-extern s32 wl_cfg80211_notify_ifdel(void);
+extern s32 wl_cfg80211_notify_ifdel(struct net_device *ndev);
extern s32 wl_cfg80211_is_progress_ifadd(void);
extern s32 wl_cfg80211_is_progress_ifchange(void);
extern s32 wl_cfg80211_is_progress_ifadd(void);
@@ -670,6 +652,9 @@ extern int wl_cfg80211_hang(struct net_device *dev, u16 reason);
extern s32 wl_mode_to_nl80211_iftype(s32 mode);
int wl_cfg80211_do_driver_init(struct net_device *net);
void wl_cfg80211_enable_trace(int level);
-extern s32 wl_update_wiphybands(struct wl_priv *wl);
+
+/* do scan abort */
+extern s32 wl_cfg80211_scan_abort(struct wl_priv *wl, struct net_device *ndev);
+
extern s32 wl_cfg80211_if_is_group_owner(void);
#endif /* _wl_cfg80211_h_ */
diff --git a/drivers/net/wireless/bcmdhd/wl_cfgp2p.c b/drivers/net/wireless/bcmdhd/wl_cfgp2p.c
index bd9bc7825fac..3cc6ece58ef8 100755
--- a/drivers/net/wireless/bcmdhd/wl_cfgp2p.c
+++ b/drivers/net/wireless/bcmdhd/wl_cfgp2p.c
@@ -59,9 +59,6 @@ static int wl_cfgp2p_start_xmit(struct sk_buff *skb, struct net_device *ndev);
static int wl_cfgp2p_do_ioctl(struct net_device *net, struct ifreq *ifr, int cmd);
static int wl_cfgp2p_if_open(struct net_device *net);
static int wl_cfgp2p_if_stop(struct net_device *net);
-static s32 wl_cfgp2p_cancel_listen(struct wl_priv *wl, struct net_device *ndev,
- bool notify);
-
static const struct net_device_ops wl_cfgp2p_if_ops = {
.ndo_open = wl_cfgp2p_if_open,
@@ -279,6 +276,7 @@ wl_cfgp2p_init_priv(struct wl_priv *wl)
wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE) = 0;
wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION) = NULL;
wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_CONNECTION) = 0;
+ spin_lock_init(&wl->p2p->timer_lock);
return BCME_OK;
}
@@ -325,7 +323,7 @@ wl_cfgp2p_set_firm_p2p(struct wl_priv *wl)
ret = wldev_iovar_setbuf_bsscfg(ndev, "p2p_da_override", &null_eth_addr,
sizeof(null_eth_addr), wl->ioctl_buf, WLC_IOCTL_MAXLEN, 0, &wl->ioctl_buf_sync);
if (ret && ret != BCME_UNSUPPORTED) {
- CFGP2P_ERR(("failed to update device address ret %d\n", ret));
+ CFGP2P_ERR(("failed to update device address\n"));
}
return ret;
}
@@ -344,7 +342,6 @@ wl_cfgp2p_ifadd(struct wl_priv *wl, struct ether_addr *mac, u8 if_type,
wl_p2p_if_t ifreq;
s32 err;
struct net_device *ndev = wl_to_prmry_ndev(wl);
- u32 scb_timeout = WL_SCB_TIMEOUT;
ifreq.type = if_type;
ifreq.chspec = chspec;
@@ -358,15 +355,6 @@ wl_cfgp2p_ifadd(struct wl_priv *wl, struct ether_addr *mac, u8 if_type,
err = wldev_iovar_setbuf(ndev, "p2p_ifadd", &ifreq, sizeof(ifreq),
wl->ioctl_buf, WLC_IOCTL_MAXLEN, &wl->ioctl_buf_sync);
-
- if (unlikely(err < 0)) {
- printk("'wl p2p_ifadd' error %d\n", err);
- } else if (if_type == WL_P2P_IF_GO) {
- err = wldev_ioctl(ndev, WLC_SET_SCB_TIMEOUT, &scb_timeout, sizeof(u32), true);
- if (unlikely(err < 0))
- printk("'wl scb_timeout' error %d\n", err);
- }
-
return err;
}
@@ -403,7 +391,6 @@ wl_cfgp2p_ifchange(struct wl_priv *wl, struct ether_addr *mac, u8 if_type,
{
wl_p2p_if_t ifreq;
s32 err;
- u32 scb_timeout = WL_SCB_TIMEOUT;
struct net_device *netdev = wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_CONNECTION);
ifreq.type = if_type;
@@ -421,10 +408,6 @@ wl_cfgp2p_ifchange(struct wl_priv *wl, struct ether_addr *mac, u8 if_type,
if (unlikely(err < 0)) {
printk("'wl p2p_ifupd' error %d\n", err);
- } else if (if_type == WL_P2P_IF_GO) {
- err = wldev_ioctl(netdev, WLC_SET_SCB_TIMEOUT, &scb_timeout, sizeof(u32), true);
- if (unlikely(err < 0))
- printk("'wl scb_timeout' error %d\n", err);
}
return err;
}
@@ -561,7 +544,7 @@ wl_cfgp2p_init_discovery(struct wl_priv *wl)
/* Set the initial discovery state to SCAN */
ret = wl_cfgp2p_set_p2p_mode(wl, WL_P2P_DISC_ST_SCAN, 0, 0,
- wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE));
+ wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE));
if (unlikely(ret != 0)) {
CFGP2P_ERR(("unable to set WL_P2P_DISC_ST_SCAN\n"));
@@ -712,7 +695,7 @@ wl_cfgp2p_escan(struct wl_priv *wl, struct net_device *dev, u16 active,
#define P2PAPI_SCAN_NPROBES 1
#define P2PAPI_SCAN_DWELL_TIME_MS 50
#define P2PAPI_SCAN_SOCIAL_DWELL_TIME_MS 40
-#define P2PAPI_SCAN_HOME_TIME_MS 60
+#define P2PAPI_SCAN_HOME_TIME_MS 10
struct net_device *pri_dev = wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_PRIMARY);
wl_set_p2p_status(wl, SCANNING);
/* Allocate scan params which need space for 3 channels and 0 ssids */
@@ -925,10 +908,6 @@ wl_cfgp2p_set_management_ie(struct wl_priv *wl, struct net_device *ndev, s32 bss
mgmt_ie_len = &wl->ap_info->beacon_ie_len;
mgmt_ie_buf_len = sizeof(wl->ap_info->beacon_ie);
break;
- case VNDR_IE_ASSOCRSP_FLAG :
- /* penguin, temporary do nothing here, we may need to add the IE later */
- return 0;
-
default:
mgmt_ie_buf = NULL;
mgmt_ie_len = NULL;
@@ -1206,15 +1185,12 @@ wl_cfgp2p_listen_complete(struct wl_priv *wl, struct net_device *ndev,
s32 ret = BCME_OK;
CFGP2P_DBG((" Enter\n"));
-
- /* If p2p_info is de-initialized, do nothing */
- if (!wl->p2p)
- return ret;
-
if (wl_get_p2p_status(wl, LISTEN_EXPIRED) == 0) {
wl_set_p2p_status(wl, LISTEN_EXPIRED);
if (timer_pending(&wl->p2p->listen_timer)) {
+ spin_lock_bh(&wl->p2p->timer_lock);
del_timer_sync(&wl->p2p->listen_timer);
+ spin_unlock_bh(&wl->p2p->timer_lock);
}
cfg80211_remain_on_channel_expired(ndev, wl->last_roc_id, &wl->remain_on_chan,
wl->remain_on_chan_type, GFP_KERNEL);
@@ -1237,39 +1213,11 @@ wl_cfgp2p_listen_expired(unsigned long data)
struct wl_priv *wl = (struct wl_priv *) data;
CFGP2P_DBG((" Enter\n"));
- memset(&msg, 0, sizeof(wl_event_msg_t));
msg.event_type = hton32(WLC_E_P2P_DISC_LISTEN_COMPLETE);
wl_cfg80211_event(wl_to_p2p_bss_ndev(wl, P2PAPI_BSSCFG_DEVICE), &msg, NULL);
}
/*
- * Routine for cancelling the P2P LISTEN
- */
-static s32
-wl_cfgp2p_cancel_listen(struct wl_priv *wl, struct net_device *ndev,
- bool notify)
-{
- WL_DBG(("Enter \n"));
-
- /* Irrespective of whether timer is running or not, reset
- * the LISTEN state.
- */
- wl_cfgp2p_set_p2p_mode(wl, WL_P2P_DISC_ST_SCAN, 0, 0,
- wl_to_p2p_bss_bssidx(wl, P2PAPI_BSSCFG_DEVICE));
-
- if (timer_pending(&wl->p2p->listen_timer)) {
- del_timer_sync(&wl->p2p->listen_timer);
-
- if (notify)
- cfg80211_remain_on_channel_expired(ndev, wl->last_roc_id,
- &wl->remain_on_chan, wl->remain_on_chan_type, GFP_KERNEL);
- }
-
-
- return 0;
-}
-
-/*
* Do a P2P Listen on the given channel for the given duration.
* A listen consists of sitting idle and responding to P2P probe requests
* with a P2P probe response.
@@ -1410,12 +1358,13 @@ wl_cfgp2p_tx_action_frame(struct wl_priv *wl, struct net_device *dev,
wl->ioctl_buf, WLC_IOCTL_MAXLEN, bssidx, &wl->ioctl_buf_sync);
if (ret < 0) {
+
CFGP2P_ERR((" sending action frame is failed\n"));
goto exit;
}
timeout = wait_event_interruptible_timeout(wl->netif_change_event,
- (wl_get_p2p_status(wl, ACTION_TX_COMPLETED) || wl_get_p2p_status(wl, ACTION_TX_NOACK)),
- msecs_to_jiffies(MAX_WAIT_TIME));
+ (wl_get_p2p_status(wl, ACTION_TX_COMPLETED) || wl_get_p2p_status(wl, ACTION_TX_NOACK)),
+ msecs_to_jiffies(MAX_WAIT_TIME));
if (timeout > 0 && wl_get_p2p_status(wl, ACTION_TX_COMPLETED)) {
CFGP2P_INFO(("tx action frame operation is completed\n"));
@@ -1587,10 +1536,8 @@ wl_cfgp2p_supported(struct wl_priv *wl, struct net_device *ndev)
s32
wl_cfgp2p_down(struct wl_priv *wl)
{
-
- wl_cfgp2p_cancel_listen(wl,
- wl->p2p_net ? wl->p2p_net : wl_to_prmry_ndev(wl), TRUE);
-
+ if (timer_pending(&wl->p2p->listen_timer))
+ del_timer_sync(&wl->p2p->listen_timer);
wl_cfgp2p_deinit_priv(wl);
return 0;
}
diff --git a/drivers/net/wireless/bcmdhd/wl_cfgp2p.h b/drivers/net/wireless/bcmdhd/wl_cfgp2p.h
index 05323ed5d481..1e5b1197e92d 100755
--- a/drivers/net/wireless/bcmdhd/wl_cfgp2p.h
+++ b/drivers/net/wireless/bcmdhd/wl_cfgp2p.h
@@ -42,7 +42,7 @@ typedef enum {
P2PAPI_BSSCFG_MAX
} p2p_bsscfg_type_t;
-#define IE_MAX_LEN 512
+#define IE_MAX_LEN 300
/* Structure to hold all saved P2P and WPS IEs for a BSSCFG */
struct p2p_saved_ie {
u8 p2p_probe_req_ie[IE_MAX_LEN];
@@ -77,6 +77,7 @@ struct p2p_info {
wl_p2p_sched_t noa;
wl_p2p_ops_t ops;
wlc_ssid_t ssid;
+ spinlock_t timer_lock;
};
/* dongle status */
@@ -91,8 +92,7 @@ enum wl_cfgp2p_status {
WLP2P_STATUS_LISTEN_EXPIRED,
WLP2P_STATUS_ACTION_TX_COMPLETED,
WLP2P_STATUS_ACTION_TX_NOACK,
- WLP2P_STATUS_SCANNING,
- WLP2P_STATUS_GO_NEG_PHASE
+ WLP2P_STATUS_SCANNING
};
@@ -268,16 +268,14 @@ wl_cfgp2p_unregister_ndev(struct wl_priv *wl);
#define WL_P2P_INTERFACE_PREFIX "p2p"
#define WL_P2P_TEMP_CHAN "11"
-/* If the provision discovery is for JOIN operations, then we need not do an internal scan to find GO */
-#define IS_PROV_DISC_WITHOUT_GROUP_ID(p2p_ie, len) (wl_cfgp2p_retreive_p2pattrib(p2p_ie, P2P_SEID_GROUP_ID) == NULL )
#define IS_GAS_REQ(frame, len) (wl_cfgp2p_is_gas_action(frame, len) && \
((frame->action == P2PSD_ACTION_ID_GAS_IREQ) || \
(frame->action == P2PSD_ACTION_ID_GAS_CREQ)))
-#define IS_P2P_PUB_ACT_REQ(frame, p2p_ie, len) (wl_cfgp2p_is_pub_action(frame, len) && \
+#define IS_P2P_PUB_ACT_REQ(frame, len) (wl_cfgp2p_is_pub_action(frame, len) && \
((frame->subtype == P2P_PAF_GON_REQ) || \
(frame->subtype == P2P_PAF_INVITE_REQ) || \
- ((frame->subtype == P2P_PAF_PROVDIS_REQ) && IS_PROV_DISC_WITHOUT_GROUP_ID(p2p_ie, len))))
+ (frame->subtype == P2P_PAF_PROVDIS_REQ)))
#define IS_P2P_SOCIAL(ch) ((ch == SOCIAL_CHAN_1) || (ch == SOCIAL_CHAN_2) || (ch == SOCIAL_CHAN_3))
#define IS_P2P_SSID(ssid) (memcmp(ssid, WL_P2P_WILDCARD_SSID, WL_P2P_WILDCARD_SSID_LEN) == 0)
#endif /* _wl_cfgp2p_h_ */
diff --git a/drivers/net/wireless/bcmdhd/wl_iw.c b/drivers/net/wireless/bcmdhd/wl_iw.c
index 48b8efeb3b52..88612920afdf 100755
--- a/drivers/net/wireless/bcmdhd/wl_iw.c
+++ b/drivers/net/wireless/bcmdhd/wl_iw.c
@@ -2,13 +2,13 @@
* Linux Wireless Extensions support
*
* Copyright (C) 1999-2011, Broadcom Corporation
- *
+ *
* Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
* following added to such license:
- *
+ *
* As a special exception, the copyright holders of this software give you
* permission to link this software with independent modules, and to copy and
* distribute the resulting executable under terms of your choice, provided that
@@ -16,7 +16,7 @@
* the license of that module. An independent module is a module which is not
* derived from this software. The special exception does not apply to any
* modifications of the software.
- *
+ *
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
@@ -63,17 +63,22 @@ typedef const struct si_pub si_t;
#define WL_PNO(x)
#endif
+#ifdef WL_PROTECT
+wlp_info_t *g_wl_protect = NULL;
+atomic_t g_fw_err_flag = ATOMIC_INIT(WIFI_FIRMWARE_RECOVER);
+atomic_t g_fw_reload_over_flag = ATOMIC_INIT(WIFI_FIRMWARE_RECOVER);
+#endif
#define JF2MS ((((jiffies / HZ) * 1000) + ((jiffies % HZ) * 1000) / HZ))
-#ifdef COEX_DBG
+#ifdef COEX_DBG
#define WL_TRACE_COEX(x) printf("TS:%lu ", JF2MS); \
printf x
#else
#define WL_TRACE_COEX(x)
#endif
-#ifdef SCAN_DBG
+#ifdef SCAN_DBG
#define WL_TRACE_SCAN(x) printf("TS:%lu ", JF2MS); \
printf x
#else
@@ -96,7 +101,7 @@ typedef const struct si_pub si_t;
#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010
#endif
-#endif
+#endif
#ifdef BCMWAPI_WPI
/* these items should evetually go into wireless.h of the linux system headfile dir */
@@ -141,8 +146,8 @@ bool g_set_essid_before_scan = TRUE;
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
- struct mutex g_wl_ss_scan_lock;
-#endif
+ struct mutex g_wl_ss_scan_lock;
+#endif
#if defined(SOFTAP)
#define WL_SOFTAP(x)
@@ -150,10 +155,10 @@ static struct net_device *priv_dev;
extern bool ap_cfg_running;
extern bool ap_fw_loaded;
struct net_device *ap_net_dev = NULL;
-tsk_ctl_t ap_eth_ctl;
+tsk_ctl_t ap_eth_ctl;
static int wl_iw_set_ap_security(struct net_device *dev, struct ap_profile *ap);
static int wl_iw_softap_deassoc_stations(struct net_device *dev, u8 *mac);
-#endif
+#endif
#define WL_IW_IOCTL_CALL(func_call) \
@@ -186,12 +191,12 @@ static struct mutex wl_softap_lock;
#define DHD_OS_MUTEX_LOCK(a)
#define DHD_OS_MUTEX_UNLOCK(a)
-#endif
+#endif
#include <bcmsdbus.h>
extern void dhd_customer_gpio_wlan_ctrl(int onoff);
extern uint dhd_dev_reset(struct net_device *dev, uint8 flag);
-extern int dhd_dev_init_ioctl(struct net_device *dev);
+extern void dhd_dev_init_ioctl(struct net_device *dev);
uint wl_msg_level = WL_ERROR_VAL;
@@ -205,54 +210,57 @@ uint wl_msg_level = WL_ERROR_VAL;
#define htodchanspec(i) i
#define dtohchanspec(i) i
+#ifdef CONFIG_WIRELESS_EXT
+
extern struct iw_statistics *dhd_get_wireless_stats(struct net_device *dev);
extern int dhd_wait_pend8021x(struct net_device *dev);
+#endif
#if WIRELESS_EXT < 19
#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
-#endif
+#endif
static void *g_scan = NULL;
-static volatile uint g_scan_specified_ssid;
-static wlc_ssid_t g_specific_ssid;
+static volatile uint g_scan_specified_ssid;
+static wlc_ssid_t g_specific_ssid;
static wlc_ssid_t g_ssid;
#ifdef CONFIG_WPS2
static char *g_wps_probe_req_ie;
static int g_wps_probe_req_ie_len;
-#endif
+#endif
-bool btcoex_is_sco_active(struct net_device *dev);
-static wl_iw_ss_cache_ctrl_t g_ss_cache_ctrl;
+bool btcoex_is_sco_active(struct net_device *dev);
+static wl_iw_ss_cache_ctrl_t g_ss_cache_ctrl;
#if defined(CONFIG_FIRST_SCAN)
-static volatile uint g_first_broadcast_scan;
+static volatile uint g_first_broadcast_scan;
static volatile uint g_first_counter_scans;
#define MAX_ALLOWED_BLOCK_SCAN_FROM_FIRST_SCAN 3
-#endif
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0))
#define DAEMONIZE(a) daemonize(a); \
allow_signal(SIGKILL); \
allow_signal(SIGTERM);
-#else
+#else
#define RAISE_RX_SOFTIRQ() \
cpu_raise_softirq(smp_processor_id(), NET_RX_SOFTIRQ)
#define DAEMONIZE(a) daemonize(); \
do { if (a) \
strncpy(current->comm, a, MIN(sizeof(current->comm), (strlen(a) + 1))); \
} while (0);
-#endif
+#endif
#if defined(WL_IW_USE_ISCAN)
#if !defined(CSCAN)
static void wl_iw_free_ss_cache(void);
static int wl_iw_run_ss_cache_timer(int kick_off);
-#endif
+#endif
#if defined(CONFIG_FIRST_SCAN)
int wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag);
-#endif
+#endif
static int dev_wlc_bufvar_set(struct net_device *dev, char *name, char *buf, int len);
#define ISCAN_STATE_IDLE 0
#define ISCAN_STATE_SCANING 1
@@ -273,29 +281,29 @@ typedef struct iscan_info {
iscan_buf_t * list_hdr;
iscan_buf_t * list_cur;
-
+
tsk_ctl_t tsk_ctl;
- uint32 scan_flag;
+ uint32 scan_flag;
#if defined CSCAN
char ioctlbuf[WLC_IOCTL_MEDLEN];
#else
char ioctlbuf[WLC_IOCTL_SMLEN];
-#endif
-
+#endif
+
wl_iscan_params_t *iscan_ex_params_p;
int iscan_ex_param_size;
} iscan_info_t;
-#define COEX_DHCP 1
+#define COEX_DHCP 1
#ifdef COEX_DHCP
-#define BT_DHCP_eSCO_FIX
-#define BT_DHCP_USE_FLAGS
-#define BT_DHCP_OPPORTUNITY_WINDOW_TIME 2500
-#define BT_DHCP_FLAG_FORCE_TIME 5500
+#define BT_DHCP_eSCO_FIX
+#define BT_DHCP_USE_FLAGS
+#define BT_DHCP_OPPORTUNITY_WINDOW_TIME 2500
+#define BT_DHCP_FLAG_FORCE_TIME 5500
@@ -322,26 +330,26 @@ typedef struct bt_info {
struct timer_list timer;
uint32 timer_ms;
uint32 timer_on;
- uint32 ts_dhcp_start;
- uint32 ts_dhcp_ok;
- bool dhcp_done;
+ uint32 ts_dhcp_start;
+ uint32 ts_dhcp_ok;
+ bool dhcp_done;
int bt_state;
-
+
tsk_ctl_t tsk_ctl;
} bt_info_t;
bt_info_t *g_bt = NULL;
static void wl_iw_bt_timerfunc(ulong data);
-#endif
+#endif
iscan_info_t *g_iscan = NULL;
void dhd_print_buf(void *pbuf, int len, int bytes_per_line);
static void wl_iw_timerfunc(ulong data);
static void wl_iw_set_event_mask(struct net_device *dev);
static int
wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, uint16 action);
-#endif
+#endif
static int
wl_iw_set_scan(
@@ -367,7 +375,7 @@ wl_iw_get_scan_prep(
char *extra,
short max_size
);
-#endif
+#endif
static void
swap_key_from_BE(
@@ -429,7 +437,7 @@ dev_wlc_ioctl(
strcpy(ifr.ifr_name, dev->name);
ifr.ifr_data = (caddr_t) &ioc;
-
+
ret = dev_open(dev);
if (ret) {
WL_ERROR(("%s: Error dev_open: %d\n", __func__, ret));
@@ -443,7 +451,7 @@ dev_wlc_ioctl(
ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
#else
ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
-#endif
+#endif
set_fs(fs);
}
else {
@@ -551,7 +559,7 @@ dev_iw_iovar_getbuf(
return (dev_wlc_ioctl(dev, WLC_GET_VAR, bufptr, buflen));
}
-#endif
+#endif
#if WIRELESS_EXT > 17
@@ -565,7 +573,7 @@ dev_wlc_bufvar_set(
char ioctlbuf[MAX_WLIW_IOCTL_LEN];
#else
static char ioctlbuf[MAX_WLIW_IOCTL_LEN];
-#endif
+#endif
uint buflen;
buflen = bcm_mkiovar(name, buf, len, ioctlbuf, sizeof(ioctlbuf));
@@ -573,7 +581,7 @@ dev_wlc_bufvar_set(
return (dev_wlc_ioctl(dev, WLC_SET_VAR, ioctlbuf, buflen));
}
-#endif
+#endif
static int
@@ -586,7 +594,7 @@ dev_wlc_bufvar_get(
char ioctlbuf[MAX_WLIW_IOCTL_LEN];
#else
static char ioctlbuf[MAX_WLIW_IOCTL_LEN];
-#endif
+#endif
int error;
uint len;
@@ -641,12 +649,12 @@ wl_iw_set_active_scan(
#if defined(WL_IW_USE_ISCAN)
if (g_iscan->iscan_state == ISCAN_STATE_IDLE)
-#endif
+#endif
error = dev_wlc_ioctl(dev, WLC_SET_PASSIVE_SCAN, &as, sizeof(as));
#if defined(WL_IW_USE_ISCAN)
else
g_iscan->scan_flag = as;
-#endif
+#endif
p += snprintf(p, MAX_WX_STRING, "OK");
wrqu->data.length = p - extra + 1;
@@ -667,9 +675,9 @@ wl_iw_set_passive_scan(
#if defined(WL_IW_USE_ISCAN)
if (g_iscan->iscan_state == ISCAN_STATE_IDLE) {
-#endif
+#endif
+
-
if (g_scan_specified_ssid == 0) {
error = dev_wlc_ioctl(dev, WLC_SET_PASSIVE_SCAN, &ps, sizeof(ps));
}
@@ -677,7 +685,7 @@ wl_iw_set_passive_scan(
}
else
g_iscan->scan_flag = ps;
-#endif
+#endif
p += snprintf(p, MAX_WX_STRING, "OK");
@@ -729,7 +737,7 @@ wl_iw_get_macaddr(
struct ether_addr *id;
char *p = extra;
-
+
strcpy(buf, "cur_etheraddr");
error = dev_wlc_ioctl(dev, WLC_GET_VAR, buf, sizeof(buf));
id = (struct ether_addr *) buf;
@@ -764,16 +772,16 @@ wl_iw_set_country(
memset(country_code, 0, sizeof(country_code));
memset(smbuf, 0, sizeof(smbuf));
-
+
country_offset = strcspn(extra, " ");
country_code_size = strlen(extra) - country_offset;
-
+
if (country_offset != 0) {
strncpy(country_code, extra + country_offset +1,
MIN(country_code_size, sizeof(country_code)));
-
+
bzero(&scbval, sizeof(scb_val_t));
if ((error = dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t)))) {
WL_ERROR(("%s: set country failed due to Disassoc error\n", __FUNCTION__));
@@ -785,7 +793,7 @@ wl_iw_set_country(
get_customized_country_code((char *)&cspec.country_abbrev, &cspec);
-
+
if ((error = dev_iw_iovar_setbuf(dev, "country", &cspec,
sizeof(cspec), smbuf, sizeof(smbuf))) >= 0) {
p += snprintf(p, MAX_WX_STRING, "OK");
@@ -832,7 +840,7 @@ wl_iw_set_power_mode(
dev_wlc_ioctl(dev, WLC_GET_PM, &pm, sizeof(pm));
dev_wlc_ioctl(dev, WLC_SET_PM, &pm_local, sizeof(pm_local));
-
+
net_os_set_packet_filter(dev, 0);
#ifdef COEX_DHCP
@@ -841,13 +849,13 @@ wl_iw_set_power_mode(
WL_TRACE_COEX(("%s: DHCP start, pm:%d changed to pm:%d\n",
__FUNCTION__, pm, pm_local));
-#endif
+#endif
} else if (strnicmp((char *)&powermode_val, "0", strlen("0")) == 0) {
-
+
dev_wlc_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm));
-
+
net_os_set_packet_filter(dev, 1);
#ifdef COEX_DHCP
@@ -855,7 +863,7 @@ wl_iw_set_power_mode(
g_bt->ts_dhcp_ok = JF2MS;
WL_TRACE_COEX(("%s: DHCP done for:%d ms, restored pm:%d\n",
__FUNCTION__, (g_bt->ts_dhcp_ok - g_bt->ts_dhcp_start), pm));
-#endif
+#endif
} else {
WL_ERROR(("%s Unkwown yet power setting, ignored\n",
@@ -890,7 +898,7 @@ bool btcoex_is_sco_active(struct net_device *dev)
break;
}
- if ((param27 & 0x6) == 2) {
+ if ((param27 & 0x6) == 2) {
sco_id_cnt++;
}
@@ -926,9 +934,9 @@ static int set_btc_esco_params(struct net_device *dev, bool trump_sco)
static uint32 saved_reg65;
static uint32 saved_reg71;
- if (trump_sco) {
+ if (trump_sco) {
+
-
WL_TRACE_COEX(("Do new SCO/eSCO coex algo {save & override} \n"));
@@ -968,7 +976,7 @@ static int set_btc_esco_params(struct net_device *dev, bool trump_sco)
saved_status = TRUE;
} else if (saved_status) {
-
+
WL_TRACE_COEX(("Do new SCO/eSCO coex algo {save & override} \n"));
regaddr = 50;
@@ -999,7 +1007,7 @@ static int set_btc_esco_params(struct net_device *dev, bool trump_sco)
}
return 0;
}
-#endif
+#endif
static int
@@ -1018,9 +1026,9 @@ wl_iw_get_power_mode(
if (!error) {
WL_TRACE(("%s: Powermode = %d\n", __func__, pm_local));
if (pm_local == PM_OFF)
- pm_local = 1;
+ pm_local = 1;
else
- pm_local = 0;
+ pm_local = 0;
p += snprintf(p, MAX_WX_STRING, "powermode = %d", pm_local);
}
else {
@@ -1054,16 +1062,16 @@ wl_iw_set_btcoex_dhcp(
#ifdef COEX_DHCP
char buf_flag7_default[8] = { 7, 00, 00, 00, 0x0, 0x00, 0x00, 0x00};
-#endif
+#endif
+
-
strncpy((char *)&powermode_val, extra + strlen("BTCOEXMODE") +1, 1);
if (strnicmp((char *)&powermode_val, "1", strlen("1")) == 0) {
WL_TRACE(("%s: DHCP session starts\n", __FUNCTION__));
-
+
if ((saved_status == FALSE) &&
(!dev_wlc_intvar_get_reg(dev, "btc_params", 66, &saved_reg66)) &&
(!dev_wlc_intvar_get_reg(dev, "btc_params", 41, &saved_reg41)) &&
@@ -1072,21 +1080,21 @@ wl_iw_set_btcoex_dhcp(
WL_TRACE(("Saved 0x%x 0x%x 0x%x\n",
saved_reg66, saved_reg41, saved_reg68));
-
-
+
+
#ifdef COEX_DHCP
-
+
if (btcoex_is_sco_active(dev)) {
-
+
dev_wlc_bufvar_set(dev, "btc_params",
(char *)&buf_reg66va_dhcp_on[0],
sizeof(buf_reg66va_dhcp_on));
-
+
dev_wlc_bufvar_set(dev, "btc_params",
(char *)&buf_reg41va_dhcp_on[0],
sizeof(buf_reg41va_dhcp_on));
-
+
dev_wlc_bufvar_set(dev, "btc_params",
(char *)&buf_reg68va_dhcp_on[0],
sizeof(buf_reg68va_dhcp_on));
@@ -1098,7 +1106,7 @@ wl_iw_set_btcoex_dhcp(
WL_TRACE_COEX(("%s enable BT DHCP Timer\n",
__FUNCTION__));
}
-#endif
+#endif
}
else if (saved_status == TRUE) {
WL_ERROR(("%s was called w/o DHCP OFF. Continue\n", __FUNCTION__));
@@ -1107,31 +1115,31 @@ wl_iw_set_btcoex_dhcp(
else if (strnicmp((char *)&powermode_val, "2", strlen("2")) == 0) {
-
+
#ifdef COEX_DHCP
-
+
WL_TRACE(("%s disable BT DHCP Timer\n", __FUNCTION__));
if (g_bt->timer_on) {
g_bt->timer_on = 0;
del_timer_sync(&g_bt->timer);
if (g_bt->bt_state != BT_DHCP_IDLE) {
-
+
WL_TRACE_COEX(("%s bt->bt_state:%d\n",
__FUNCTION__, g_bt->bt_state));
-
+
up(&g_bt->tsk_ctl.sema);
}
}
-
+
if (saved_status == TRUE)
dev_wlc_bufvar_set(dev, "btc_flags",
(char *)&buf_flag7_default[0], sizeof(buf_flag7_default));
-#endif
+#endif
+
-
if (saved_status == TRUE) {
regaddr = 66;
dev_wlc_intvar_set_reg(dev, "btc_params",
@@ -1162,7 +1170,7 @@ wl_iw_set_btcoex_dhcp(
}
static int
-wl_iw_set_suspend_opt(
+wl_iw_set_suspend(
struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu,
@@ -1173,15 +1181,16 @@ char *extra
int ret_now;
int ret = 0;
- suspend_flag = *(extra + strlen(SETSUSPENDOPT_CMD) + 1) - '0';
+ suspend_flag = *(extra + strlen(SETSUSPEND_CMD) + 1) - '0';
if (suspend_flag != 0)
suspend_flag = 1;
ret_now = net_os_set_suspend_disable(dev, suspend_flag);
+
if (ret_now != suspend_flag) {
- if (!(ret = net_os_set_suspend(dev, ret_now, 1)))
+ if (!(ret = net_os_set_suspend(dev, ret_now)))
WL_ERROR(("%s: Suspend Flag %d -> %d\n",
__FUNCTION__, ret_now, suspend_flag));
else
@@ -1192,32 +1201,6 @@ char *extra
}
static int
-wl_iw_set_suspend_mode(
-struct net_device *dev,
-struct iw_request_info *info,
-union iwreq_data *wrqu,
-char *extra
-)
-{
- int ret = 0;
-
-#if !defined(CONFIG_HAS_EARLYSUSPEND) || !defined(DHD_USE_EARLYSUSPEND)
- int suspend_flag;
-
- suspend_flag = *(extra + strlen(SETSUSPENDMODE_CMD) + 1) - '0';
-
- if (suspend_flag != 0)
- suspend_flag = 1;
-
- if (!(ret = net_os_set_suspend(dev, suspend_flag, 0)))
- WL_ERROR(("%s: Suspend Mode %d\n",__FUNCTION__,suspend_flag));
- else
- WL_ERROR(("%s: failed %d\n", __FUNCTION__, ret));
-#endif
- return ret;
-}
-
-static int
wl_format_ssid(char* ssid_buf, uint8* ssid, int ssid_len)
{
int i, c;
@@ -1253,7 +1236,7 @@ wl_iw_get_link_speed(
char *p = extra;
static int link_speed;
-
+
net_os_wake_lock(dev);
if (g_onoff == G_WLAN_SET_ON) {
error = dev_wlc_ioctl(dev, WLC_GET_RATE, &link_speed, sizeof(link_speed));
@@ -1331,7 +1314,7 @@ wl_iw_set_dtim_skip(
&iovbuf, sizeof(iovbuf))) >= 0) {
p += snprintf(p, MAX_WX_STRING, "OK");
-
+
net_os_set_dtim_skip(dev, bcn_li_dtim);
WL_TRACE(("%s: set dtim_skip %d OK\n", __FUNCTION__,
@@ -1400,7 +1383,7 @@ wl_iw_set_band(
band = htod32((uint)*(extra + strlen(BAND_SET_CMD) + 1) - '0');
if ((band == WLC_BAND_AUTO) || (band == WLC_BAND_5G) || (band == WLC_BAND_2G)) {
-
+
if ((error = dev_wlc_ioctl(dev, WLC_SET_BAND,
&band, sizeof(band))) >= 0) {
p += snprintf(p, MAX_WX_STRING, "OK");
@@ -1528,7 +1511,7 @@ wl_iw_set_pno_set(
'2',
0x00
};
-#endif
+#endif
net_os_wake_lock(dev);
WL_ERROR(("\n### %s: info->cmd:%x, info->flags:%x, u.data=0x%p, u.len=%d\n",
@@ -1556,7 +1539,7 @@ wl_iw_set_pno_set(
for (i = 0; i < wrqu->data.length; i++)
printf("%02X ", extra[i]);
printf("\n");
-#endif
+#endif
str_ptr = extra;
#ifdef PNO_SET_DEBUG
@@ -1570,7 +1553,7 @@ wl_iw_set_pno_set(
cmd_tlv_temp = (cmd_tlv_t *)str_ptr;
memset(ssids_local, 0, sizeof(ssids_local));
pno_repeat = pno_freq_expo_max = 0;
-
+
if ((cmd_tlv_temp->prefix == PNO_TLV_PREFIX) &&
(cmd_tlv_temp->version == PNO_TLV_VERSION) &&
(cmd_tlv_temp->subver == PNO_TLV_SUBVERSION))
@@ -1578,7 +1561,7 @@ wl_iw_set_pno_set(
str_ptr += sizeof(cmd_tlv_t);
tlv_size_left -= sizeof(cmd_tlv_t);
-
+
if ((nssid = wl_iw_parse_ssid_list_tlv(&str_ptr, ssids_local,
MAX_PFN_LIST_COUNT,
&tlv_size_left)) <= 0) {
@@ -1595,7 +1578,7 @@ wl_iw_set_pno_set(
pno_time = simple_strtoul(str_ptr, &str_ptr, 16);
WL_PNO(("%s: pno_time=%d\n", __FUNCTION__, pno_time));
-
+
if (str_ptr[0] != 0) {
if ((str_ptr[0] != PNO_TLV_FREQ_REPEAT)) {
WL_ERROR(("%s pno repeat : corrupted field\n",
@@ -1622,7 +1605,7 @@ wl_iw_set_pno_set(
goto exit_proc;
}
-
+
res = dhd_dev_pno_set(dev, ssids_local, nssid, pno_time, pno_repeat, pno_freq_expo_max);
exit_proc:
@@ -1659,13 +1642,13 @@ wl_iw_set_pno_setadd(
goto exit_proc;
}
-
+
bcopy(PNOSETUP_SET_CMD, extra, strlen(PNOSETUP_SET_CMD));
tmp_ptr = extra + strlen(PNOSETUP_SET_CMD);
size = wrqu->data.length - strlen(PNOSETUP_SET_CMD);
tmp_size = size;
-
+
while (*tmp_ptr && tmp_size > 0) {
if ((*tmp_ptr == 'S') && (size - tmp_size) >= sizeof(cmd_tlv_t)) {
*(tmp_ptr + 1) = ((*(tmp_ptr + 1) - '0') << 4) + (*(tmp_ptr + 2) - '0');
@@ -1688,7 +1671,7 @@ exit_proc:
}
-#endif
+#endif
static int
wl_iw_get_rssi(
@@ -1750,7 +1733,7 @@ wl_iw_send_priv_event(
strcpy(extra, flag);
wrqu.data.length = strlen(extra);
wireless_send_event(dev, cmd, &wrqu, extra);
- net_os_wake_lock_ctrl_timeout_enable(dev, DHD_EVENT_TIMEOUT_MS);
+ net_os_wake_lock_timeout_enable(dev, DHD_EVENT_TIMEOUT_MS);
WL_TRACE(("Send IWEVCUSTOM Event as %s\n", extra));
return 0;
@@ -1791,8 +1774,8 @@ wl_control_wl_start(struct net_device *dev)
#if defined(BCMLXSDMMC)
sdioh_start(NULL, 1);
#endif
- if (!ret)
- dhd_dev_init_ioctl(dev);
+
+ dhd_dev_init_ioctl(dev);
g_onoff = G_WLAN_SET_ON;
}
@@ -1830,39 +1813,39 @@ wl_iw_control_wl_off(
#ifdef SOFTAP
ap_cfg_running = FALSE;
-#endif
+#endif
if (g_onoff == G_WLAN_SET_ON) {
g_onoff = G_WLAN_SET_OFF;
#if defined(WL_IW_USE_ISCAN)
g_iscan->iscan_state = ISCAN_STATE_IDLE;
-#endif
+#endif
- ret = dhd_dev_reset(dev, 1);
+ dhd_dev_reset(dev, 1);
#if defined(WL_IW_USE_ISCAN)
#if !defined(CSCAN)
-
+
wl_iw_free_ss_cache();
wl_iw_run_ss_cache_timer(0);
-
+
g_ss_cache_ctrl.m_link_down = 1;
-#endif
+#endif
memset(g_scan, 0, G_SCAN_RESULTS);
g_scan_specified_ssid = 0;
#if defined(CONFIG_FIRST_SCAN)
-
+
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_IDLE;
g_first_counter_scans = 0;
-#endif
-#endif
+#endif
+#endif
#if defined(BCMLXSDMMC)
sdioh_stop(NULL);
#endif
-
+
net_os_set_dtim_skip(dev, 0);
dhd_customer_gpio_wlan_ctrl(WLAN_RESET_OFF);
@@ -1906,14 +1889,14 @@ wl_iw_control_wl_on(
#ifdef SOFTAP
static struct ap_profile my_ap;
-static int set_ap_cfg(struct net_device *dev, struct ap_profile *ap);
+static int set_ap_cfg(struct net_device *dev, struct ap_profile *ap);
static int get_assoc_sta_list(struct net_device *dev, char *buf, int len);
static int set_ap_mac_list(struct net_device *dev, void *buf);
#define PTYPE_STRING 0
-#define PTYPE_INTDEC 1
+#define PTYPE_INTDEC 1
#define PTYPE_INTHEX 2
-#define PTYPE_STR_HEX 3
+#define PTYPE_STR_HEX 3
static int get_parameter_from_string(
char **str_ptr, const char *token, int param_type, void *dst, int param_max_len);
@@ -1964,7 +1947,7 @@ init_ap_profile_from_string(char *param_str, struct ap_profile *ap_cfg)
memset(sub_cmd, 0, sizeof(sub_cmd));
memset(ap_cfg, 0, sizeof(struct ap_profile));
-
+
if (get_parameter_from_string(&str_ptr, "ASCII_CMD=",
PTYPE_STRING, sub_cmd, SSID_LEN) != 0) {
return -1;
@@ -1974,8 +1957,8 @@ init_ap_profile_from_string(char *param_str, struct ap_profile *ap_cfg)
return -1;
}
-
-
+
+
ret = get_parameter_from_string(&str_ptr, "SSID=", PTYPE_STRING, ap_cfg->ssid, SSID_LEN);
ret |= get_parameter_from_string(&str_ptr, "SEC=", PTYPE_STRING, ap_cfg->sec, SEC_LEN);
@@ -1984,23 +1967,23 @@ init_ap_profile_from_string(char *param_str, struct ap_profile *ap_cfg)
ret |= get_parameter_from_string(&str_ptr, "CHANNEL=", PTYPE_INTDEC, &ap_cfg->channel, 5);
-
+
get_parameter_from_string(&str_ptr, "PREAMBLE=", PTYPE_INTDEC, &ap_cfg->preamble, 5);
-
+
get_parameter_from_string(&str_ptr, "MAX_SCB=", PTYPE_INTDEC, &ap_cfg->max_scb, 5);
-
+
get_parameter_from_string(&str_ptr, "HIDDEN=",
PTYPE_INTDEC, &ap_cfg->closednet, 5);
-
+
get_parameter_from_string(&str_ptr, "COUNTRY=",
PTYPE_STRING, &ap_cfg->country_code, 3);
return ret;
}
-#endif
+#endif
@@ -2042,7 +2025,7 @@ iwpriv_set_ap_config(struct net_device *dev,
memset(ap_cfg, 0, sizeof(struct ap_profile));
-
+
str_ptr = extra;
@@ -2053,7 +2036,7 @@ iwpriv_set_ap_config(struct net_device *dev,
}
} else {
-
+
WL_ERROR(("IWPRIV argument len = 0 \n"));
return -1;
}
@@ -2065,7 +2048,7 @@ iwpriv_set_ap_config(struct net_device *dev,
return res;
}
-#endif
+#endif
@@ -2085,7 +2068,7 @@ static int iwpriv_get_assoc_list(struct net_device *dev,
wl_iw_t *iw;
if ((!dev) || (!extra)) {
-
+
return -EINVAL;
}
@@ -2117,19 +2100,19 @@ static int iwpriv_get_assoc_list(struct net_device *dev,
sta_maclist->count));
-
+
memset(mac_lst, 0, sizeof(mac_lst));
p_mac_str = mac_lst;
p_mac_str_end = &mac_lst[sizeof(mac_lst)-1];
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < 8; i++) {
struct ether_addr * id = &sta_maclist->ea[i];
if (!ETHER_ISNULLADDR(id->octet)) {
scb_val_t scb_val;
int rssi = 0;
bzero(&scb_val, sizeof(scb_val_t));
-
+
if ((p_mac_str_end - p_mac_str) <= 36) {
WL_ERROR(("%s: mac list buf is < 36 for item[%i] item\n",
__FUNCTION__, i));
@@ -2141,7 +2124,7 @@ static int iwpriv_get_assoc_list(struct net_device *dev,
id->octet[0], id->octet[1], id->octet[2],
id->octet[3], id->octet[4], id->octet[5]);
-
+
bcopy(id->octet, &scb_val.ea, 6);
ret = dev_wlc_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t));
if (ret < 0) {
@@ -2157,7 +2140,7 @@ static int iwpriv_get_assoc_list(struct net_device *dev,
}
}
- p_iwrq->data.length = strlen(mac_lst)+1;
+ p_iwrq->data.length = strlen(mac_lst)+1;
WL_SOFTAP(("%s: data to user:\n%s\n usr_ptr:%p\n", __FUNCTION__,
mac_lst, p_iwrq->data.pointer));
@@ -2174,7 +2157,7 @@ func_exit:
WL_SOFTAP(("%s: Exited\n", __FUNCTION__));
return ret;
}
-#endif
+#endif
#ifdef SOFTAP
@@ -2187,10 +2170,10 @@ static int iwpriv_set_mac_filters(struct net_device *dev,
{
int i, ret = -1;
char * extra = NULL;
- int mac_cnt = 0;
+ int mac_cnt = 0;
int mac_mode = 0;
struct ether_addr *p_ea;
- struct mac_list_set mflist_set;
+ struct mac_list_set mflist_set;
WL_SOFTAP((">>> Got IWPRIV SET_MAC_FILTER IOCTL: info->cmd:%x,"
"info->flags:%x, u.data:%p, u.len:%d\n",
@@ -2214,11 +2197,11 @@ static int iwpriv_set_mac_filters(struct net_device *dev,
memset(&mflist_set, 0, sizeof(mflist_set));
-
+
str_ptr = extra;
-
+
if (get_parameter_from_string(&str_ptr, "MAC_MODE=",
PTYPE_INTDEC, &mac_mode, 4) != 0) {
WL_ERROR(("ERROR: 'MAC_MODE=' token is missing\n"));
@@ -2238,7 +2221,7 @@ static int iwpriv_set_mac_filters(struct net_device *dev,
goto exit_proc;
}
- for (i=0; i< mac_cnt; i++)
+ for (i=0; i< mac_cnt; i++)
if (get_parameter_from_string(&str_ptr, "MAC=",
PTYPE_STR_HEX, &p_ea[i], 12) != 0) {
WL_ERROR(("ERROR: MAC_filter[%d] is missing !\n", i));
@@ -2251,18 +2234,18 @@ static int iwpriv_set_mac_filters(struct net_device *dev,
dhd_print_buf(&p_ea[i], 6, 0);
}
-
+
mflist_set.mode = mac_mode;
mflist_set.mac_list.count = mac_cnt;
set_ap_mac_list(dev, &mflist_set);
-
+
wrqu->data.pointer = NULL;
wrqu->data.length = 0;
ret = 0;
} else {
-
+
WL_ERROR(("IWPRIV argument len is 0\n"));
return -1;
}
@@ -2271,7 +2254,7 @@ static int iwpriv_set_mac_filters(struct net_device *dev,
kfree(extra);
return ret;
}
-#endif
+#endif
#ifdef SOFTAP
@@ -2307,22 +2290,22 @@ static int iwpriv_set_ap_sta_disassoc(struct net_device *dev,
return res;
}
-#endif
+#endif
-#endif
+#endif
#if WIRELESS_EXT < 13
struct iw_request_info
{
- __u16 cmd;
- __u16 flags;
+ __u16 cmd;
+ __u16 flags;
};
typedef int (*iw_handler)(struct net_device *dev,
struct iw_request_info *info,
void *wrqu,
char *extra);
-#endif
+#endif
static int
wl_iw_config_commit(
@@ -2390,13 +2373,13 @@ wl_iw_set_freq(
}
#endif
-
+
if (fwrq->e == 0 && fwrq->m < MAXCHANNEL) {
chan = fwrq->m;
}
-
+
else {
-
+
if (fwrq->e >= 6) {
fwrq->e -= 6;
while (fwrq->e--)
@@ -2405,9 +2388,9 @@ wl_iw_set_freq(
while (fwrq->e++ < 6)
fwrq->m /= 10;
}
-
+
if (fwrq->m > 4000 && fwrq->m < 5000)
- sf = WF_CHAN_FACTOR_4_G;
+ sf = WF_CHAN_FACTOR_4_G;
chan = wf_mhz2channel(fwrq->m, sf);
}
@@ -2419,7 +2402,7 @@ wl_iw_set_freq(
g_wl_iw_params.target_channel = chan;
-
+
return -EINPROGRESS;
}
@@ -2439,7 +2422,7 @@ wl_iw_get_freq(
if ((error = dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci, sizeof(ci))))
return error;
-
+
fwrq->m = dtoh32(ci.hw_channel);
fwrq->e = dtoh32(0);
return 0;
@@ -2477,7 +2460,7 @@ wl_iw_set_mode(
(error = dev_wlc_ioctl(dev, WLC_SET_AP, &ap, sizeof(ap))))
return error;
-
+
return -EINPROGRESS;
}
@@ -2543,10 +2526,10 @@ wl_iw_get_range(
dwrq->length = sizeof(struct iw_range);
memset(range, 0, sizeof(*range));
-
+
range->min_nwid = range->max_nwid = 0;
-
+
list->count = htod32(MAXCHANNEL);
if ((error = dev_wlc_ioctl(dev, WLC_GET_VALID_CHANNELS, channels, (MAXCHANNEL+1)*4))) {
kfree(channels);
@@ -2566,25 +2549,25 @@ wl_iw_get_range(
}
range->num_frequency = range->num_channels = i;
-
+
range->max_qual.qual = 5;
-
- range->max_qual.level = 0x100 - 200;
-
- range->max_qual.noise = 0x100 - 200;
-
+
+ range->max_qual.level = 0x100 - 200;
+
+ range->max_qual.noise = 0x100 - 200;
+
range->sensitivity = 65535;
#if WIRELESS_EXT > 11
-
+
range->avg_qual.qual = 3;
-
+
range->avg_qual.level = 0x100 + WL_IW_RSSI_GOOD;
-
- range->avg_qual.noise = 0x100 - 75;
-#endif
-
+ range->avg_qual.noise = 0x100 - 75;
+#endif
+
+
if ((error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, &rateset, sizeof(rateset)))) {
kfree(channels);
return error;
@@ -2592,7 +2575,7 @@ wl_iw_get_range(
rateset.count = dtoh32(rateset.count);
range->num_bitrates = rateset.count;
for (i = 0; i < rateset.count && i < IW_MAX_BITRATES; i++)
- range->bitrate[i] = (rateset.rates[i]& 0x7f) * 500000;
+ range->bitrate[i] = (rateset.rates[i]& 0x7f) * 500000;
dev_wlc_intvar_get(dev, "nmode", &nmode);
dev_wlc_ioctl(dev, WLC_GET_PHYTYPE, &phytype, sizeof(phytype));
@@ -2618,23 +2601,23 @@ wl_iw_get_range(
}
range->num_bitrates += 8;
for (k = 0; i < range->num_bitrates; k++, i++) {
-
+
range->bitrate[i] = (nrate_list[nrate_list2copy][k]) * 500000;
}
}
-
+
if ((error = dev_wlc_ioctl(dev, WLC_GET_PHYTYPE, &i, sizeof(i)))) {
kfree(channels);
return error;
}
i = dtoh32(i);
if (i == WLC_PHY_TYPE_A)
- range->throughput = 24000000;
+ range->throughput = 24000000;
else
- range->throughput = 1500000;
+ range->throughput = 1500000;
+
-
range->min_rts = 0;
range->max_rts = 2347;
range->min_frag = 256;
@@ -2651,7 +2634,7 @@ wl_iw_get_range(
#endif
range->encoding_size[3] = AES_KEY_SIZE;
-
+
range->min_pmp = 0;
range->max_pmp = 0;
range->min_pmt = 0;
@@ -2659,7 +2642,7 @@ wl_iw_get_range(
range->pmp_flags = 0;
range->pm_capa = 0;
-
+
range->num_txpower = 2;
range->txpower[0] = 1;
range->txpower[1] = 255;
@@ -2669,17 +2652,17 @@ wl_iw_get_range(
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 19;
-
+
range->retry_capa = IW_RETRY_LIMIT;
range->retry_flags = IW_RETRY_LIMIT;
range->r_time_flags = 0;
-
+
range->min_retry = 1;
range->max_retry = 255;
-
+
range->min_r_time = 0;
range->max_r_time = 0;
-#endif
+#endif
#if WIRELESS_EXT > 17
range->enc_capa = IW_ENC_CAPA_WPA;
@@ -2687,13 +2670,13 @@ wl_iw_get_range(
range->enc_capa |= IW_ENC_CAPA_CIPHER_CCMP;
range->enc_capa |= IW_ENC_CAPA_WPA2;
#if (defined(BCMSUP_PSK) && defined(WLFBT))
-
+
range->enc_capa |= IW_ENC_CAPA_4WAY_HANDSHAKE;
-#endif
+#endif
+
-
IW_EVENT_CAPA_SET_KERNEL(range->event_capa);
-
+
IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP);
IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN);
IW_EVENT_CAPA_SET(range->event_capa, IWEVTXDROP);
@@ -2701,7 +2684,7 @@ wl_iw_get_range(
IW_EVENT_CAPA_SET(range->event_capa, IWEVASSOCREQIE);
IW_EVENT_CAPA_SET(range->event_capa, IWEVASSOCRESPIE);
IW_EVENT_CAPA_SET(range->event_capa, IWEVPMKIDCAND);
-#endif
+#endif
kfree(channels);
@@ -2786,7 +2769,7 @@ wl_iw_ch_to_chanspec(int ch, wl_join_params_t *join_params, int *join_params_siz
chanspec_t chanspec = 0;
if (ch != 0) {
-
+
join_params->params.chanspec_num = 1;
join_params->params.chanspec_list[0] = ch;
@@ -2798,11 +2781,11 @@ wl_iw_ch_to_chanspec(int ch, wl_join_params_t *join_params, int *join_params_siz
chanspec |= WL_CHANSPEC_BW_20;
chanspec |= WL_CHANSPEC_CTL_SB_NONE;
-
+
*join_params_size += WL_ASSOC_PARAMS_FIXED_SIZE +
join_params->params.chanspec_num * sizeof(chanspec_t);
-
+
join_params->params.chanspec_list[0] &= WL_CHANSPEC_CHAN_MASK;
join_params->params.chanspec_list[0] |= chanspec;
join_params->params.chanspec_list[0] =
@@ -2835,18 +2818,18 @@ wl_iw_set_wap(
return -EINVAL;
}
-
+
if (ETHER_ISBCAST(awrq->sa_data) || ETHER_ISNULLADDR(awrq->sa_data)) {
scb_val_t scbval;
-
+
bzero(&scbval, sizeof(scb_val_t));
-
+
(void) dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t));
return 0;
}
-
+
memset(&join_params, 0, sizeof(join_params));
join_params_size = sizeof(join_params.ssid);
@@ -2854,8 +2837,8 @@ wl_iw_set_wap(
join_params.ssid.SSID_len = htod32(g_ssid.SSID_len);
memcpy(&join_params.params.bssid, awrq->sa_data, ETHER_ADDR_LEN);
-
-
+
+
WL_TRACE(("%s target_channel=%d\n", __FUNCTION__, g_wl_iw_params.target_channel));
wl_iw_ch_to_chanspec(g_wl_iw_params.target_channel, &join_params, &join_params_size);
@@ -2870,7 +2853,7 @@ wl_iw_set_wap(
g_wl_iw_params.target_channel));
}
-
+
memset(&g_ssid, 0, sizeof(g_ssid));
return 0;
}
@@ -2888,7 +2871,7 @@ wl_iw_get_wap(
awrq->sa_family = ARPHRD_ETHER;
memset(awrq->sa_data, 0, ETHER_ADDR_LEN);
-
+
(void) dev_wlc_ioctl(dev, WLC_GET_BSSID, awrq->sa_data, ETHER_ADDR_LEN);
return 0;
@@ -2934,7 +2917,7 @@ wl_iw_mlme(
return error;
}
-#endif
+#endif
#ifndef WL_IW_USE_ISCAN
static int
@@ -2957,7 +2940,7 @@ wl_iw_get_aplist(
if (!extra)
return -EINVAL;
-
+
list = kmalloc(buflen, GFP_KERNEL);
if (!list)
return -ENOMEM;
@@ -2983,23 +2966,23 @@ wl_iw_get_aplist(
ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
buflen));
-
+
if (!(dtoh16(bi->capability) & DOT11_CAP_ESS))
continue;
-
+
memcpy(addr[dwrq->length].sa_data, &bi->BSSID, ETHER_ADDR_LEN);
addr[dwrq->length].sa_family = ARPHRD_ETHER;
qual[dwrq->length].qual = rssi_to_qual(dtoh16(bi->RSSI));
qual[dwrq->length].level = 0x100 + dtoh16(bi->RSSI);
qual[dwrq->length].noise = 0x100 + bi->phy_noise;
-
+
#if WIRELESS_EXT > 18
qual[dwrq->length].updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
#else
qual[dwrq->length].updated = 7;
-#endif
+#endif
dwrq->length++;
}
@@ -3008,13 +2991,13 @@ wl_iw_get_aplist(
if (dwrq->length) {
memcpy(&addr[dwrq->length], qual, sizeof(struct iw_quality) * dwrq->length);
-
+
dwrq->flags = 1;
}
return 0;
}
-#endif
+#endif
#ifdef WL_IW_USE_ISCAN
static int
@@ -3045,7 +3028,7 @@ wl_iw_iscan_get_aplist(
}
buf = iscan->list_hdr;
-
+
while (buf) {
list = &((wl_iscan_results_t*)buf->iscan_buf)->results;
if (list->version != WL_BSS_INFO_VERSION) {
@@ -3061,23 +3044,23 @@ wl_iw_iscan_get_aplist(
ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
WLC_IW_ISCAN_MAXLEN));
-
+
if (!(dtoh16(bi->capability) & DOT11_CAP_ESS))
continue;
-
+
memcpy(addr[dwrq->length].sa_data, &bi->BSSID, ETHER_ADDR_LEN);
addr[dwrq->length].sa_family = ARPHRD_ETHER;
qual[dwrq->length].qual = rssi_to_qual(dtoh16(bi->RSSI));
qual[dwrq->length].level = 0x100 + dtoh16(bi->RSSI);
qual[dwrq->length].noise = 0x100 + bi->phy_noise;
-
+
#if WIRELESS_EXT > 18
qual[dwrq->length].updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
#else
qual[dwrq->length].updated = 7;
-#endif
+#endif
dwrq->length++;
}
@@ -3085,7 +3068,7 @@ wl_iw_iscan_get_aplist(
}
if (dwrq->length) {
memcpy(&addr[dwrq->length], qual, sizeof(struct iw_quality) * dwrq->length);
-
+
dwrq->flags = 1;
}
@@ -3107,10 +3090,10 @@ wl_iw_iscan_prep(wl_scan_params_t *params, wlc_ssid_t *ssid)
params->channel_num = 0;
#if defined(CONFIG_FIRST_SCAN)
-
+
if (g_first_broadcast_scan == BROADCAST_SCAN_FIRST_STARTED)
params->passive_time = 30;
-#endif
+#endif
params->nprobes = htod32(params->nprobes);
params->active_time = htod32(params->active_time);
params->passive_time = htod32(params->passive_time);
@@ -3163,7 +3146,7 @@ static void
wl_iw_set_event_mask(struct net_device *dev)
{
char eventmask[WL_EVENTING_MASK_LEN];
- char iovbuf[WL_EVENTING_MASK_LEN + 12];
+ char iovbuf[WL_EVENTING_MASK_LEN + 12];
dev_iw_iovar_getbuf(dev, "event_msgs", "", 0, iovbuf, sizeof(iovbuf));
bcopy(iovbuf, eventmask, WL_EVENTING_MASK_LEN);
@@ -3232,7 +3215,7 @@ wl_iw_iscan_get(iscan_info_t *iscan)
status = dtoh32(list_buf->status);
} else {
WL_ERROR(("%s returns error %d\n", __FUNCTION__, res));
-
+
status = WL_SCAN_RESULTS_NO_MEM;
}
DHD_OS_MUTEX_UNLOCK(&wl_cache_lock);
@@ -3261,12 +3244,12 @@ wl_iw_send_scan_complete(iscan_info_t *iscan)
memset(&wrqu, 0, sizeof(wrqu));
-
+
wireless_send_event(iscan->dev, SIOCGIWSCAN, &wrqu, NULL);
#if defined(CONFIG_FIRST_SCAN)
if (g_first_broadcast_scan == BROADCAST_SCAN_FIRST_STARTED)
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_RESULT_READY;
-#endif
+#endif
WL_TRACE(("Send Event ISCAN complete\n"));
}
@@ -3285,7 +3268,7 @@ _iscan_sysioc_thread(void *data)
status = WL_SCAN_RESULTS_PARTIAL;
-
+
complete(&tsk_ctl->completed);
while (down_interruptible(&tsk_ctl->sema) == 0) {
@@ -3295,16 +3278,16 @@ _iscan_sysioc_thread(void *data)
break;
}
#if defined(SOFTAP)
-
+
if (ap_cfg_running) {
WL_TRACE(("%s skipping SCAN ops in AP mode !!!\n", __FUNCTION__));
net_os_wake_unlock(iscan->dev);
continue;
}
-#endif
+#endif
if (iscan->timer_on) {
-
+
iscan->timer_on = 0;
del_timer_sync(&iscan->timer);
}
@@ -3330,12 +3313,12 @@ _iscan_sysioc_thread(void *data)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
rtnl_lock();
#endif
-
+
wl_iw_iscan(iscan, NULL, WL_SCAN_ACTION_CONTINUE);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
rtnl_unlock();
#endif
-
+
mod_timer(&iscan->timer, jiffies + iscan->timer_ms*HZ/1000);
iscan->timer_on = 1;
break;
@@ -3346,7 +3329,7 @@ _iscan_sysioc_thread(void *data)
break;
case WL_SCAN_RESULTS_PENDING:
WL_TRACE(("iscanresults pending\n"));
-
+
mod_timer(&iscan->timer, jiffies + iscan->timer_ms*HZ/1000);
iscan->timer_on = 1;
break;
@@ -3378,7 +3361,7 @@ _iscan_sysioc_thread(void *data)
}
complete_and_exit(&tsk_ctl->completed, 0);
}
-#endif
+#endif
#if !defined(CSCAN)
@@ -3449,7 +3432,7 @@ wl_iw_run_ss_cache_timer(int kick_off)
#ifdef CONFIG_PRESCANNED
(*timer)->expires = jiffies + 70000 * HZ / 1000;
#else
- (*timer)->expires = jiffies + 30000 * HZ / 1000;
+ (*timer)->expires = jiffies + 30000 * HZ / 1000;
#endif
add_timer(*timer);
WL_TRACE(("%s : timer starts \n", __FUNCTION__));
@@ -3522,7 +3505,7 @@ wl_iw_add_bss_to_ss_cache(wl_scan_results_t *ss_list)
wl_bss_info_t *bi = NULL;
int i;
-
+
if (!ss_list->count) {
return 0;
}
@@ -3540,7 +3523,7 @@ wl_iw_add_bss_to_ss_cache(wl_scan_results_t *ss_list)
WL_TRACE(("%s : find %d with specific SSID %s\n", __FUNCTION__, i, bi->SSID));
for (;node;) {
if (!memcmp(&node->bss_info->BSSID, &bi->BSSID, ETHER_ADDR_LEN)) {
-
+
WL_TRACE(("dirty marked : SSID %s\n", bi->SSID));
node->dirty = 1;
break;
@@ -3640,7 +3623,7 @@ wl_iw_delete_bss_from_ss_cache(void *addr)
return 0;
}
-#endif
+#endif
static int
wl_iw_set_scan(
@@ -3660,45 +3643,45 @@ wl_iw_set_scan(
#if defined(CSCAN)
WL_ERROR(("%s: Scan from SIOCGIWSCAN not supported\n", __FUNCTION__));
return -EINVAL;
-#endif
+#endif
#if defined(SOFTAP)
-
+
if (ap_cfg_running) {
WL_TRACE(("\n>%s: Not executed, reason -'SOFTAP is active'\n", __FUNCTION__));
return 0;
}
-#endif
+#endif
+
-
if (g_onoff == G_WLAN_SET_OFF)
return 0;
-
+
memset(&g_specific_ssid, 0, sizeof(g_specific_ssid));
#ifndef WL_IW_USE_ISCAN
-
+
g_scan_specified_ssid = 0;
-#endif
+#endif
#if WIRELESS_EXT > 17
-
+
if (wrqu->data.length == sizeof(struct iw_scan_req)) {
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
struct iw_scan_req *req = (struct iw_scan_req *)extra;
#if defined(CONFIG_FIRST_SCAN)
if (g_first_broadcast_scan != BROADCAST_SCAN_FIRST_RESULT_CONSUMED) {
-
+
WL_TRACE(("%s Ignoring SC %s first BC is not done = %d\n",
__FUNCTION__, req->essid,
g_first_broadcast_scan));
return -EBUSY;
}
-#endif
+#endif
if (g_scan_specified_ssid) {
WL_TRACE(("%s Specific SCAN is not done ignore scan for = %s \n",
__FUNCTION__, req->essid));
-
+
return -EBUSY;
}
else {
@@ -3712,11 +3695,11 @@ wl_iw_set_scan(
}
}
}
-#endif
-
+#endif
+
if ((error = dev_wlc_ioctl(dev, WLC_SCAN, &g_specific_ssid, sizeof(g_specific_ssid)))) {
WL_TRACE(("#### Set SCAN for %s failed with %d\n", g_specific_ssid.SSID, error));
-
+
g_scan_specified_ssid = 0;
return -EBUSY;
}
@@ -3732,7 +3715,7 @@ wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag)
iscan_info_t *iscan = g_iscan;
#if defined(CONFIG_FIRST_SCAN)
-
+
if (g_first_broadcast_scan == BROADCAST_SCAN_FIRST_IDLE) {
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_STARTED;
WL_TRACE(("%s: First Brodcast scan was forced\n", __FUNCTION__));
@@ -3741,7 +3724,7 @@ wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag)
WL_TRACE(("%s: ignore ISCAN request first BS is not done yet\n", __FUNCTION__));
return 0;
}
-#endif
+#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
if (flag)
@@ -3752,7 +3735,7 @@ wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag)
wl_iw_set_event_mask(dev);
WL_TRACE(("+++: Set Broadcast ISCAN\n"));
-
+
memset(&ssid, 0, sizeof(ssid));
iscan->list_cur = iscan->list_hdr;
@@ -3791,31 +3774,31 @@ wl_iw_iscan_set_scan(
#if defined(CSCAN)
WL_ERROR(("%s: Scan from SIOCGIWSCAN not supported\n", __FUNCTION__));
return -EINVAL;
-#endif
+#endif
net_os_wake_lock(dev);
-
+
#if defined(SOFTAP)
if (ap_cfg_running) {
WL_TRACE(("\n>%s: Not executed, reason -'SOFTAP is active'\n", __FUNCTION__));
goto set_scan_end;
}
#endif
-
+
if (g_onoff == G_WLAN_SET_OFF) {
WL_TRACE(("%s: driver is not up yet after START\n", __FUNCTION__));
goto set_scan_end;
}
#ifdef PNO_SUPPORT
-
+
if (dhd_dev_get_pno_status(dev)) {
WL_ERROR(("%s: Scan called when PNO is active\n", __FUNCTION__));
}
-#endif
+#endif
+
-
if ((!iscan) || (iscan->tsk_ctl.thr_pid < 0)) {
WL_ERROR(("%s error \n", __FUNCTION__));
goto set_scan_end;
@@ -3828,16 +3811,16 @@ wl_iw_iscan_set_scan(
goto set_scan_end;
}
-
+
memset(&ssid, 0, sizeof(ssid));
#if WIRELESS_EXT > 17
-
+
if (wrqu->data.length == sizeof(struct iw_scan_req)) {
if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
int as = 0;
struct iw_scan_req *req = (struct iw_scan_req *)extra;
-
+
ssid.SSID_len = MIN(sizeof(ssid.SSID), req->essid_len);
memcpy(ssid.SSID, req->essid, ssid.SSID_len);
ssid.SSID_len = htod32(ssid.SSID_len);
@@ -3855,7 +3838,7 @@ wl_iw_iscan_set_scan(
}
}
}
-#endif
+#endif
#if defined(CONFIG_FIRST_SCAN) && !defined(CSCAN)
if (g_first_broadcast_scan < BROADCAST_SCAN_FIRST_RESULT_CONSUMED) {
@@ -3880,7 +3863,7 @@ set_scan_end:
net_os_wake_unlock(dev);
return ret;
}
-#endif
+#endif
#if WIRELESS_EXT > 17
static bool
@@ -3890,17 +3873,17 @@ ie_is_wpa_ie(uint8 **wpaie, uint8 **tlvs, int *tlvs_len)
uint8 *ie = *wpaie;
-
+
if ((ie[1] >= 6) &&
!bcmp((const void *)&ie[2], (const void *)(WPA_OUI "\x01"), 4)) {
return TRUE;
}
-
+
ie += ie[1] + 2;
-
+
*tlvs_len -= (int)(ie - *tlvs);
-
+
*tlvs = ie;
return FALSE;
}
@@ -3912,21 +3895,21 @@ ie_is_wps_ie(uint8 **wpsie, uint8 **tlvs, int *tlvs_len)
uint8 *ie = *wpsie;
-
+
if ((ie[1] >= 4) &&
!bcmp((const void *)&ie[2], (const void *)(WPA_OUI "\x04"), 4)) {
return TRUE;
}
-
+
ie += ie[1] + 2;
-
+
*tlvs_len -= (int)(ie - *tlvs);
-
+
*tlvs = ie;
return FALSE;
}
-#endif
+#endif
#ifdef BCMWAPI_WPI
static inline int
@@ -3981,7 +3964,7 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
event = *event_p;
if (bi->ie_length) {
-
+
bcm_tlv_t *ie;
uint8 *ptr = ((uint8 *)bi) + sizeof(wl_bss_info_t);
int ptr_len = bi->ie_length;
@@ -4000,10 +3983,10 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, (char *)ie);
}
ptr = ((uint8 *)bi) + sizeof(wl_bss_info_t);
-#endif
+#endif
while ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_WPA_ID))) {
-
+
if (ie_is_wps_ie(((uint8 **)&ie), &ptr, &ptr_len)) {
iwe.cmd = IWEVGENIE;
iwe.u.data.length = ie->len + 2;
@@ -4026,7 +4009,7 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
#ifdef BCMWAPI_WPI
ptr = ((uint8 *)bi) + sizeof(wl_bss_info_t);
ptr_len = bi->ie_length;
-
+
while ((ie = bcm_parse_tlvs(ptr, ptr_len, DOT11_MNG_WAPI_ID))) {
WL_TRACE(("%s: found a WAPI IE...\n", __FUNCTION__));
#ifdef WAPI_IE_USE_GENIE
@@ -4037,18 +4020,18 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
iwe.cmd = IWEVCUSTOM;
custom_event_len = strlen("wapi_ie=") + 2*(ie->len + 2);
iwe.u.data.length = custom_event_len;
-
+
buf = kmalloc(custom_event_len+1, GFP_KERNEL);
if (buf == NULL)
{
WL_ERROR(("malloc(%d) returned NULL...\n", custom_event_len));
break;
}
-
+
memcpy(buf, "wapi_ie=", 8);
wpa_snprintf_hex(buf + 8, 2+1, &(ie->id), 1);
wpa_snprintf_hex(buf + 10, 2+1, &(ie->len), 1);
- wpa_snprintf_hex(buf + 12, 2*ie->len+1, ie->data, ie->len);
+ wpa_snprintf_hex(buf + 12, 2*ie->len+1, ie->data, ie->len);
event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, buf);
kfree(buf);
#endif /* WAPI_IE_USE_GENIE */
@@ -4058,7 +4041,7 @@ wl_iw_handle_scanresults_ies(char **event_p, char *end,
*event_p = event;
}
-#endif
+#endif
return 0;
}
@@ -4082,7 +4065,7 @@ wl_iw_get_scan_prep(
return ret;
}
-
+
for (i = 0; i < list->count && i < IW_MAX_AP; i++) {
if (list->version != WL_BSS_INFO_VERSION) {
@@ -4095,18 +4078,18 @@ wl_iw_get_scan_prep(
WL_TRACE(("%s : %s\n", __FUNCTION__, bi->SSID));
-
+
iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
memcpy(iwe.u.ap_addr.sa_data, &bi->BSSID, ETHER_ADDR_LEN);
event = IWE_STREAM_ADD_EVENT(info, event, end, &iwe, IW_EV_ADDR_LEN);
-
+
iwe.u.data.length = dtoh32(bi->SSID_len);
iwe.cmd = SIOCGIWESSID;
iwe.u.data.flags = 1;
event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, bi->SSID);
-
+
if (dtoh16(bi->capability) & (DOT11_CAP_ESS | DOT11_CAP_IBSS)) {
iwe.cmd = SIOCGIWMODE;
if (dtoh16(bi->capability) & DOT11_CAP_ESS)
@@ -4116,7 +4099,7 @@ wl_iw_get_scan_prep(
event = IWE_STREAM_ADD_EVENT(info, event, end, &iwe, IW_EV_UINT_LEN);
}
-
+
iwe.cmd = SIOCGIWFREQ;
iwe.u.freq.m = wf_channel2mhz(CHSPEC_CHANNEL(bi->chanspec),
CHSPEC_CHANNEL(bi->chanspec) <= CH_MAX_2G_CHANNEL ?
@@ -4124,17 +4107,17 @@ wl_iw_get_scan_prep(
iwe.u.freq.e = 6;
event = IWE_STREAM_ADD_EVENT(info, event, end, &iwe, IW_EV_FREQ_LEN);
-
+
iwe.cmd = IWEVQUAL;
iwe.u.qual.qual = rssi_to_qual(dtoh16(bi->RSSI));
iwe.u.qual.level = 0x100 + dtoh16(bi->RSSI);
iwe.u.qual.noise = 0x100 + bi->phy_noise;
event = IWE_STREAM_ADD_EVENT(info, event, end, &iwe, IW_EV_QUAL_LEN);
-
+
wl_iw_handle_scanresults_ies(&event, end, info, bi);
-
+
iwe.cmd = SIOCGIWENCODE;
if (dtoh16(bi->capability) & DOT11_CAP_PRIVACY)
iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
@@ -4143,12 +4126,12 @@ wl_iw_get_scan_prep(
iwe.u.data.length = 0;
event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, (char *)event);
-
+
if (bi->rateset.count) {
if (((event -extra) + IW_EV_LCP_LEN) <= (uintptr)end) {
value = event + IW_EV_LCP_LEN;
iwe.cmd = SIOCGIWRATE;
-
+
iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
for (j = 0; j < bi->rateset.count && j < IW_MAX_BITRATES; j++) {
iwe.u.bitrate.value =
@@ -4193,8 +4176,8 @@ wl_iw_get_scan(
iscan_buf_t * p_buf;
#if !defined(CSCAN)
uint32 counter = 0;
-#endif
-#endif
+#endif
+#endif
WL_TRACE(("%s: buflen_from_user %d: \n", dev->name, buflen_from_user));
@@ -4203,7 +4186,7 @@ wl_iw_get_scan(
return -EINVAL;
}
-
+
if ((error = dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci, sizeof(ci))))
return error;
ci.scan_channel = dtoh32(ci.scan_channel);
@@ -4218,7 +4201,7 @@ wl_iw_get_scan(
if ((!g_scan_specified_ssid && g_ss_cache_ctrl.m_prev_scan_mode) ||
g_ss_cache_ctrl.m_cons_br_scan_cnt > 4) {
g_ss_cache_ctrl.m_cons_br_scan_cnt = 0;
-
+
wl_iw_reset_ss_cache();
}
g_ss_cache_ctrl.m_prev_scan_mode = g_scan_specified_ssid;
@@ -4228,12 +4211,12 @@ wl_iw_get_scan(
else {
g_ss_cache_ctrl.m_cons_br_scan_cnt++;
}
-#endif
+#endif
+
-
if (g_scan_specified_ssid) {
-
+
list = kmalloc(len, GFP_KERNEL);
if (!list) {
WL_TRACE(("%s: wl_iw_get_scan return -ENOMEM\n", dev->name));
@@ -4257,7 +4240,7 @@ wl_iw_get_scan(
list->version = dtoh32(list->version);
list->count = dtoh32(list->count);
-
+
if (list->version != WL_BSS_INFO_VERSION) {
WL_ERROR(("%s : list->version %d != WL_BSS_INFO_VERSION\n",
__FUNCTION__, list->version));
@@ -4270,7 +4253,7 @@ wl_iw_get_scan(
#if !defined(CSCAN)
if (g_scan_specified_ssid) {
-
+
wl_iw_add_bss_to_ss_cache(list);
kfree(list);
}
@@ -4282,7 +4265,7 @@ wl_iw_get_scan(
if (g_scan_specified_ssid)
WL_TRACE(("%s: Specified scan APs from scan=%d\n", __FUNCTION__, list->count));
p_buf = iscan->list_hdr;
-
+
while (p_buf != iscan->list_cur) {
list_merge = &((wl_iscan_results_t*)p_buf->iscan_buf)->results;
WL_TRACE(("%s: Bcast APs list=%d\n", __FUNCTION__, list_merge->count));
@@ -4296,20 +4279,20 @@ wl_iw_get_scan(
#else
list_merge = (wl_scan_results_t *) g_scan;
len_ret = (__u16) wl_iw_get_scan_prep(list_merge, info, extra, buflen_from_user);
-#endif
+#endif
DHD_OS_MUTEX_UNLOCK(&wl_cache_lock);
if (g_ss_cache_ctrl.m_link_down) {
-
+
wl_iw_delete_bss_from_ss_cache(g_ss_cache_ctrl.m_active_bssid);
}
-
+
wl_iw_merge_scan_cache(info, extra+len_ret, buflen_from_user-len_ret, &merged_len);
len_ret += merged_len;
wl_iw_run_ss_cache_timer(0);
wl_iw_run_ss_cache_timer(1);
-#else
+#else
+
-
if (g_scan_specified_ssid) {
WL_TRACE(("%s: Specified scan APs in the list =%d\n", __FUNCTION__, list->count));
len_ret = (__u16) wl_iw_get_scan_prep(list, info, extra, buflen_from_user);
@@ -4317,7 +4300,7 @@ wl_iw_get_scan(
#if defined(WL_IW_USE_ISCAN)
p_buf = iscan->list_hdr;
-
+
while (p_buf != iscan->list_cur) {
list_merge = &((wl_iscan_results_t*)p_buf->iscan_buf)->results;
WL_TRACE(("%s: Bcast APs list=%d\n", __FUNCTION__, list_merge->count));
@@ -4332,29 +4315,29 @@ wl_iw_get_scan(
if (list_merge->count > 0)
len_ret += (__u16) wl_iw_get_scan_prep(list_merge, info, extra+len_ret,
buflen_from_user -len_ret);
-#endif
+#endif
}
else {
list = (wl_scan_results_t *) g_scan;
len_ret = (__u16) wl_iw_get_scan_prep(list, info, extra, buflen_from_user);
}
-#endif
+#endif
#if defined(WL_IW_USE_ISCAN)
-
+
g_scan_specified_ssid = 0;
-#endif
-
+#endif
+
if ((len_ret + WE_ADD_EVENT_FIX) < buflen_from_user)
len = len_ret;
dwrq->length = len;
- dwrq->flags = 0;
+ dwrq->flags = 0;
WL_TRACE(("%s return to WE %d bytes APs=%d\n", __FUNCTION__, dwrq->length, list->count));
return 0;
}
-#endif
+#endif
#if defined(WL_IW_USE_ISCAN)
static int
@@ -4400,14 +4383,14 @@ wl_iw_iscan_get_scan(
dev->name, __FUNCTION__));
return -EAGAIN;
}
-#endif
-
+#endif
+
if ((!iscan) || (iscan->tsk_ctl.thr_pid < 0)) {
WL_ERROR(("%ssysioc_pid\n", __FUNCTION__));
return EAGAIN;
}
-
+
#if !defined(CSCAN)
if (g_ss_cache_ctrl.m_timer_expired) {
@@ -4419,23 +4402,23 @@ wl_iw_iscan_get_scan(
}
else {
if (g_ss_cache_ctrl.m_link_down) {
-
+
wl_iw_delete_bss_from_ss_cache(g_ss_cache_ctrl.m_active_bssid);
}
if (g_ss_cache_ctrl.m_prev_scan_mode || g_ss_cache_ctrl.m_cons_br_scan_cnt > 4) {
g_ss_cache_ctrl.m_cons_br_scan_cnt = 0;
-
+
wl_iw_reset_ss_cache();
}
g_ss_cache_ctrl.m_prev_scan_mode = g_scan_specified_ssid;
g_ss_cache_ctrl.m_cons_br_scan_cnt++;
}
-#endif
+#endif
WL_TRACE(("%s: SIOCGIWSCAN GET broadcast results\n", dev->name));
apcnt = 0;
p_buf = iscan->list_hdr;
-
+
while (p_buf != iscan->list_cur) {
list = &((wl_iscan_results_t*)p_buf->iscan_buf)->results;
@@ -4455,23 +4438,23 @@ wl_iw_iscan_get_scan(
ASSERT(((uintptr)bi + dtoh32(bi->length)) <= ((uintptr)list +
WLC_IW_ISCAN_MAXLEN));
-
+
if (event + ETHER_ADDR_LEN + bi->SSID_len +
IW_EV_UINT_LEN + IW_EV_FREQ_LEN + IW_EV_QUAL_LEN >= end)
return -E2BIG;
-
+
iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
memcpy(iwe.u.ap_addr.sa_data, &bi->BSSID, ETHER_ADDR_LEN);
event = IWE_STREAM_ADD_EVENT(info, event, end, &iwe, IW_EV_ADDR_LEN);
-
+
iwe.u.data.length = dtoh32(bi->SSID_len);
iwe.cmd = SIOCGIWESSID;
iwe.u.data.flags = 1;
event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, bi->SSID);
-
+
if (dtoh16(bi->capability) & (DOT11_CAP_ESS | DOT11_CAP_IBSS)) {
iwe.cmd = SIOCGIWMODE;
if (dtoh16(bi->capability) & DOT11_CAP_ESS)
@@ -4482,7 +4465,7 @@ wl_iw_iscan_get_scan(
&iwe, IW_EV_UINT_LEN);
}
-
+
iwe.cmd = SIOCGIWFREQ;
channel = (bi->ctl_ch == 0) ? CHSPEC_CHANNEL(bi->chanspec) : bi->ctl_ch;
iwe.u.freq.m = wf_channel2mhz(channel,
@@ -4491,17 +4474,17 @@ wl_iw_iscan_get_scan(
iwe.u.freq.e = 6;
event = IWE_STREAM_ADD_EVENT(info, event, end, &iwe, IW_EV_FREQ_LEN);
-
+
iwe.cmd = IWEVQUAL;
iwe.u.qual.qual = rssi_to_qual(dtoh16(bi->RSSI));
iwe.u.qual.level = 0x100 + dtoh16(bi->RSSI);
iwe.u.qual.noise = 0x100 + bi->phy_noise;
event = IWE_STREAM_ADD_EVENT(info, event, end, &iwe, IW_EV_QUAL_LEN);
-
+
wl_iw_handle_scanresults_ies(&event, end, info, bi);
-
+
iwe.cmd = SIOCGIWENCODE;
if (dtoh16(bi->capability) & DOT11_CAP_PRIVACY)
iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
@@ -4510,14 +4493,14 @@ wl_iw_iscan_get_scan(
iwe.u.data.length = 0;
event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, (char *)event);
-
+
if (bi->rateset.count) {
if (event + IW_MAX_BITRATES*IW_EV_PARAM_LEN >= end)
return -E2BIG;
value = event + IW_EV_LCP_LEN;
iwe.cmd = SIOCGIWRATE;
-
+
iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
for (j = 0; j < bi->rateset.count && j < IW_MAX_BITRATES; j++) {
iwe.u.bitrate.value =
@@ -4529,28 +4512,28 @@ wl_iw_iscan_get_scan(
}
}
p_buf = p_buf->next;
- }
+ }
dwrq->length = event - extra;
- dwrq->flags = 0;
+ dwrq->flags = 0;
#if !defined(CSCAN)
-
+
wl_iw_merge_scan_cache(info, event, buflen_from_user - dwrq->length, &merged_len);
dwrq->length += merged_len;
wl_iw_run_ss_cache_timer(0);
wl_iw_run_ss_cache_timer(1);
-#endif
-
+#endif
+
#if defined(CONFIG_FIRST_SCAN)
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_RESULT_CONSUMED;
-#endif
+#endif
WL_TRACE(("%s return to WE %d bytes APs=%d\n", __FUNCTION__, dwrq->length, counter));
return 0;
}
-#endif
+#endif
#define WL_JOIN_PARAMS_MAX 1600
#ifdef CONFIG_PRESCANNED
@@ -4624,7 +4607,7 @@ check_prescan(wl_join_params_t *join_params, int *join_params_size)
WL_ERROR(("Passing %d channel/bssid pairs.\n", cnt));
return cnt;
}
-#endif
+#endif
static int
wl_iw_set_essid(
@@ -4653,7 +4636,7 @@ wl_iw_set_essid(
memset(join_params, 0, WL_JOIN_PARAMS_MAX);
-
+
memset(&g_ssid, 0, sizeof(g_ssid));
if (dwrq->length && extra) {
@@ -4680,14 +4663,14 @@ wl_iw_set_essid(
} else {
WL_ERROR(("No matched found\n Trying to join to specific channel\n"));
}
-#endif
+#endif
} else {
-
+
g_ssid.SSID_len = 0;
}
g_ssid.SSID_len = htod32(g_ssid.SSID_len);
-
+
memset(join_params, 0, sizeof(*join_params));
join_params_size = sizeof(join_params->ssid);
@@ -4695,8 +4678,8 @@ wl_iw_set_essid(
join_params->ssid.SSID_len = htod32(g_ssid.SSID_len);
memcpy(&(join_params->params.bssid), &ether_bcast, ETHER_ADDR_LEN);
-
-
+
+
wl_iw_ch_to_chanspec(g_wl_iw_params.target_channel, join_params, &join_params_size);
if ((error = dev_wlc_ioctl(dev, WLC_SET_SSID, join_params, join_params_size))) {
@@ -4735,12 +4718,12 @@ wl_iw_get_essid(
ssid.SSID_len = dtoh32(ssid.SSID_len);
-
+
memcpy(extra, ssid.SSID, ssid.SSID_len);
dwrq->length = ssid.SSID_len;
- dwrq->flags = 1;
+ dwrq->flags = 1;
return 0;
}
@@ -4760,7 +4743,7 @@ wl_iw_set_nick(
if (!extra)
return -EINVAL;
-
+
if (dwrq->length > sizeof(iw->nickname))
return -E2BIG;
@@ -4804,47 +4787,47 @@ wl_iw_set_rate(
WL_TRACE(("%s: SIOCSIWRATE\n", dev->name));
-
+
if ((error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, &rateset, sizeof(rateset))))
return error;
rateset.count = dtoh32(rateset.count);
if (vwrq->value < 0) {
-
+
rate = rateset.rates[rateset.count - 1] & 0x7f;
} else if (vwrq->value < rateset.count) {
-
+
rate = rateset.rates[vwrq->value] & 0x7f;
} else {
-
+
rate = vwrq->value / 500000;
}
if (vwrq->fixed) {
-
+
error_bg = dev_wlc_intvar_set(dev, "bg_rate", rate);
error_a = dev_wlc_intvar_set(dev, "a_rate", rate);
if (error_bg && error_a)
return (error_bg | error_a);
} else {
-
-
+
+
error_bg = dev_wlc_intvar_set(dev, "bg_rate", 0);
-
+
error_a = dev_wlc_intvar_set(dev, "a_rate", 0);
if (error_bg && error_a)
return (error_bg | error_a);
-
+
for (i = 0; i < rateset.count; i++)
if ((rateset.rates[i] & 0x7f) > rate)
break;
rateset.count = htod32(i);
-
+
if ((error = dev_wlc_ioctl(dev, WLC_SET_RATESET, &rateset, sizeof(rateset))))
return error;
}
@@ -4864,7 +4847,7 @@ wl_iw_get_rate(
WL_TRACE(("%s: SIOCGIWRATE\n", dev->name));
-
+
if ((error = dev_wlc_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate))))
return error;
rate = dtoh32(rate);
@@ -4979,7 +4962,7 @@ wl_iw_set_txpow(
uint16 txpwrmw;
WL_TRACE(("%s: SIOCSIWTXPOW\n", dev->name));
-
+
disable = vwrq->disabled ? WL_RADIO_SW_DISABLE : 0;
disable += WL_RADIO_SW_DISABLE << 16;
@@ -4987,15 +4970,15 @@ wl_iw_set_txpow(
if ((error = dev_wlc_ioctl(dev, WLC_SET_RADIO, &disable, sizeof(disable))))
return error;
-
+
if (disable & WL_RADIO_SW_DISABLE)
return 0;
-
+
if (!(vwrq->flags & IW_TXPOW_MWATT))
return -EINVAL;
-
+
if (vwrq->value < 0)
return 0;
@@ -5047,32 +5030,32 @@ wl_iw_set_retry(
WL_TRACE(("%s: SIOCSIWRETRY\n", dev->name));
-
+
if (vwrq->disabled || (vwrq->flags & IW_RETRY_LIFETIME))
return -EINVAL;
-
+
if (vwrq->flags & IW_RETRY_LIMIT) {
-
+
#if WIRELESS_EXT > 20
if ((vwrq->flags & IW_RETRY_LONG) ||(vwrq->flags & IW_RETRY_MAX) ||
!((vwrq->flags & IW_RETRY_SHORT) || (vwrq->flags & IW_RETRY_MIN))) {
#else
if ((vwrq->flags & IW_RETRY_MAX) || !(vwrq->flags & IW_RETRY_MIN)) {
-#endif
+#endif
lrl = htod32(vwrq->value);
if ((error = dev_wlc_ioctl(dev, WLC_SET_LRL, &lrl, sizeof(lrl))))
return error;
}
-
+
#if WIRELESS_EXT > 20
if ((vwrq->flags & IW_RETRY_SHORT) ||(vwrq->flags & IW_RETRY_MIN) ||
!((vwrq->flags & IW_RETRY_LONG) || (vwrq->flags & IW_RETRY_MAX))) {
#else
if ((vwrq->flags & IW_RETRY_MIN) || !(vwrq->flags & IW_RETRY_MAX)) {
-#endif
+#endif
srl = htod32(vwrq->value);
if ((error = dev_wlc_ioctl(dev, WLC_SET_SRL, &srl, sizeof(srl))))
return error;
@@ -5093,13 +5076,13 @@ wl_iw_get_retry(
WL_TRACE(("%s: SIOCGIWRETRY\n", dev->name));
- vwrq->disabled = 0;
+ vwrq->disabled = 0;
+
-
if ((vwrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME)
return -EINVAL;
-
+
if ((error = dev_wlc_ioctl(dev, WLC_GET_LRL, &lrl, sizeof(lrl))) ||
(error = dev_wlc_ioctl(dev, WLC_GET_SRL, &srl, sizeof(srl))))
return error;
@@ -5107,7 +5090,7 @@ wl_iw_get_retry(
lrl = dtoh32(lrl);
srl = dtoh32(srl);
-
+
if (vwrq->flags & IW_RETRY_MAX) {
vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
vwrq->value = lrl;
@@ -5120,7 +5103,7 @@ wl_iw_get_retry(
return 0;
}
-#endif
+#endif
static int
wl_iw_set_encode(
@@ -5144,7 +5127,7 @@ wl_iw_set_encode(
memset(&key, 0, sizeof(key));
if ((dwrq->flags & IW_ENCODE_INDEX) == 0) {
-
+
for (key.index = 0; key.index < DOT11_MAX_DEFAULT_KEYS; key.index++) {
val = htod32(key.index);
if ((error = dev_wlc_ioctl(dev, WLC_GET_KEY_PRIMARY, &val, sizeof(val))))
@@ -5153,7 +5136,7 @@ wl_iw_set_encode(
if (val)
break;
}
-
+
if (key.index == DOT11_MAX_DEFAULT_KEYS)
key.index = 0;
} else {
@@ -5162,9 +5145,9 @@ wl_iw_set_encode(
return -EINVAL;
}
-
+
if (!extra || !dwrq->length || (dwrq->flags & IW_ENCODE_NOKEY)) {
-
+
val = htod32(key.index);
if ((error = dev_wlc_ioctl(dev, WLC_SET_KEY_PRIMARY, &val, sizeof(val))))
return error;
@@ -5196,13 +5179,13 @@ wl_iw_set_encode(
return -EINVAL;
}
-
+
swap_key_from_BE(&key);
if ((error = dev_wlc_ioctl(dev, WLC_SET_KEY, &key, sizeof(key))))
return error;
}
-
+
val = (dwrq->flags & IW_ENCODE_DISABLED) ? 0 : WEP_ENABLED;
if ((error = dev_wlc_intvar_get(dev, "wsec", &wsec)))
@@ -5214,7 +5197,7 @@ wl_iw_set_encode(
if ((error = dev_wlc_intvar_set(dev, "wsec", wsec)))
return error;
-
+
val = (dwrq->flags & IW_ENCODE_RESTRICTED) ? 1 : 0;
val = htod32(val);
if ((error = dev_wlc_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val))))
@@ -5236,11 +5219,11 @@ wl_iw_get_encode(
WL_TRACE(("%s: SIOCGIWENCODE\n", dev->name));
-
+
bzero(&key, sizeof(wl_wsec_key_t));
if ((dwrq->flags & IW_ENCODE_INDEX) == 0) {
-
+
for (key.index = 0; key.index < DOT11_MAX_DEFAULT_KEYS; key.index++) {
val = key.index;
if ((error = dev_wlc_ioctl(dev, WLC_GET_KEY_PRIMARY, &val, sizeof(val))))
@@ -5255,7 +5238,7 @@ wl_iw_get_encode(
if (key.index >= DOT11_MAX_DEFAULT_KEYS)
key.index = 0;
-
+
if ((error = dev_wlc_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec))) ||
(error = dev_wlc_ioctl(dev, WLC_GET_AUTH, &auth, sizeof(auth))))
@@ -5265,21 +5248,21 @@ wl_iw_get_encode(
wsec = dtoh32(wsec);
auth = dtoh32(auth);
-
+
dwrq->length = MIN(DOT11_MAX_KEY_SIZE, key.len);
-
+
dwrq->flags = key.index + 1;
if (!(wsec & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))) {
-
+
dwrq->flags |= IW_ENCODE_DISABLED;
}
if (auth) {
-
+
dwrq->flags |= IW_ENCODE_RESTRICTED;
}
-
+
if (dwrq->length && extra)
memcpy(extra, key.data, dwrq->length);
@@ -5404,41 +5387,41 @@ wl_iw_set_encodeext(
memset(&key, 0, sizeof(key));
iwe = (struct iw_encode_ext *)extra;
-
+
if (dwrq->flags & IW_ENCODE_DISABLED) {
}
-
+
key.index = 0;
if (dwrq->flags & IW_ENCODE_INDEX)
key.index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
key.len = iwe->key_len;
-
+
if (!ETHER_ISMULTI(iwe->addr.sa_data))
bcopy((void *)&iwe->addr.sa_data, (char *)&key.ea, ETHER_ADDR_LEN);
-
+
if (key.len == 0) {
if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
WL_WSEC(("Changing the the primary Key to %d\n", key.index));
-
+
key.index = htod32(key.index);
error = dev_wlc_ioctl(dev, WLC_SET_KEY_PRIMARY,
&key.index, sizeof(key.index));
if (error)
return error;
}
-
+
else {
swap_key_from_BE(&key);
dev_wlc_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
}
}
#if (defined(BCMSUP_PSK) && defined(WLFBT))
-
+
else if (iwe->alg == IW_ENCODE_ALG_PMK) {
int j;
wsec_pmk_t pmk;
@@ -5446,7 +5429,7 @@ wl_iw_set_encodeext(
char* charptr = keystring;
uint len;
-
+
for (j = 0; j < (WSEC_MAX_PSK_LEN / 2); j++) {
sprintf(charptr, "%02x", iwe->key[j]);
charptr += 2;
@@ -5460,7 +5443,7 @@ wl_iw_set_encodeext(
if (error)
return error;
}
-#endif
+#endif
else {
if (iwe->key_len > sizeof(key.data))
return -EINVAL;
@@ -5480,7 +5463,7 @@ wl_iw_set_encodeext(
bcopy(keybuf, &key.data[16], sizeof(keybuf));
}
-
+
if (iwe->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
uchar *ivptr;
ivptr = (uchar *)iwe->rx_seq;
@@ -5644,7 +5627,7 @@ wl_iw_set_pmksa(
sizeof(pmkid_list));
return ret;
}
-#endif
+#endif
static int
wl_iw_get_encodeext(
@@ -5664,8 +5647,8 @@ wl_iw_create_wpaauth_wsec(struct net_device *dev)
{
wl_iw_t *iw = NETDEV_PRIV(dev);
uint32 wsec;
- int error = 0;
-
+
+
if (iw->pcipher & (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104))
wsec = WEP_ENABLED;
else if (iw->pcipher & IW_AUTH_CIPHER_TKIP)
@@ -5679,7 +5662,7 @@ wl_iw_create_wpaauth_wsec(struct net_device *dev)
else
wsec = 0;
-
+
if (iw->gcipher & (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104))
wsec |= WEP_ENABLED;
else if (iw->gcipher & IW_AUTH_CIPHER_TKIP)
@@ -5691,23 +5674,10 @@ wl_iw_create_wpaauth_wsec(struct net_device *dev)
wsec |= SMS4_ENABLED;
#endif
-
- if (wsec == 0 && iw->privacy_invoked) {
-#if 1
- //WL_INFO(("wps start...\n"));
- if ((error = dev_wlc_intvar_set(dev, "is_WPS_enrollee", TRUE))) {
- WL_ERROR(("Failed to set iovar is_WPS_enrollee\n"));
- }
- } else if (wsec) {
- printf("wps end...\n");
- if ((error = dev_wlc_intvar_set(dev, "is_WPS_enrollee", FALSE))) {
- WL_ERROR(("Failed to clear iovar is_WPS_enrollee\n"));
- return error;
- }
-#else
- wsec |= WEP_ENABLED;
-#endif
- }
+
+ if (wsec == 0 && iw->privacy_invoked)
+ wsec = WEP_ENABLED;
+
WL_INFORM(("%s: returning wsec of %d\n", __FUNCTION__, wsec));
return wsec;
@@ -5755,7 +5725,7 @@ wl_iw_set_wpaauth(
switch (paramid) {
case IW_AUTH_WPA_VERSION:
-
+
if (paramval & IW_AUTH_WPA_VERSION_DISABLED)
val = WPA_AUTH_DISABLED;
@@ -5808,14 +5778,14 @@ wl_iw_set_wpaauth(
val = WPA_AUTH_PSK;
else if (iw->wpaversion == IW_AUTH_WPA_VERSION_WPA2)
val = WPA2_AUTH_PSK;
- else
+ else
val = WPA_AUTH_DISABLED;
} else if (paramval & IW_AUTH_KEY_MGMT_802_1X) {
if (iw->wpaversion == IW_AUTH_WPA_VERSION_WPA)
val = WPA_AUTH_UNSPECIFIED;
else if (iw->wpaversion == IW_AUTH_WPA_VERSION_WPA2)
val = WPA2_AUTH_UNSPECIFIED;
- else
+ else
val = WPA_AUTH_DISABLED;
}
#ifdef BCMWAPI_WPI
@@ -5837,7 +5807,7 @@ wl_iw_set_wpaauth(
break;
case IW_AUTH_80211_AUTH_ALG:
-
+
WL_INFORM(("Setting the D11auth %d\n", paramval));
if (paramval == IW_AUTH_ALG_OPEN_SYSTEM)
val = 0;
@@ -5853,7 +5823,7 @@ wl_iw_set_wpaauth(
case IW_AUTH_WPA_ENABLED:
if (paramval == 0) {
- iw->privacy_invoked = 0;
+ iw->privacy_invoked = 0;
iw->pcipher = 0;
iw->gcipher = 0;
val = wl_iw_create_wpaauth_wsec(dev);
@@ -5865,7 +5835,7 @@ wl_iw_set_wpaauth(
return error;
}
-
+
break;
case IW_AUTH_DROP_UNENCRYPTED:
@@ -5880,7 +5850,7 @@ wl_iw_set_wpaauth(
#if WIRELESS_EXT > 17
case IW_AUTH_ROAMING_CONTROL:
WL_INFORM(("%s: IW_AUTH_ROAMING_CONTROL\n", __FUNCTION__));
-
+
break;
case IW_AUTH_PRIVACY_INVOKED:
@@ -5890,7 +5860,7 @@ wl_iw_set_wpaauth(
return error;
break;
-#endif
+#endif
#ifdef BCMWAPI_WPI
case IW_AUTH_WAPI_ENABLED:
if ((error = dev_wlc_intvar_get(dev, "wsec", &val)))
@@ -5915,7 +5885,7 @@ wl_iw_set_wpaauth(
}
}
break;
-#endif
+#endif
default:
break;
}
@@ -5955,7 +5925,7 @@ wl_iw_get_wpaauth(
break;
case IW_AUTH_KEY_MGMT:
-
+
if ((error = dev_wlc_intvar_get(dev, "wpa_auth", &val)))
return error;
if (VAL_PSK(val))
@@ -5978,7 +5948,7 @@ wl_iw_get_wpaauth(
break;
case IW_AUTH_80211_AUTH_ALG:
-
+
if ((error = dev_wlc_intvar_get(dev, "auth", &val)))
return error;
if (!val)
@@ -5997,18 +5967,18 @@ wl_iw_get_wpaauth(
#if WIRELESS_EXT > 17
case IW_AUTH_ROAMING_CONTROL:
WL_ERROR(("%s: IW_AUTH_ROAMING_CONTROL\n", __FUNCTION__));
-
+
break;
case IW_AUTH_PRIVACY_INVOKED:
paramval = iw->privacy_invoked;
break;
-#endif
+#endif
}
vwrq->value = paramval;
return 0;
}
-#endif
+#endif
#ifdef SOFTAP
@@ -6033,12 +6003,12 @@ wl_iw_parse_wep(char *keystr, wl_wsec_key_t *key)
case 28:
case 34:
case 66:
-
+
if (!strnicmp(keystr, "0x", 2))
keystr += 2;
else
return -1;
-
+
case 10:
case 26:
case 32:
@@ -6062,7 +6032,7 @@ wl_iw_parse_wep(char *keystr, wl_wsec_key_t *key)
key->algo = CRYPTO_ALGO_WEP128;
break;
case 16:
-
+
key->algo = CRYPTO_ALGO_AES_CCM;
break;
case 32:
@@ -6072,7 +6042,7 @@ wl_iw_parse_wep(char *keystr, wl_wsec_key_t *key)
return -1;
}
-
+
key->flags |= WL_PRIMARY_KEY;
return 0;
@@ -6094,7 +6064,7 @@ pbkdf2_sha1(const char *passphrase, const char *ssid, size_t ssid_len,
return -1;
}
-#endif
+#endif
static int
@@ -6138,11 +6108,11 @@ wl_bssiovar_mkbuf(
uint namelen;
uint iolen;
- prefixlen = strlen(prefix);
- namelen = strlen(iovar) + 1;
+ prefixlen = strlen(prefix);
+ namelen = strlen(iovar) + 1;
iolen = prefixlen + namelen + sizeof(int) + paramlen;
-
+
if (buflen < 0 || iolen > (uint)buflen) {
*perr = BCME_BUFTOOSHORT;
return 0;
@@ -6150,27 +6120,27 @@ wl_bssiovar_mkbuf(
p = (int8*)bufptr;
-
+
memcpy(p, prefix, prefixlen);
p += prefixlen;
-
+
memcpy(p, iovar, namelen);
p += namelen;
-
+
bssidx = htod32(bssidx);
memcpy(p, &bssidx, sizeof(int32));
p += sizeof(int32);
-
+
if (paramlen)
memcpy(p, param, paramlen);
*perr = 0;
return iolen;
}
-#endif
+#endif
@@ -6200,15 +6170,15 @@ wl_iw_combined_scan_set(struct net_device *dev, wlc_ssid_t* ssids_local, int nss
}
#ifdef PNO_SUPPORT
-
+
if (dhd_dev_get_pno_status(dev)) {
WL_ERROR(("%s: Scan called when PNO is active\n", __FUNCTION__));
}
-#endif
+#endif
params_size += WL_SCAN_PARAMS_SSID_MAX * sizeof(wlc_ssid_t);
-
+
if (nssid > 0) {
i = OFFSETOF(wl_scan_params_t, channel_list) + nchan * sizeof(uint16);
i = ROUNDUP(i, sizeof(uint32));
@@ -6225,7 +6195,7 @@ wl_iw_combined_scan_set(struct net_device *dev, wlc_ssid_t* ssids_local, int nss
p = (char*)iscan->iscan_ex_params_p->params.channel_list + nchan * sizeof(uint16);
}
-
+
iscan->iscan_ex_params_p->params.channel_num =
htod32((nssid << WL_SCAN_PARAMS_NSSID_SHIFT) |
(nchan & WL_SCAN_PARAMS_COUNT_MASK));
@@ -6234,7 +6204,7 @@ wl_iw_combined_scan_set(struct net_device *dev, wlc_ssid_t* ssids_local, int nss
((iscan->iscan_ex_params_p->params.channel_num >> WL_SCAN_PARAMS_NSSID_SHIFT) &
WL_SCAN_PARAMS_COUNT_MASK);
-
+
params_size = (int) (p - (char*)iscan->iscan_ex_params_p + nssid * sizeof(wlc_ssid_t));
iscan->iscan_ex_param_size = params_size;
@@ -6268,7 +6238,7 @@ wl_iw_combined_scan_set(struct net_device *dev, wlc_ssid_t* ssids_local, int nss
WL_SCAN(("scan_type=%d\n", iscan->iscan_ex_params_p->params.scan_type));
WL_SCAN(("\n###################\n"));
}
-#endif
+#endif
if (params_size > WLC_IOCTL_MEDLEN) {
WL_ERROR(("Set ISCAN for %s due to params_size=%d \n",
@@ -6331,7 +6301,7 @@ iwpriv_set_cscan(struct net_device *dev, struct iw_request_info *info,
str_ptr = extra;
-
+
if (strncmp(str_ptr, GET_SSID, strlen(GET_SSID))) {
WL_ERROR(("%s Error: extracting SSID='' string\n", __FUNCTION__));
res = -EINVAL;
@@ -6350,13 +6320,13 @@ iwpriv_set_cscan(struct net_device *dev, struct iw_request_info *info,
memset(iscan->iscan_ex_params_p, 0, iscan->iscan_ex_param_size);
ASSERT(iscan->iscan_ex_param_size < WLC_IOCTL_MAXLEN);
-
+
wl_iw_iscan_prep(&iscan->iscan_ex_params_p->params, NULL);
iscan->iscan_ex_params_p->version = htod32(ISCAN_REQ_VERSION);
iscan->iscan_ex_params_p->action = htod16(WL_SCAN_ACTION_START);
iscan->iscan_ex_params_p->scan_duration = htod16(0);
-
+
if ((nchan = wl_iw_parse_channel_list(&str_ptr,
&iscan->iscan_ex_params_p->params.channel_list[0],
WL_NUMCHANNELS)) == -1) {
@@ -6365,7 +6335,7 @@ iwpriv_set_cscan(struct net_device *dev, struct iw_request_info *info,
goto exit_proc;
}
-
+
get_parameter_from_string(&str_ptr,
GET_NPROBE, PTYPE_INTDEC,
&iscan->iscan_ex_params_p->params.nprobes, 2);
@@ -6382,7 +6352,7 @@ iwpriv_set_cscan(struct net_device *dev, struct iw_request_info *info,
get_parameter_from_string(&str_ptr, GET_SCAN_TYPE, PTYPE_INTDEC,
&iscan->iscan_ex_params_p->params.scan_type, 1);
-
+
res = wl_iw_combined_scan_set(dev, ssids_local, nssid, nchan);
exit_proc:
@@ -6414,20 +6384,20 @@ wl_iw_set_cscan(
char tlv_in_example[] = {
'C', 'S', 'C', 'A', 'N', ' ',
0x53, 0x01, 0x00, 0x00,
- 'S',
- 0x00,
- 'S',
- 0x04,
+ 'S',
+ 0x00,
+ 'S',
+ 0x04,
'B', 'R', 'C', 'M',
'C',
- 0x06,
- 'P',
+ 0x06,
+ 'P',
0x94,
0x11,
- 'T',
- 0x01
+ 'T',
+ 0x01
};
-#endif
+#endif
WL_TRACE(("\n### %s: info->cmd:%x, info->flags:%x, u.data=0x%p, u.len=%d\n",
__FUNCTION__, info->cmd, info->flags,
@@ -6452,7 +6422,7 @@ wl_iw_set_cscan(
for (i = 0; i < wrqu->data.length; i++)
printf("%02X ", extra[i]);
printf("\n");
-#endif
+#endif
str_ptr = extra;
str_ptr += strlen(CSCAN_COMMAND);
@@ -6460,7 +6430,7 @@ wl_iw_set_cscan(
cscan_tlv_temp = (cscan_tlv_t *)str_ptr;
memset(ssids_local, 0, sizeof(ssids_local));
-
+
if ((cscan_tlv_temp->prefix == CSCAN_TLV_PREFIX) &&
(cscan_tlv_temp->version == CSCAN_TLV_VERSION) &&
(cscan_tlv_temp->subver == CSCAN_TLV_SUBVERSION))
@@ -6468,29 +6438,29 @@ wl_iw_set_cscan(
str_ptr += sizeof(cscan_tlv_t);
tlv_size_left -= sizeof(cscan_tlv_t);
-
+
if ((nssid = wl_iw_parse_ssid_list_tlv(&str_ptr, ssids_local,
WL_SCAN_PARAMS_SSID_MAX, &tlv_size_left)) <= 0) {
WL_ERROR(("SSID is not presented or corrupted ret=%d\n", nssid));
goto exit_proc;
}
else {
-
+
memset(iscan->iscan_ex_params_p, 0, iscan->iscan_ex_param_size);
-
+
wl_iw_iscan_prep(&iscan->iscan_ex_params_p->params, NULL);
iscan->iscan_ex_params_p->version = htod32(ISCAN_REQ_VERSION);
iscan->iscan_ex_params_p->action = htod16(WL_SCAN_ACTION_START);
iscan->iscan_ex_params_p->scan_duration = htod16(0);
-
+
while (tlv_size_left > 0)
{
type = str_ptr[0];
switch (type) {
case CSCAN_TLV_TYPE_CHANNEL_IE:
-
+
if ((nchan = wl_iw_parse_channel_list_tlv(&str_ptr,
&iscan->iscan_ex_params_p->params.channel_list[0],
WL_NUMCHANNELS, &tlv_size_left)) == -1) {
@@ -6556,7 +6526,7 @@ wl_iw_set_cscan(
goto exit_proc;
break;
}
- }
+ }
}
}
else {
@@ -6567,7 +6537,7 @@ wl_iw_set_cscan(
#if defined(CONFIG_FIRST_SCAN)
if (g_first_broadcast_scan < BROADCAST_SCAN_FIRST_RESULT_CONSUMED) {
if (++g_first_counter_scans == MAX_ALLOWED_BLOCK_SCAN_FROM_FIRST_SCAN) {
-
+
WL_ERROR(("%s Clean up First scan flag which is %d\n",
__FUNCTION__, g_first_broadcast_scan));
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_RESULT_CONSUMED;
@@ -6578,9 +6548,9 @@ wl_iw_set_cscan(
return -EBUSY;
}
}
-#endif
+#endif
+
-
res = wl_iw_combined_scan_set(dev, ssids_local, nssid, nchan);
exit_proc:
@@ -6588,7 +6558,7 @@ exit_proc:
return res;
}
-#endif
+#endif
#ifdef CONFIG_WPS2
static int
@@ -6640,8 +6610,8 @@ wl_iw_add_wps_probe_req_ie(
str_ptr += WPS_PROBE_REQ_IE_CMD_LENGTH;
datalen = wrqu->data.length - WPS_PROBE_REQ_IE_CMD_LENGTH;
-
-
+
+
buflen = sizeof(vndr_ie_setbuf_t) + datalen - sizeof(vndr_ie_t);
ie_setbuf = (vndr_ie_setbuf_t *)kmalloc(buflen, GFP_KERNEL);
if (!ie_setbuf) {
@@ -6651,15 +6621,15 @@ wl_iw_add_wps_probe_req_ie(
memset(ie_setbuf, 0x00, buflen);
-
+
strncpy(ie_setbuf->cmd, "add", VNDR_IE_CMD_LEN - 1);
ie_setbuf->cmd[VNDR_IE_CMD_LEN - 1] = '\0';
-
+
iecount = htod32(1);
memcpy((void *)&ie_setbuf->vndr_ie_buffer.iecount, &iecount, sizeof(int));
-
+
pktflag = 0x10;
memcpy((void *)&ie_setbuf->vndr_ie_buffer.vndr_ie_list[0].pktflag,
&pktflag, sizeof(uint32));
@@ -6708,7 +6678,7 @@ fail:
}
return ret;
}
-#endif
+#endif
#ifdef SOFTAP
@@ -6743,7 +6713,7 @@ thr_wait_for_2nd_eth_dev(void *data)
if (down_timeout(&tsk_ctl->sema, msecs_to_jiffies(1000)) != 0) {
#else
if (down_interruptible(&tsk_ctl->sema) != 0) {
-#endif
+#endif
WL_ERROR(("\n%s: sap_eth_sema timeout \n", __FUNCTION__));
ret = -1;
goto fail;
@@ -6769,9 +6739,9 @@ thr_wait_for_2nd_eth_dev(void *data)
ap_cfg_running = TRUE;
dhd_os_spin_unlock(iw->pub, flags);
- bcm_mdelay(500);
+ bcm_mdelay(500);
+
-
wl_iw_send_priv_event(priv_dev, "AP_SET_CFG_OK");
fail:
@@ -6783,7 +6753,7 @@ fail:
complete_and_exit(&tsk_ctl->completed, 0);
return ret;
}
-#endif
+#endif
#ifndef AP_ONLY
static int last_auto_channel = 6;
#endif
@@ -6846,7 +6816,7 @@ get_softap_auto_channel(struct net_device *dev, struct ap_profile *ap)
WL_ERROR(("can't get auto channel sel, err = %d, "
"chosen = 0x%04X\n", ret, (uint16)chosen));
goto fail;
- } else {
+ } else {
ap->channel = (uint16)last_auto_channel;
WL_ERROR(("auto channel sel timed out. we get channel %d\n",
ap->channel));
@@ -6876,7 +6846,7 @@ fail :
return ret;
}
return res;
-}
+}
static int
@@ -6916,17 +6886,17 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
#ifdef AP_ONLY
if (ap_cfg_running) {
- wl_iw_softap_deassoc_stations(dev, NULL);
+ wl_iw_softap_deassoc_stations(dev, NULL);
ap_cfg_running = FALSE;
}
-#endif
+#endif
+
-
if (ap_cfg_running == FALSE) {
#ifndef AP_ONLY
-
+
sema_init(&ap_eth_ctl.sema, 0);
mpc = 0;
@@ -6943,7 +6913,7 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
}
#ifdef AP_ONLY
-
+
apsta_var = 0;
if ((res = dev_wlc_ioctl(dev, WLC_SET_AP, &apsta_var, sizeof(apsta_var)))) {
WL_ERROR(("%s fail to set apsta_var 0\n", __FUNCTION__));
@@ -6956,7 +6926,7 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
}
res = dev_wlc_ioctl(dev, WLC_GET_AP, &apsta_var, sizeof(apsta_var));
#else
-
+
apsta_var = 1;
iolen = wl_bssiovar_mkbuf("apsta",
bsscfg_index, &apsta_var, sizeof(apsta_var)+4,
@@ -6976,7 +6946,7 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
}
-#endif
+#endif
updown = 1;
if ((res = dev_wlc_ioctl(dev, WLC_UP, &updown, sizeof(updown))) < 0) {
@@ -6985,7 +6955,7 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
}
} else {
-
+
if (!ap_net_dev) {
WL_ERROR(("%s: ap_net_dev is null\n", __FUNCTION__));
goto fail;
@@ -6993,7 +6963,7 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
res = wl_iw_softap_deassoc_stations(ap_net_dev, NULL);
-
+
if ((res = dev_iw_write_cfg1_bss_var(dev, 0)) < 0) {
WL_ERROR(("%s fail to set bss down\n", __FUNCTION__));
goto fail;
@@ -7019,7 +6989,7 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
goto fail;
}
-
+
if ((ap->channel == 0) && (get_softap_auto_channel(dev, ap) < 0)) {
ap->channel = 1;
WL_ERROR(("%s auto channel failed, use channel=%d\n",
@@ -7049,7 +7019,7 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
ap_ssid.SSID_len = strlen(ap->ssid);
strncpy(ap_ssid.SSID, ap->ssid, ap_ssid.SSID_len);
-
+
#ifdef AP_ONLY
if ((res = wl_iw_set_ap_security(dev, &my_ap)) != 0) {
WL_ERROR(("ERROR:%d in:%s, wl_iw_set_ap_security is skipped\n",
@@ -7069,11 +7039,11 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
goto fail;
}
if (ap_cfg_running == FALSE) {
-
+
PROC_START(thr_wait_for_2nd_eth_dev, dev, &ap_eth_ctl, 0);
} else {
ap_eth_ctl.thr_pid = -1;
-
+
if (ap_net_dev == NULL) {
WL_ERROR(("%s ERROR: ap_net_dev is NULL !!!\n", __FUNCTION__));
goto fail;
@@ -7082,19 +7052,19 @@ set_ap_cfg(struct net_device *dev, struct ap_profile *ap)
WL_ERROR(("%s: %s Configure security & restart AP bss \n",
__FUNCTION__, ap_net_dev->name));
-
+
if ((res = wl_iw_set_ap_security(ap_net_dev, &my_ap)) < 0) {
WL_ERROR(("%s fail to set security : %d\n", __FUNCTION__, res));
goto fail;
}
-
+
if ((res = dev_iw_write_cfg1_bss_var(dev, 1)) < 0) {
WL_ERROR(("%s fail to set bss up\n", __FUNCTION__));
goto fail;
}
}
-#endif
+#endif
fail:
WL_SOFTAP(("%s exit with %d\n", __FUNCTION__, res));
@@ -7103,7 +7073,7 @@ fail:
return res;
}
-#endif
+#endif
@@ -7133,7 +7103,7 @@ wl_iw_set_ap_security(struct net_device *dev, struct ap_profile *ap)
if (strnicmp(ap->sec, "open", strlen("open")) == 0) {
-
+
wsec = 0;
res = dev_wlc_intvar_set(dev, "wsec", wsec);
wpa_auth = WPA_AUTH_DISABLED;
@@ -7145,7 +7115,7 @@ wl_iw_set_ap_security(struct net_device *dev, struct ap_profile *ap)
} else if (strnicmp(ap->sec, "wep", strlen("wep")) == 0) {
-
+
memset(&key, 0, sizeof(key));
wsec = WEP_ENABLED;
@@ -7173,7 +7143,7 @@ wl_iw_set_ap_security(struct net_device *dev, struct ap_profile *ap)
} else if (strnicmp(ap->sec, "wpa2-psk", strlen("wpa2-psk")) == 0) {
-
+
wsec_pmk_t psk;
size_t key_len;
@@ -7188,18 +7158,18 @@ wl_iw_set_ap_security(struct net_device *dev, struct ap_profile *ap)
return -1;
}
-
+
if (key_len < WSEC_MAX_PSK_LEN) {
unsigned char output[2*SHA1HashSize];
char key_str_buf[WSEC_MAX_PSK_LEN+1];
-
+
memset(output, 0, sizeof(output));
pbkdf2_sha1(ap->key, ap->ssid, strlen(ap->ssid), 4096, output, 32);
-
+
ptr = key_str_buf;
for (i = 0; i < (WSEC_MAX_PSK_LEN/8); i++) {
-
+
sprintf(ptr, "%02x%02x%02x%02x", (uint)output[i*4],
(uint)output[i*4+1], (uint)output[i*4+2],
(uint)output[i*4+3]);
@@ -7221,7 +7191,7 @@ wl_iw_set_ap_security(struct net_device *dev, struct ap_profile *ap)
} else if (strnicmp(ap->sec, "wpa-psk", strlen("wpa-psk")) == 0) {
-
+
wsec_pmk_t psk;
size_t key_len;
@@ -7235,20 +7205,20 @@ wl_iw_set_ap_security(struct net_device *dev, struct ap_profile *ap)
return -1;
}
-
+
if (key_len < WSEC_MAX_PSK_LEN) {
unsigned char output[2*SHA1HashSize];
char key_str_buf[WSEC_MAX_PSK_LEN+1];
bzero(output, 2*SHA1HashSize);
WL_SOFTAP(("%s: do passhash...\n", __FUNCTION__));
-
+
pbkdf2_sha1(ap->key, ap->ssid, strlen(ap->ssid), 4096, output, 32);
-
+
ptr = key_str_buf;
for (i = 0; i < (WSEC_MAX_PSK_LEN/8); i++) {
WL_SOFTAP(("[%02d]: %08x\n", i, *((unsigned int*)&output[i*4])));
-
+
sprintf(ptr, "%02x%02x%02x%02x", (uint)output[i*4],
(uint)output[i*4+1], (uint)output[i*4+2],
(uint)output[i*4+3]);
@@ -7300,15 +7270,15 @@ get_parameter_from_string(
if ((*str_ptr) && !strncmp(*str_ptr, token, strlen(token))) {
- strsep(str_ptr, "=,");
+ strsep(str_ptr, "=,");
param_str_begin = *str_ptr;
- strsep(str_ptr, "=,");
+ strsep(str_ptr, "=,");
if (*str_ptr == NULL) {
-
+
parm_str_len = strlen(param_str_begin);
} else {
- param_str_end = *str_ptr-1;
+ param_str_end = *str_ptr-1;
parm_str_len = param_str_end - param_str_begin;
}
@@ -7324,7 +7294,7 @@ get_parameter_from_string(
switch (param_type) {
case PTYPE_INTDEC: {
-
+
int *pdst_int = dst;
char *eptr;
@@ -7340,16 +7310,16 @@ get_parameter_from_string(
break;
case PTYPE_STR_HEX: {
u8 *buf = dst;
-
- param_max_len = param_max_len >> 1;
+
+ param_max_len = param_max_len >> 1;
hstr_2_buf(param_str_begin, buf, param_max_len);
dhd_print_buf(buf, param_max_len, 0);
}
break;
default:
-
+
memcpy(dst, param_str_begin, parm_str_len);
- *((char *)dst + parm_str_len) = 0;
+ *((char *)dst + parm_str_len) = 0;
WL_ERROR((" written as a string:%s\n", (char *)dst));
break;
@@ -7374,16 +7344,16 @@ static int wl_iw_softap_deassoc_stations(struct net_device *dev, u8 *mac)
struct maclist *assoc_maclist = (struct maclist *) mac_buf;
bool deauth_all = FALSE;
-
+
if (mac == NULL) {
deauth_all = TRUE;
- sta_mac = z_mac;
+ sta_mac = z_mac;
} else {
- sta_mac = mac;
+ sta_mac = mac;
}
memset(assoc_maclist, 0, sizeof(mac_buf));
- assoc_maclist->count = 8;
+ assoc_maclist->count = 8;
res = dev_wlc_ioctl(dev, WLC_GET_ASSOCLIST, assoc_maclist, 128);
if (res != 0) {
@@ -7395,11 +7365,11 @@ static int wl_iw_softap_deassoc_stations(struct net_device *dev, u8 *mac)
for (i = 0; i < assoc_maclist->count; i++) {
scb_val_t scbval;
scbval.val = htod32(1);
-
+
bcopy(&assoc_maclist->ea[i], &scbval.ea, ETHER_ADDR_LEN);
if (deauth_all || (memcmp(&scbval.ea, sta_mac, ETHER_ADDR_LEN) == 0)) {
-
+
WL_SOFTAP(("%s, deauth STA:%d \n", __FUNCTION__, i));
res |= dev_wlc_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON,
&scbval, sizeof(scb_val_t));
@@ -7409,7 +7379,7 @@ static int wl_iw_softap_deassoc_stations(struct net_device *dev, u8 *mac)
if (res != 0) {
WL_ERROR(("%s: Error:%d\n", __FUNCTION__, res));
} else if (assoc_maclist->count) {
-
+
bcm_mdelay(200);
}
return res;
@@ -7444,7 +7414,7 @@ iwpriv_softap_stop(struct net_device *dev,
WL_ERROR(("%s failed to del BSS err = %d", __FUNCTION__, res));
#endif
-
+
bcm_mdelay(100);
wrqu->data.length = 0;
@@ -7469,7 +7439,7 @@ iwpriv_fw_reload(struct net_device *dev,
{
int ret = -1;
char extra[256];
- char *fwstr = fw_path ;
+ char *fwstr = fw_path ;
WL_SOFTAP(("current firmware_path[]=%s\n", fwstr));
@@ -7487,7 +7457,7 @@ iwpriv_fw_reload(struct net_device *dev,
goto exit_proc;
}
-
+
extra[wrqu->data.length] = 8;
str_ptr = extra;
@@ -7549,13 +7519,13 @@ iwpriv_wpasupp_loop_tst(struct net_device *dev,
return -EFAULT;
}
-
+
res = wl_iw_send_priv_event(dev, params);
kfree(params);
return res;
}
-#endif
+#endif
static int
@@ -7577,21 +7547,21 @@ iwpriv_en_ap_bss(
WL_TRACE(("%s: rcvd IWPRIV IOCTL: for dev:%s\n", __FUNCTION__, dev->name));
-
+
#ifndef AP_ONLY
if ((res = wl_iw_set_ap_security(dev, &my_ap)) != 0) {
WL_ERROR((" %s ERROR setting SOFTAP security in :%d\n", __FUNCTION__, res));
}
else {
-
+
if ((res = dev_iw_write_cfg1_bss_var(dev, 1)) < 0)
WL_ERROR(("%s fail to set bss up err=%d\n", __FUNCTION__, res));
else
-
+
bcm_mdelay(100);
}
-#endif
+#endif
WL_SOFTAP(("%s done with res %d \n", __FUNCTION__, res));
DHD_OS_MUTEX_UNLOCK(&wl_softap_lock);
@@ -7603,7 +7573,7 @@ iwpriv_en_ap_bss(
static int
get_assoc_sta_list(struct net_device *dev, char *buf, int len)
{
-
+
WL_TRACE(("%s: dev_wlc_ioctl(dev:%p, cmd:%d, buf:%p, len:%d)\n",
__FUNCTION__, dev, WLC_GET_ASSOCLIST, buf, len));
@@ -7627,30 +7597,30 @@ set_ap_mac_list(struct net_device *dev, void *buf)
int i;
int mac_mode = mac_list_set->mode;
int ioc_res = 0;
- ap_macmode = mac_list_set->mode;
+ ap_macmode = mac_list_set->mode;
+
-
bzero(&ap_black_list, sizeof(struct mflist));
if (mac_mode == MACLIST_MODE_DISABLED) {
-
+
ioc_res = dev_wlc_ioctl(dev, WLC_SET_MACMODE, &mac_mode, sizeof(mac_mode));
check_error(ioc_res, "ioctl ERROR:", __FUNCTION__, __LINE__);
WL_SOFTAP(("%s: MAC filtering disabled\n", __FUNCTION__));
} else {
-
+
scb_val_t scbval;
char mac_buf[256] = {0};
struct maclist *assoc_maclist = (struct maclist *) mac_buf;
-
+
bcopy(maclist, &ap_black_list, sizeof(ap_black_list));
-
+
ioc_res = dev_wlc_ioctl(dev, WLC_SET_MACMODE, &mac_mode, sizeof(mac_mode));
check_error(ioc_res, "ioctl ERROR:", __FUNCTION__, __LINE__);
-
+
length = sizeof(maclist->count) + maclist->count*ETHER_ADDR_LEN;
dev_wlc_ioctl(dev, WLC_SET_MACLIST, maclist, length);
@@ -7664,18 +7634,18 @@ set_ap_mac_list(struct net_device *dev, void *buf)
maclist->ea[i].octet[3], maclist->ea[i].octet[4],
maclist->ea[i].octet[5]));
-
+
assoc_maclist->count = 8;
ioc_res = dev_wlc_ioctl(dev, WLC_GET_ASSOCLIST, assoc_maclist, 256);
check_error(ioc_res, "ioctl ERROR:", __FUNCTION__, __LINE__);
WL_SOFTAP((" Cur assoc clients:%d\n", assoc_maclist->count));
-
+
if (assoc_maclist->count)
for (i = 0; i < assoc_maclist->count; i++) {
int j;
bool assoc_mac_matched = FALSE;
-
+
WL_SOFTAP(("\n Cheking assoc STA: "));
dhd_print_buf(&assoc_maclist->ea[i], 6, 7);
WL_SOFTAP(("with the b/w list:"));
@@ -7683,12 +7653,12 @@ set_ap_mac_list(struct net_device *dev, void *buf)
for (j = 0; j < maclist->count; j++)
if (!bcmp(&assoc_maclist->ea[i], &maclist->ea[j],
ETHER_ADDR_LEN)) {
-
+
assoc_mac_matched = TRUE;
break;
}
-
+
if (((mac_mode == MACLIST_MODE_ALLOW) && !assoc_mac_matched) ||
((mac_mode == MACLIST_MODE_DENY) && assoc_mac_matched)) {
@@ -7709,14 +7679,14 @@ set_ap_mac_list(struct net_device *dev, void *buf)
}
} else {
WL_SOFTAP(("No ASSOC CLIENTS\n"));
- }
+ }
- }
+ }
WL_SOFTAP(("%s iocres:%d\n", __FUNCTION__, ioc_res));
return ioc_res;
}
-#endif
+#endif
@@ -7740,7 +7710,7 @@ wl_iw_process_private_ascii_cmd(
WL_SOFTAP((" AP_CFG \n"));
-
+
if (init_ap_profile_from_string(cmd_str+PROFILE_OFFSET, &my_ap) != 0) {
WL_ERROR(("ERROR: SoftAP CFG prams !\n"));
ret = -1;
@@ -7752,14 +7722,14 @@ wl_iw_process_private_ascii_cmd(
WL_SOFTAP(("\n SOFTAP - ENABLE BSS \n"));
-
+
WL_SOFTAP(("\n!!! got 'WL_AP_EN_BSS' from WPA supplicant, dev:%s\n", dev->name));
#ifndef AP_ONLY
if (ap_net_dev == NULL) {
printf("\n ERROR: SOFTAP net_dev* is NULL !!!\n");
} else {
-
+
if ((ret = iwpriv_en_ap_bss(ap_net_dev, info, dwrq, cmd_str)) < 0)
WL_ERROR(("%s line %d fail to set bss up\n",
__FUNCTION__, __LINE__));
@@ -7771,7 +7741,7 @@ wl_iw_process_private_ascii_cmd(
#endif
} else if (strnicmp(sub_cmd, "ASSOC_LST", strlen("ASSOC_LST")) == 0) {
-
+
} else if (strnicmp(sub_cmd, "AP_BSS_STOP", strlen("AP_BSS_STOP")) == 0) {
@@ -7787,7 +7757,7 @@ wl_iw_process_private_ascii_cmd(
return ret;
}
-#endif
+#endif
#ifdef BCMOKC
@@ -7876,7 +7846,7 @@ wl_iw_okc_enable(struct net_device *dev,
return error;
}
-#endif
+#endif
static int
wl_iw_set_priv(
@@ -7900,7 +7870,7 @@ wl_iw_set_priv(
WL_TRACE(("%s: SIOCSIWPRIV request %s, info->cmd:%x, info->flags:%d\n dwrq->length:%d\n",
dev->name, extra, info->cmd, info->flags, dwrq->length));
-
+
net_os_wake_lock(dev);
@@ -7922,14 +7892,14 @@ wl_iw_set_priv(
WL_TRACE(("%s: active scan setting suppressed\n", dev->name));
#else
ret = wl_iw_set_active_scan(dev, info, (union iwreq_data *)dwrq, extra);
-#endif
+#endif
}
else if (strnicmp(extra, "SCAN-PASSIVE", strlen("SCAN-PASSIVE")) == 0)
#ifdef ENABLE_ACTIVE_PASSIVE_SCAN_SUPPRESS
WL_TRACE(("%s: passive scan setting suppressed\n", dev->name));
#else
ret = wl_iw_set_passive_scan(dev, info, (union iwreq_data *)dwrq, extra);
-#endif
+#endif
else if (strnicmp(extra, "RSSI", strlen("RSSI")) == 0)
ret = wl_iw_get_rssi(dev, info, (union iwreq_data *)dwrq, extra);
else if (strnicmp(extra, "LINKSPEED", strlen("LINKSPEED")) == 0)
@@ -7948,10 +7918,8 @@ wl_iw_set_priv(
ret = wl_iw_get_dtim_skip(dev, info, (union iwreq_data *)dwrq, extra);
else if (strnicmp(extra, DTIM_SKIP_SET_CMD, strlen(DTIM_SKIP_SET_CMD)) == 0)
ret = wl_iw_set_dtim_skip(dev, info, (union iwreq_data *)dwrq, extra);
- else if (strnicmp(extra, SETSUSPENDOPT_CMD, strlen(SETSUSPENDOPT_CMD)) == 0)
- ret = wl_iw_set_suspend_opt(dev, info, (union iwreq_data *)dwrq, extra);
- else if (strnicmp(extra, SETSUSPENDMODE_CMD, strlen(SETSUSPENDMODE_CMD)) == 0)
- ret = wl_iw_set_suspend_mode(dev, info, (union iwreq_data *)dwrq, extra);
+ else if (strnicmp(extra, SETSUSPEND_CMD, strlen(SETSUSPEND_CMD)) == 0)
+ ret = wl_iw_set_suspend(dev, info, (union iwreq_data *)dwrq, extra);
else if (strnicmp(extra, TXPOWER_SET_CMD, strlen(TXPOWER_SET_CMD)) == 0)
ret = wl_iw_set_txpower(dev, info, (union iwreq_data *)dwrq, extra);
#if defined(PNO_SUPPORT)
@@ -7963,12 +7931,12 @@ wl_iw_set_priv(
ret = wl_iw_set_pno_setadd(dev, info, (union iwreq_data *)dwrq, extra);
else if (strnicmp(extra, PNOENABLE_SET_CMD, strlen(PNOENABLE_SET_CMD)) == 0)
ret = wl_iw_set_pno_enable(dev, info, (union iwreq_data *)dwrq, extra);
-#endif
+#endif
#if defined(CSCAN)
-
+
else if (strnicmp(extra, CSCAN_COMMAND, strlen(CSCAN_COMMAND)) == 0)
ret = wl_iw_set_cscan(dev, info, (union iwreq_data *)dwrq, extra);
-#endif
+#endif
#ifdef CONFIG_WPS2
else if (strnicmp(extra, WPS_ADD_PROBE_REQ_IE_CMD,
strlen(WPS_ADD_PROBE_REQ_IE_CMD)) == 0)
@@ -7978,7 +7946,7 @@ wl_iw_set_priv(
strlen(WPS_DEL_PROBE_REQ_IE_CMD)) == 0)
ret = wl_iw_del_wps_probe_req_ie(dev, info,
(union iwreq_data *)dwrq, extra);
-#endif
+#endif
else if (strnicmp(extra, "POWERMODE", strlen("POWERMODE")) == 0)
ret = wl_iw_set_power_mode(dev, info, (union iwreq_data *)dwrq, extra);
else if (strnicmp(extra, "BTCOEXMODE", strlen("BTCOEXMODE")) == 0)
@@ -7987,14 +7955,14 @@ wl_iw_set_priv(
ret = wl_iw_get_power_mode(dev, info, (union iwreq_data *)dwrq, extra);
#ifdef SOFTAP
else if (strnicmp(extra, "ASCII_CMD", strlen("ASCII_CMD")) == 0) {
-
+
wl_iw_process_private_ascii_cmd(dev, info, (union iwreq_data *)dwrq, extra);
}
else if (strnicmp(extra, "AP_MAC_LIST_SET", strlen("AP_MAC_LIST_SET")) == 0) {
WL_SOFTAP(("penguin, set AP_MAC_LIST_SET\n"));
set_ap_mac_list(dev, (extra + PROFILE_OFFSET));
}
-#endif
+#endif
#ifdef BCMOKC
else if (strnicmp(extra, "SET_PMK", strlen("SET_PMK")) == 0)
ret = wl_iw_set_pmk(dev, info, (union iwreq_data *)dwrq, extra);
@@ -8002,7 +7970,7 @@ wl_iw_set_priv(
ret = wl_iw_get_assoc_req_ies(dev, info, (union iwreq_data *)dwrq, extra);
else if (strnicmp(extra, "OKC_ENABLE", strlen("OKC_ENABLE")) == 0)
ret = wl_iw_okc_enable(dev, info, (union iwreq_data *)dwrq, extra);
-#endif
+#endif
else {
WL_ERROR(("Unknown PRIVATE command %s - ignored\n", extra));
snprintf(extra, MAX_WX_STRING, "OK");
@@ -8026,83 +7994,83 @@ wl_iw_set_priv(
static const iw_handler wl_iw_handler[] =
{
- (iw_handler) wl_iw_config_commit,
- (iw_handler) wl_iw_get_name,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_freq,
- (iw_handler) wl_iw_get_freq,
- (iw_handler) wl_iw_set_mode,
- (iw_handler) wl_iw_get_mode,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_get_range,
- (iw_handler) wl_iw_set_priv,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_spy,
- (iw_handler) wl_iw_get_spy,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_wap,
- (iw_handler) wl_iw_get_wap,
+ (iw_handler) wl_iw_config_commit,
+ (iw_handler) wl_iw_get_name,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) wl_iw_set_freq,
+ (iw_handler) wl_iw_get_freq,
+ (iw_handler) wl_iw_set_mode,
+ (iw_handler) wl_iw_get_mode,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) wl_iw_get_range,
+ (iw_handler) wl_iw_set_priv,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) wl_iw_set_spy,
+ (iw_handler) wl_iw_get_spy,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) wl_iw_set_wap,
+ (iw_handler) wl_iw_get_wap,
#if WIRELESS_EXT > 17
- (iw_handler) wl_iw_mlme,
+ (iw_handler) wl_iw_mlme,
#else
- (iw_handler) NULL,
+ (iw_handler) NULL,
#endif
#if defined(WL_IW_USE_ISCAN)
- (iw_handler) wl_iw_iscan_get_aplist,
+ (iw_handler) wl_iw_iscan_get_aplist,
#else
- (iw_handler) wl_iw_get_aplist,
-#endif
+ (iw_handler) wl_iw_get_aplist,
+#endif
#if WIRELESS_EXT > 13
#if defined(WL_IW_USE_ISCAN)
- (iw_handler) wl_iw_iscan_set_scan,
- (iw_handler) wl_iw_iscan_get_scan,
+ (iw_handler) wl_iw_iscan_set_scan,
+ (iw_handler) wl_iw_iscan_get_scan,
+#else
+ (iw_handler) wl_iw_set_scan,
+ (iw_handler) wl_iw_get_scan,
+#endif
#else
- (iw_handler) wl_iw_set_scan,
- (iw_handler) wl_iw_get_scan,
-#endif
-#else
- (iw_handler) NULL,
- (iw_handler) NULL,
-#endif
- (iw_handler) wl_iw_set_essid,
- (iw_handler) wl_iw_get_essid,
- (iw_handler) wl_iw_set_nick,
- (iw_handler) wl_iw_get_nick,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_rate,
- (iw_handler) wl_iw_get_rate,
- (iw_handler) wl_iw_set_rts,
- (iw_handler) wl_iw_get_rts,
- (iw_handler) wl_iw_set_frag,
- (iw_handler) wl_iw_get_frag,
- (iw_handler) wl_iw_set_txpow,
- (iw_handler) wl_iw_get_txpow,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+#endif
+ (iw_handler) wl_iw_set_essid,
+ (iw_handler) wl_iw_get_essid,
+ (iw_handler) wl_iw_set_nick,
+ (iw_handler) wl_iw_get_nick,
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) wl_iw_set_rate,
+ (iw_handler) wl_iw_get_rate,
+ (iw_handler) wl_iw_set_rts,
+ (iw_handler) wl_iw_get_rts,
+ (iw_handler) wl_iw_set_frag,
+ (iw_handler) wl_iw_get_frag,
+ (iw_handler) wl_iw_set_txpow,
+ (iw_handler) wl_iw_get_txpow,
#if WIRELESS_EXT > 10
- (iw_handler) wl_iw_set_retry,
- (iw_handler) wl_iw_get_retry,
-#endif
- (iw_handler) wl_iw_set_encode,
- (iw_handler) wl_iw_get_encode,
- (iw_handler) wl_iw_set_power,
- (iw_handler) wl_iw_get_power,
+ (iw_handler) wl_iw_set_retry,
+ (iw_handler) wl_iw_get_retry,
+#endif
+ (iw_handler) wl_iw_set_encode,
+ (iw_handler) wl_iw_get_encode,
+ (iw_handler) wl_iw_set_power,
+ (iw_handler) wl_iw_get_power,
#if WIRELESS_EXT > 17
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_wpaie,
- (iw_handler) wl_iw_get_wpaie,
- (iw_handler) wl_iw_set_wpaauth,
- (iw_handler) wl_iw_get_wpaauth,
- (iw_handler) wl_iw_set_encodeext,
- (iw_handler) wl_iw_get_encodeext,
- (iw_handler) wl_iw_set_pmksa,
-#endif
+ (iw_handler) NULL,
+ (iw_handler) NULL,
+ (iw_handler) wl_iw_set_wpaie,
+ (iw_handler) wl_iw_get_wpaie,
+ (iw_handler) wl_iw_set_wpaauth,
+ (iw_handler) wl_iw_get_wpaauth,
+ (iw_handler) wl_iw_set_encodeext,
+ (iw_handler) wl_iw_get_encodeext,
+ (iw_handler) wl_iw_set_pmksa,
+#endif
};
#if WIRELESS_EXT > 12
@@ -8121,47 +8089,47 @@ static const iw_handler wl_iw_priv_handler[] = {
(iw_handler)wl_iw_control_wl_off,
NULL,
(iw_handler)wl_iw_control_wl_on,
-#ifdef SOFTAP
+#ifdef SOFTAP
+
-
NULL,
(iw_handler)iwpriv_set_ap_config,
-
-
+
+
NULL,
(iw_handler)iwpriv_get_assoc_list,
-
+
NULL,
(iw_handler)iwpriv_set_mac_filters,
-
+
NULL,
(iw_handler)iwpriv_en_ap_bss,
-
+
NULL,
(iw_handler)iwpriv_wpasupp_loop_tst,
-
+
NULL,
(iw_handler)iwpriv_softap_stop,
-
+
NULL,
(iw_handler)iwpriv_fw_reload,
- NULL,
+ NULL,
(iw_handler)iwpriv_set_ap_sta_disassoc,
-#endif
+#endif
#if defined(CSCAN)
-
+
NULL,
(iw_handler)iwpriv_set_cscan
-#endif
+#endif
};
static const struct iw_priv_args wl_iw_priv_args[] =
{
- {
+ {
WL_IW_SET_ACTIVE_SCAN,
0,
IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING,
@@ -8205,30 +8173,30 @@ static const struct iw_priv_args wl_iw_priv_args[] =
},
#ifdef SOFTAP
-
-
+
+
{
WL_SET_AP_CFG,
- IW_PRIV_TYPE_CHAR | 256,
+ IW_PRIV_TYPE_CHAR | 256,
0,
"AP_SET_CFG"
},
{
WL_AP_STA_LIST,
- IW_PRIV_TYPE_CHAR | 0,
- IW_PRIV_TYPE_CHAR | 1024,
+ IW_PRIV_TYPE_CHAR | 0,
+ IW_PRIV_TYPE_CHAR | 1024,
"AP_GET_STA_LIST"
},
{
WL_AP_MAC_FLTR,
- IW_PRIV_TYPE_CHAR | 256,
- IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
+ IW_PRIV_TYPE_CHAR | 256,
+ IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
"AP_SET_MAC_FLTR"
},
- {
+ {
WL_AP_BSS_START,
0,
IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | MAX_WX_STRING,
@@ -8237,32 +8205,32 @@ static const struct iw_priv_args wl_iw_priv_args[] =
{
AP_LPB_CMD,
- IW_PRIV_TYPE_CHAR | 256,
- IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
+ IW_PRIV_TYPE_CHAR | 256,
+ IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
"AP_LPB_CMD"
},
- {
+ {
WL_AP_STOP,
- IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
- IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
+ IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
+ IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
"AP_BSS_STOP"
},
- {
+ {
WL_FW_RELOAD,
IW_PRIV_TYPE_CHAR | 256,
IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | 0,
"WL_FW_RELOAD"
},
-#endif
+#endif
#if defined(CSCAN)
- {
+ {
WL_COMBO_SCAN,
- IW_PRIV_TYPE_CHAR | 1024,
+ IW_PRIV_TYPE_CHAR | 1024,
0,
"CSCAN"
},
-#endif
+#endif
};
const struct iw_handler_def wl_iw_handler_def =
@@ -8276,9 +8244,9 @@ const struct iw_handler_def wl_iw_handler_def =
#if WIRELESS_EXT >= 19
get_wireless_stats: dhd_get_wireless_stats,
-#endif
+#endif
};
-#endif
+#endif
@@ -8326,7 +8294,7 @@ wl_iw_ioctl(
break;
case SIOCGIWRANGE:
-
+
max_tokens = sizeof(struct iw_range) + 500;
break;
@@ -8344,7 +8312,7 @@ wl_iw_ioctl(
#endif
max_tokens = IW_SCAN_MAX_DATA;
break;
-#endif
+#endif
case SIOCSIWSPY:
token_size = sizeof(struct sockaddr);
@@ -8359,7 +8327,7 @@ wl_iw_ioctl(
#if WIRELESS_EXT > 17
case SIOCSIWPMKSA:
case SIOCSIWGENIE:
-#endif
+#endif
case SIOCSIWPRIV:
max_tokens = wrq->u.data.length;
break;
@@ -8412,18 +8380,18 @@ wl_iw_conn_status_str(uint32 event_type, uint32 status, uint32 reason,
char* stringBuf, uint buflen)
{
typedef struct conn_fail_event_map_t {
- uint32 inEvent;
- uint32 inStatus;
- uint32 inReason;
- const char* outName;
- const char* outCause;
+ uint32 inEvent;
+ uint32 inStatus;
+ uint32 inReason;
+ const char* outName;
+ const char* outCause;
} conn_fail_event_map_t;
-
+
#define WL_IW_DONT_CARE 9999
const conn_fail_event_map_t event_map [] = {
-
-
+
+
{WLC_E_SET_SSID, WLC_E_STATUS_SUCCESS, WL_IW_DONT_CARE,
"Conn", "Success"},
{WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS, WL_IW_DONT_CARE,
@@ -8462,7 +8430,7 @@ wl_iw_conn_status_str(uint32 event_type, uint32 status, uint32 reason,
const char* cause = NULL;
int i;
-
+
for (i = 0; i < sizeof(event_map)/sizeof(event_map[0]); i++) {
const conn_fail_event_map_t* row = &event_map[i];
if (row->inEvent == event_type &&
@@ -8474,7 +8442,7 @@ wl_iw_conn_status_str(uint32 event_type, uint32 status, uint32 reason,
}
}
-
+
if (cause) {
memset(stringBuf, 0, buflen);
snprintf(stringBuf, buflen, "%s %s %02d %02d",
@@ -8501,11 +8469,11 @@ wl_iw_check_conn_fail(wl_event_msg_t *e, char* stringBuf, uint buflen)
else
return FALSE;
}
-#endif
+#endif
#ifndef IW_CUSTOM_MAX
-#define IW_CUSTOM_MAX 256
-#endif
+#define IW_CUSTOM_MAX 256
+#endif
void
wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
@@ -8519,7 +8487,8 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
uint32 datalen = ntoh32(e->datalen);
uint32 status = ntoh32(e->status);
uint32 toto;
-
+ static uint32 roam_no_success = 0;
+ static bool roam_no_success_send = FALSE;
memset(&wrqu, 0, sizeof(wrqu));
memset(extra, 0, sizeof(extra));
@@ -8530,10 +8499,9 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
net_os_wake_lock(dev);
-
WL_TRACE(("%s: dev=%s event=%d \n", __FUNCTION__, dev->name, event_type));
-
+
switch (event_type) {
#if defined(SOFTAP)
case WLC_E_PRUNE:
@@ -8543,7 +8511,7 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
macaddr[0], macaddr[1], macaddr[2], macaddr[3],
macaddr[4], macaddr[5]));
-
+
if (ap_macmode)
{
int i;
@@ -8556,7 +8524,7 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
}
if (i == ap_black_list.count) {
-
+
char mac_buf[32] = {0};
sprintf(mac_buf, "STA_BLOCK %02X:%02X:%02X:%02X:%02X:%02X",
macaddr[0], macaddr[1], macaddr[2],
@@ -8566,7 +8534,7 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
}
}
break;
-#endif
+#endif
case WLC_E_TXFAIL:
cmd = IWEVTXDROP;
memcpy(wrqu.addr.sa_data, &e->addr, ETHER_ADDR_LEN);
@@ -8582,15 +8550,30 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
wl_iw_send_priv_event(priv_dev, "STA_JOIN");
goto wl_iw_event_end;
}
-#endif
+#endif
memcpy(wrqu.addr.sa_data, &e->addr, ETHER_ADDR_LEN);
wrqu.addr.sa_family = ARPHRD_ETHER;
cmd = IWEVREGISTERED;
break;
case WLC_E_ROAM:
- if (status == WLC_E_STATUS_SUCCESS) {
- WL_ASSOC((" WLC_E_ROAM : success \n"));
- goto wl_iw_event_end;
+ if (status != WLC_E_STATUS_SUCCESS) {
+ roam_no_success++;
+ if ((roam_no_success == 3) && (roam_no_success_send == FALSE)) {
+
+ roam_no_success_send = TRUE;
+ bzero(wrqu.addr.sa_data, ETHER_ADDR_LEN);
+ bzero(&extra, ETHER_ADDR_LEN);
+ cmd = SIOCGIWAP;
+ WL_ERROR(("%s ROAMING did not succeeded , send Link Down\n",
+ __FUNCTION__));
+ } else {
+ WL_TRACE(("##### ROAMING did not succeeded %d\n", roam_no_success));
+ goto wl_iw_event_end;
+ }
+ } else {
+ memcpy(wrqu.addr.sa_data, &e->addr.octet, ETHER_ADDR_LEN);
+ wrqu.addr.sa_family = ARPHRD_ETHER;
+ cmd = SIOCGIWAP;
}
break;
case WLC_E_DEAUTH_IND:
@@ -8601,7 +8584,7 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
wl_iw_send_priv_event(priv_dev, "STA_LEAVE");
goto wl_iw_event_end;
}
-#endif
+#endif
cmd = SIOCGIWAP;
bzero(wrqu.addr.sa_data, ETHER_ADDR_LEN);
wrqu.addr.sa_family = ARPHRD_ETHER;
@@ -8611,34 +8594,34 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
case WLC_E_NDIS_LINK:
cmd = SIOCGIWAP;
if (!(flags & WLC_EVENT_MSG_LINK)) {
-
-
+
+
#ifdef SOFTAP
#ifdef AP_ONLY
if (ap_cfg_running) {
#else
if (ap_cfg_running && !strncmp(dev->name, "wl0.1", 5)) {
-#endif
-
+#endif
+
WL_SOFTAP(("AP DOWN %d\n", event_type));
wl_iw_send_priv_event(priv_dev, "AP_DOWN");
} else {
WL_TRACE(("STA_Link Down\n"));
g_ss_cache_ctrl.m_link_down = 1;
}
-#else
+#else
g_ss_cache_ctrl.m_link_down = 1;
-#endif
+#endif
WL_TRACE(("Link Down\n"));
bzero(wrqu.addr.sa_data, ETHER_ADDR_LEN);
bzero(&extra, ETHER_ADDR_LEN);
}
else {
-
+
memcpy(wrqu.addr.sa_data, &e->addr, ETHER_ADDR_LEN);
g_ss_cache_ctrl.m_link_down = 0;
-
+
memcpy(g_ss_cache_ctrl.m_active_bssid, &e->addr, ETHER_ADDR_LEN);
#ifdef SOFTAP
@@ -8647,17 +8630,20 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
#else
if (ap_cfg_running && !strncmp(dev->name, "wl0.1", 5)) {
#endif
-
+
WL_SOFTAP(("AP UP %d\n", event_type));
wl_iw_send_priv_event(priv_dev, "AP_UP");
} else {
WL_TRACE(("STA_LINK_UP\n"));
+ roam_no_success_send = FALSE;
+ roam_no_success = 0;
}
#else
-#endif
+#endif
WL_TRACE(("Link UP\n"));
}
+ net_os_wake_lock_timeout_enable(dev, DHD_EVENT_TIMEOUT_MS);
wrqu.addr.sa_family = ARPHRD_ETHER;
break;
case WLC_E_ACTION_FRAME:
@@ -8681,7 +8667,7 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
printf("WLC_E_ACTION_FRAME_COMPLETE len %d \n", wrqu.data.length);
}
break;
-#endif
+#endif
#if WIRELESS_EXT > 17
case WLC_E_MIC_ERROR: {
struct iw_michaelmicfailure *micerrevt = (struct iw_michaelmicfailure *)&extra;
@@ -8738,12 +8724,12 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
}
goto wl_iw_event_end;
}
-#endif
+#endif
case WLC_E_SCAN_COMPLETE:
#if defined(WL_IW_USE_ISCAN)
if (!g_iscan) {
-
+
WL_ERROR(("Event WLC_E_SCAN_COMPLETE on g_iscan NULL!"));
goto wl_iw_event_end;
}
@@ -8762,10 +8748,10 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
cmd = SIOCGIWSCAN;
wrqu.data.length = strlen(extra);
WL_TRACE(("Event WLC_E_SCAN_COMPLETE\n"));
-#endif
+#endif
break;
-
+
case WLC_E_PFN_NET_FOUND:
{
wl_pfn_net_info_t *netinfo;
@@ -8774,6 +8760,7 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
WL_ERROR(("%s Event WLC_E_PFN_NET_FOUND, send %s up : find %s len=%d\n",
__FUNCTION__, PNO_EVENT_UP, netinfo->pfnsubnet.SSID,
netinfo->pfnsubnet.SSID_len));
+ net_os_wake_lock_timeout_enable(dev, DHD_EVENT_TIMEOUT_MS);
cmd = IWEVCUSTOM;
memset(&wrqu, 0, sizeof(wrqu));
strcpy(extra, PNO_EVENT_UP);
@@ -8782,17 +8769,10 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
break;
default:
-
+
WL_TRACE(("Unknown Event %d: ignoring\n", event_type));
break;
}
-#ifdef DHD_BCM_WIFI_HDMI
-
- if (cmd && dhd_bcm_whdmi_enable && strncmp(dev->name,
- DHD_WHDMI_SOFTAP_IF_NAME, DHD_WHDMI_SOFTAP_IF_NAME_LEN) == 0) {
-
- } else
-#endif
if (cmd) {
if (cmd == SIOCGIWSCAN)
wireless_send_event(dev, cmd, &wrqu, NULL);
@@ -8801,20 +8781,20 @@ wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data)
}
#if WIRELESS_EXT > 14
-
+
memset(extra, 0, sizeof(extra));
if (wl_iw_check_conn_fail(e, extra, sizeof(extra))) {
cmd = IWEVCUSTOM;
wrqu.data.length = strlen(extra);
wireless_send_event(dev, cmd, &wrqu, extra);
}
-#endif
+#endif
- goto wl_iw_event_end;
+ goto wl_iw_event_end;
wl_iw_event_end:
net_os_wake_unlock(dev);
-#endif
+#endif
}
int
@@ -8852,14 +8832,14 @@ wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats)
else
wstats->qual.qual = 5;
-
+
wstats->qual.level = 0x100 + rssi;
wstats->qual.noise = 0x100 + phy_noise;
#if WIRELESS_EXT > 18
wstats->qual.updated |= (IW_QUAL_ALL_UPDATED | IW_QUAL_DBM);
#else
wstats->qual.updated |= 7;
-#endif
+#endif
#if WIRELESS_EXT > 11
WL_TRACE(("wl_iw_get_wireless_stats counters=%d\n", (int)sizeof(wl_cnt_t)));
@@ -8896,7 +8876,7 @@ wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats)
WL_TRACE(("wl_iw_get_wireless_stats counters rxrunt=%d\n", dtoh32(cnt.rxrunt)));
WL_TRACE(("wl_iw_get_wireless_stats counters rxgiant=%d\n", dtoh32(cnt.rxgiant)));
-#endif
+#endif
done:
return res;
@@ -8918,7 +8898,7 @@ wl_iw_bt_flag_set(
#if defined(BT_DHCP_eSCO_FIX)
-
+
set_btc_esco_params(dev, set);
#endif
@@ -8926,12 +8906,12 @@ wl_iw_bt_flag_set(
#if defined(BT_DHCP_USE_FLAGS)
WL_TRACE_COEX(("WI-FI priority boost via bt flags, set:%d\n", set));
if (set == TRUE) {
-
+
dev_wlc_bufvar_set(dev, "btc_flags",
(char *)&buf_flag7_dhcp_on[0], sizeof(buf_flag7_dhcp_on));
}
else {
-
+
dev_wlc_bufvar_set(dev, "btc_flags",
(char *)&buf_flag7_default[0], sizeof(buf_flag7_default));
}
@@ -8948,7 +8928,7 @@ wl_iw_bt_timerfunc(ulong data)
bt_info_t *bt_local = (bt_info_t *)data;
bt_local->timer_on = 0;
WL_TRACE(("%s\n", __FUNCTION__));
-
+
up(&bt_local->tsk_ctl.sema);
}
@@ -8975,7 +8955,7 @@ _bt_dhcp_sysioc_thread(void *data)
switch (g_bt->bt_state) {
case BT_DHCP_START:
-
+
WL_TRACE_COEX(("%s bt_dhcp stm: started \n", __FUNCTION__));
g_bt->bt_state = BT_DHCP_OPPORTUNITY_WINDOW;
mod_timer(&g_bt->timer,
@@ -8990,10 +8970,10 @@ _bt_dhcp_sysioc_thread(void *data)
goto btc_coex_idle;
}
-
+
WL_TRACE_COEX(("%s DHCP T1:%d expired\n",
__FUNCTION__, BT_DHCP_OPPORTUNITY_WINDOW_TIME));
-
+
if (g_bt->dev) wl_iw_bt_flag_set(g_bt->dev, TRUE);
g_bt->bt_state = BT_DHCP_FLAG_FORCE_TIMEOUT;
mod_timer(&g_bt->timer, jiffies + BT_DHCP_FLAG_FORCE_TIME*HZ/1000);
@@ -9005,12 +8985,12 @@ _bt_dhcp_sysioc_thread(void *data)
WL_TRACE_COEX(("%s DHCP Done before T2 expiration\n",
__FUNCTION__));
} else {
-
+
WL_TRACE_COEX(("%s DHCP wait interval T2:%d msec expired\n",
__FUNCTION__, BT_DHCP_FLAG_FORCE_TIME));
}
-
+
if (g_bt->dev) wl_iw_bt_flag_set(g_bt->dev, FALSE);
btc_coex_idle:
g_bt->bt_state = BT_DHCP_IDLE;
@@ -9067,7 +9047,7 @@ wl_iw_bt_init(struct net_device *dev)
bt_dhcp->dev = dev;
bt_dhcp->bt_state = BT_DHCP_IDLE;
-
+
bt_dhcp->timer_ms = 10;
init_timer(&bt_dhcp->timer);
bt_dhcp->timer.data = (ulong)bt_dhcp;
@@ -9083,14 +9063,183 @@ wl_iw_bt_init(struct net_device *dev)
return 0;
}
-#endif
+#endif
+
+#define wchg_trace printk("%s_%d\n", __func__, __LINE__);
+
+
+
+#ifdef WL_PROTECT
+static void
+wl_iw_sta_restart(struct net_device *dev)
+{
+ wl_iw_t *iw;
+
+ WL_TRACE(("Enter %s\n", __FUNCTION__));
+ wchg_trace
+
+ if (!dev) {
+ WL_ERROR(("%s: dev is null\n", __FUNCTION__));
+ return;
+ }
+ wchg_trace
+
+ iw = *(wl_iw_t **)netdev_priv(dev);
+ wchg_trace
+
+ if (!iw) {
+ WL_ERROR(("%s: wl is null\n", __FUNCTION__));
+ return;
+ }
+ wchg_trace
+
+ dhd_os_start_lock(iw->pub);
+
+wchg_trace
+
+
+#if defined(WL_IW_USE_ISCAN)
+ g_iscan->iscan_state = ISCAN_STATE_IDLE;
+#endif
+ wchg_trace
+
+
+ dhd_dev_reset(dev, 1);
+
+
+wchg_trace
+
+#if defined(BCMLXSDMMC)
+ sdioh_stop(NULL);
+#endif
+ wchg_trace
+
+ dhd_customer_gpio_wlan_ctrl(WLAN_RESET_OFF);
+ wchg_trace
+
+ bcm_mdelay(100);
+ wchg_trace
+ dhd_customer_gpio_wlan_ctrl(WLAN_RESET_ON);
+
+wchg_trace
+
+#if defined(BCMLXSDMMC)
+ sdioh_start(NULL, 0);
+#endif
+ wchg_trace
+
+ dhd_dev_reset(dev, 0);
+wchg_trace
+
+#if defined(BCMLXSDMMC)
+ sdioh_start(NULL, 1);
+#endif
+ wchg_trace
+
+ atomic_set(&g_fw_err_flag , WIFI_FIRMWARE_RECOVER); //chip restart end,reset the flag
+ wchg_trace
+
+ dhd_dev_init_ioctl(dev);
+ wchg_trace
+
+ bcm_mdelay(300);
+
+ dhd_os_start_unlock(iw->pub);
+ return;
+}
+
+static int
+_wl_protect_sysioc_thread(void *data)
+{
+ wl_iw_t *iw;
+
+ DAEMONIZE("wlp_sysioc");
+
+ if (!priv_dev) {
+ WL_ERROR(("%s: priv_dev is null\n", __FUNCTION__));
+ goto end;
+ }
+
+ iw = *(wl_iw_t **)netdev_priv(priv_dev);
+
+ if (!iw) {
+ WL_ERROR(("%s: wl is null\n", __FUNCTION__));
+ goto end;
+ }
+
+ while (down_interruptible(&g_wl_protect->wlp_sem) == 0) {
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
+ rtnl_lock();
+#endif
+ atomic_set(&g_fw_reload_over_flag, WIFI_FIRMWARE_ERROR);
+ WL_ERROR(("%s: FW RELOAD\n", __FUNCTION__));
+ wl_iw_sta_restart(priv_dev);
+ WL_ERROR(("FW RELOAD end\n"));
+ atomic_set(&g_fw_reload_over_flag, WIFI_FIRMWARE_RECOVER);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
+ rtnl_unlock();
+#endif
+ }
+
+end:
+ WL_ERROR(("%s: exit\n", __FUNCTION__));
+ complete_and_exit(&g_wl_protect->wlp_exited, 0);
+ return 0;
+}
+
+static int
+wl_iw_protect_init(void)
+{
+ wlp_info_t *wl_protect = NULL;
+
+ wl_protect = kmalloc(sizeof(wlp_info_t), GFP_KERNEL);
+ if (!wl_protect)
+ return -ENOMEM;
+
+ memset(wl_protect, 0, sizeof(wlp_info_t));
+ wl_protect->wlp_pid = -1;
+ g_wl_protect = wl_protect;
+
+ sema_init(&wl_protect->wlp_sem, 0);
+ init_completion(&wl_protect->wlp_exited);
+ WL_ERROR(("create wifi protect thread\n"));
+ wl_protect->wlp_pid = kernel_thread(_wl_protect_sysioc_thread, wl_protect, 0);
+ if (wl_protect->wlp_pid < 0) {
+ WL_ERROR(("Failed in %s\n", __FUNCTION__));
+ return -ENOMEM;
+ }
+
+ return 0;
+}
+
+static void
+wl_iw_protect_release(void)
+{
+ wlp_info_t *local = g_wl_protect;
+
+ if (!local) {
+ return;
+ }
+
+ if (local->wlp_pid >= 0) {
+ WL_ERROR(("kill thread _wl_protect_sysioc_thread\n"));
+ KILL_PROC(local->wlp_pid, SIGTERM);
+ wait_for_completion(&local->wlp_exited);
+ }
+ kfree(local);
+ g_wl_protect = NULL;
+}
+
+#endif //WL_PROTECT
int
wl_iw_attach(struct net_device *dev, void * dhdp)
{
#if defined(WL_IW_USE_ISCAN)
int params_size = 0;
-#endif
+#endif
wl_iw_t *iw;
#if defined(WL_IW_USE_ISCAN)
iscan_info_t *iscan = NULL;
@@ -9103,22 +9252,22 @@ wl_iw_attach(struct net_device *dev, void * dhdp)
if (!dev)
return 0;
-
+
memset(&g_wl_iw_params, 0, sizeof(wl_iw_extra_params_t));
-
+
#ifdef CSCAN
params_size = (WL_SCAN_PARAMS_FIXED_SIZE + OFFSETOF(wl_iscan_params_t, params)) +
(WL_NUMCHANNELS * sizeof(uint16)) + WL_SCAN_PARAMS_SSID_MAX * sizeof(wlc_ssid_t);
#else
params_size = (WL_SCAN_PARAMS_FIXED_SIZE + OFFSETOF(wl_iscan_params_t, params));
-#endif
+#endif
iscan = kmalloc(sizeof(iscan_info_t), GFP_KERNEL);
if (!iscan)
return -ENOMEM;
memset(iscan, 0, sizeof(iscan_info_t));
-
+
iscan->iscan_ex_params_p = (wl_iscan_params_t*)kmalloc(params_size, GFP_KERNEL);
if (!iscan->iscan_ex_params_p) {
kfree(iscan);
@@ -9126,7 +9275,7 @@ wl_iw_attach(struct net_device *dev, void * dhdp)
}
iscan->iscan_ex_param_size = params_size;
-
+
g_iscan = iscan;
iscan->dev = dev;
iscan->iscan_state = ISCAN_STATE_IDLE;
@@ -9135,13 +9284,13 @@ wl_iw_attach(struct net_device *dev, void * dhdp)
g_first_broadcast_scan = BROADCAST_SCAN_FIRST_IDLE;
g_first_counter_scans = 0;
g_iscan->scan_flag = 0;
-#endif
+#endif
#ifdef CONFIG_WPS2
g_wps_probe_req_ie = NULL;
g_wps_probe_req_ie_len = 0;
-#endif
-
+#endif
+
iscan->timer_ms = 8000;
init_timer(&iscan->timer);
iscan->timer.data = (ulong)iscan;
@@ -9150,16 +9299,16 @@ wl_iw_attach(struct net_device *dev, void * dhdp)
PROC_START(_iscan_sysioc_thread, iscan, &iscan->tsk_ctl, 0);
if (iscan->tsk_ctl.thr_pid < 0)
return -ENOMEM;
-#endif
+#endif
iw = *(wl_iw_t **)netdev_priv(dev);
iw->pub = (dhd_pub_t *)dhdp;
#ifdef SOFTAP
priv_dev = dev;
-#endif
+#endif
g_scan = NULL;
-
+
g_scan = (void *)kmalloc(G_SCAN_RESULTS, GFP_KERNEL);
if (!g_scan)
return -ENOMEM;
@@ -9168,14 +9317,17 @@ wl_iw_attach(struct net_device *dev, void * dhdp)
g_scan_specified_ssid = 0;
#if !defined(CSCAN)
-
+
wl_iw_init_ss_cache_ctrl();
-#endif
+#endif
#ifdef COEX_DHCP
-
+
wl_iw_bt_init(dev);
-#endif
+#endif
+#ifdef WL_PROTECT
+ wl_iw_protect_init();
+#endif
return 0;
}
@@ -9202,7 +9354,7 @@ wl_iw_detach(void)
kfree(iscan);
g_iscan = NULL;
DHD_OS_MUTEX_UNLOCK(&wl_cache_lock);
-#endif
+#endif
if (g_scan)
kfree(g_scan);
@@ -9215,18 +9367,21 @@ wl_iw_detach(void)
g_wps_probe_req_ie = NULL;
g_wps_probe_req_ie_len = 0;
}
-#endif
+#endif
#if !defined(CSCAN)
wl_iw_release_ss_cache_ctrl();
-#endif
+#endif
#ifdef COEX_DHCP
wl_iw_bt_release();
-#endif
+#endif
+#ifdef WL_PROTECT
+ wl_iw_protect_release();
+#endif
#ifdef SOFTAP
if (ap_cfg_running) {
WL_TRACE(("\n%s AP is going down\n", __FUNCTION__));
-
+
wl_iw_send_priv_event(priv_dev, "AP_DOWN");
}
#endif
diff --git a/drivers/net/wireless/bcmdhd/wl_iw.h b/drivers/net/wireless/bcmdhd/wl_iw.h
index 0d5ac85cec7a..81d05833814f 100755
--- a/drivers/net/wireless/bcmdhd/wl_iw.h
+++ b/drivers/net/wireless/bcmdhd/wl_iw.h
@@ -47,8 +47,7 @@
#define BAND_SET_CMD "SETBAND"
#define DTIM_SKIP_GET_CMD "DTIMSKIPGET"
#define DTIM_SKIP_SET_CMD "DTIMSKIPSET"
-#define SETSUSPENDOPT_CMD "SETSUSPENDOPT"
-#define SETSUSPENDMODE_CMD "SETSUSPENDMODE"
+#define SETSUSPEND_CMD "SETSUSPENDOPT"
#define PNOSSIDCLR_SET_CMD "PNOSSIDCLR"
#define PNOSETUP_SET_CMD "PNOSETUP "
@@ -211,10 +210,11 @@ void wl_iw_detach(void);
extern int net_os_wake_lock(struct net_device *dev);
extern int net_os_wake_unlock(struct net_device *dev);
extern int net_os_wake_lock_timeout(struct net_device *dev);
-extern int net_os_wake_lock_ctrl_timeout_enable(struct net_device *dev, int val);
+extern int net_os_wake_lock_timeout_enable(struct net_device *dev, int val);
extern int net_os_set_suspend_disable(struct net_device *dev, int val);
-extern int net_os_set_suspend(struct net_device *dev, int val, int force);
+extern int net_os_set_suspend(struct net_device *dev, int val);
extern int net_os_set_dtim_skip(struct net_device *dev, int val);
+extern int net_os_send_hang_message(struct net_device *dev);
extern void get_customized_country_code(char *country_iso_code, wl_country_t *cspec);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
diff --git a/drivers/net/wireless/bcmdhd/wldev_common.c b/drivers/net/wireless/bcmdhd/wldev_common.c
index 906a50503aca..22fcaa796a15 100755
--- a/drivers/net/wireless/bcmdhd/wldev_common.c
+++ b/drivers/net/wireless/bcmdhd/wldev_common.c
@@ -367,53 +367,3 @@ int wldev_set_country(
__FUNCTION__, country_code, cspec.ccode, cspec.rev));
return 0;
}
-
-/*
- * softap channel autoselect
- */
-int wldev_get_auto_channel(struct net_device *dev, int *chan)
-{
- int chosen = 0;
- wl_uint32_list_t request;
- int retry = 0;
- int updown = 0;
- int ret = 0;
- wlc_ssid_t null_ssid;
-
- memset(&null_ssid, 0, sizeof(wlc_ssid_t));
- ret |= wldev_ioctl(dev, WLC_UP, &updown, sizeof(updown), true);
-
- ret |= wldev_ioctl(dev, WLC_SET_SSID, &null_ssid, sizeof(null_ssid), true);
-
- request.count = htod32(0);
- ret = wldev_ioctl(dev, WLC_START_CHANNEL_SEL, &request, sizeof(request), true);
- if (ret < 0) {
- WLDEV_ERROR(("can't start auto channel scan:%d\n", ret));
- goto fail;
- }
-
- while (retry++ < 15) {
-
- bcm_mdelay(350);
-
- ret = wldev_ioctl(dev, WLC_GET_CHANNEL_SEL, &chosen, sizeof(chosen), false);
-
- if ((ret == 0) && (dtoh32(chosen) != 0)) {
- *chan = (uint16)chosen & 0x00FF; /* covert chanspec --> chan number */
- printf("%s: Got channel = %d, attempt:%d\n",
- __FUNCTION__, *chan, retry);
- break;
- }
- }
-
- if ((ret = wldev_ioctl(dev, WLC_DOWN, &updown, sizeof(updown), true)) < 0) {
- WLDEV_ERROR(("%s fail to WLC_DOWN ioctl err =%d\n", __FUNCTION__, ret));
- goto fail;
- }
-
-fail :
- if (ret < 0) {
- WLDEV_ERROR(("%s: return value %d\n", __FUNCTION__, ret));
- }
- return ret;
-}
diff --git a/drivers/net/wireless/bcmdhd/wldev_common.h b/drivers/net/wireless/bcmdhd/wldev_common.h
index f58660944420..6a1ba1533600 100755
--- a/drivers/net/wireless/bcmdhd/wldev_common.h
+++ b/drivers/net/wireless/bcmdhd/wldev_common.h
@@ -92,7 +92,7 @@ extern int net_os_wake_lock_timeout(struct net_device *dev);
extern int net_os_wake_lock_timeout_enable(struct net_device *dev, int val);
extern int net_os_set_dtim_skip(struct net_device *dev, int val);
extern int net_os_set_suspend_disable(struct net_device *dev, int val);
-extern int net_os_set_suspend(struct net_device *dev, int val, int force);
+extern int net_os_set_suspend(struct net_device *dev, int val);
extern int wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid,
int max, int *bytes_left);
@@ -107,6 +107,4 @@ int wldev_get_band(struct net_device *dev, uint *pband);
int wldev_set_band(struct net_device *dev, uint band);
-int wldev_get_auto_channel(struct net_device *dev, int *chan);
-
#endif /* __WLDEV_COMMON_H__ */