When system suspend, pcie bus write BRCMF_H2D_HOST_D3_INFORM cmd
into tcm32 mem to let host enter D3 mode, and wait the D3 ACK
interrupt. But sometime, the interrupt is comming lately then
cause wait event timeout, so double check the D3 ACK state.
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Acked-by: Richard Zhu <hongxing.zhu@nxp.com>
Not all firmware set channel/ulp_sdioctrl, so change the error message
to debug level for reading chanspec/ulp_sdioctrl iovar data.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Only set wowlan parameters when the interface's BRCMF_FEAT_WOWL
flag is set.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Move the func->num check early in .brcmf_ops_sdio_suspend() to
save suspend time.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Moving the brcmf_bus_preinit() call allows the bus code to do some
required initialization before handling firmware control messages.
.brcmf_bus_preinit() already is called in .brcmf_bus_started() when
bus is ready. So remove it from .brcmf_c_preinit_dcmds().
Fixes: 383c26d2ea2f(MLK-18675-20 brcmfmac: Support wake on ping packet)
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
func0 is not provided by the mmc stack as a function when probing.
commit 99d7b6fdfc8c(brcmfmac: Remove func0 from function array)
already remove the func0.
But commit c37fa19e0128(brcmfmac: Remove array of functions) add
fun0 again. That cause NULL pointer issue.
Fixes: c37fa19e0128(brcmfmac: Remove array of functions)
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
commit 861cb5eb46 ("brcmfmac: Fix access point mode") upstream.
Since commit 1204aa17f3 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")
the Raspberry Pi 3 A+ (BCM43455) isn't able to operate in AP mode with
hostapd (device_ap_sme=1 use_monitor=0):
brcmfmac: brcmf_cfg80211_stop_ap: setting AP mode failed -52
So add the missing mgmt_stypes for AP mode to fix this.
Fixes: 1204aa17f3 ("brcmfmac: set WIPHY_FLAG_HAVE_AP_SME flag")
Suggested-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
With asynchronous suspend/resume feature, suspend and resume callbacks to
be executed in parallel with each other. It makes bus changes the state to
BRCMF_BUS_DOWN before all brcmf_cfg80211_suspend IOVAR executions.
The same situation also happens in resume procedure and causes PM mode
keeps in PM_MAX after resume. In order to fix the race condition, We add
one second sleep in bus suspend and cfg80211 resume function.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit fdb676ce002039d7359b200b6c2cc728f41c05fa)
We got ifp null pointer kernel panic in brcmf_txfinalize after removing
Wi-Fi USB dongle when data was transmitting, The root cause is that
interface was removed before calling brcmf_txfinalize in
brcmf_fws_dequeue_worker and finally caused kernel panic.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 3f94bfe6febc9762e340a69b6520242f27d20c85)
To trunkcate the addtional bytes, if extra bytes are received.
Current code only have a warning and proceed without handling it.
But in one crash dump reported by DVT, these causes the
crash intermittently. So the processing is limit to the skb->len.
Signed-off-by: Raveendran Somu <raveendran.somu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit f7112c027e0c7447b05474b72934589bbbb8e298)
Add brcmfmac platform device pinctrl state support. That is useful
for dynamically configurate pin group for different wlan chips.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 88f2834cd5b8cb8864af68d265b5bdee3000c4bf)
- The current timeout value is not enough for MB transaction read
when modem enter D3 mode, so increase the timeout value to match
the D3 mode timing requirement.
- Add 10 ms delay for pcie device to exit D3 state and enter D0 state.
- Remove the duplicated code for SBMBX register access.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 05601af462145e27142e3d140e10a66d4a493d40)
There are two D11 cores in RSDB chips like 4359. We have to reset two
D11 cores simutaneously before firmware download, or the firmware may
not be initialized correctly and cause "fw initialized failed" error.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked commit from 8f50bea9357af3088dba0103f0017d56763b0ae9)
Not all chips support wowlan, then get wowlan wakeup event failed.
Change the log into debug level.
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 47b205952ca6be6216e19a121f1fb400c5fcf7e7)
Check the return value of .brcmf_fil_iovar_data_get() to fix
the coverity issue of "error handling issue".
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
Init the wlfc_mode variable before it is used to fix
coverity issue of "Uninitialized variable".
Reviewed-by: Haibo Chen <haibo.chen@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
In WLAN, priority among various access categories of traffic is
always set by the AP using WMM parameters and this may not always
follow the standard 802.1d priority.
In this change, priority is adjusted based on the AP WMM params
received as part of the Assoc Response and the same is later used
to map the priority of all incoming traffic.
This change should fix the following 802.11n certification tests:
* 5.2.31 ACM Bit Conformance test
* 5.2.32 AC Parameter Modification test
Signed-off-by: Saravanan Shanmugham <sasm@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:62657fc5931db1c1d48c3181f2f4effebf37a74b)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Will enable FMAC to push more packets to bus tx queue and help
improve throughput when fws queuing is enabled. This change is
required to tune the throughput for passing WMM CERT tests.
Signed-off-by: Madhan Mohan R <MadhanMohan.R@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:48195bf1b7dea8c6030dfce45900dda60f2d0ea4)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
P2p spec mentioned that the p2p device address should be the globally
administered address with locally administered bit set. Therefore,
follow this guideline by default.
When the primary interface is set to a locally administered address, the
locally administered bit cannot be set again. Generate a random locally
administered address for this case.
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:930ac6e9230a48a775e55ee6cb31c4dffe5d5dcc)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
The variable "wq_flags" is not used anymore. Remove it.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit:453591909a747bede4ff3fabe1d4073370f920f4)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
With setting sdio_wq_highpri=1 in module parameters, tasks submitted to
SDIO workqueue will put at the head of the queue and run immediately.
This parameter is for getting higher TX/RX throughput with SDIO bus.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(cherry picked from commit: 7c2b310299f051be555c6928f0f858fdbac35abb)
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Set wowl configuration in disconnect state is redundant.
Remove it to fix no scan result issue after resume.
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
FMAC driver need to provide a dummy wowlan filter for kernel and
provided the well configured wowlan stack. So the system will
keep driver in connected state in suspend mode and can be wake
up by ping packet.
Enable unicast packet filter before system suspend and
disable it after resume.
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
When eap_restrict is enabled, firmware will toss non-802.1x frames from
tx/rx data path if station not yet authorized.
Internal firmware eap_restrict is disabled by default. This patch makes
it possible to enable firmware eap_restrict by specifying
eap_restrict=1 as module parameter.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
To enhance RX throughput, we add a module parameter "sdio_dpc_prio" to let
user can set scheduling priority for sdio_dpc. It can improve RX
throughput by reducing the receiving time in sdio_dpc.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Don't print ulp_sdioctrl get error as errors are expected for non ulp
cases.
Signed-off-by: Naveen Gupta <nagu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Hostap daemon has a parameter "ap_isolate which is used to prevent
low-level bridging of frames between associated stations in the BSS.
For driver side, we add cfg80211 ops method change_bss to support
setting AP isolation from user space.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
The device 43428 is a new SDIO device ID but shares the same WLAN core
with device 43430a1. It is a 1x1 802.11b/g/n 2.4GHz HT20,
256-QAM/Turbo QAM WLAN chip.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
This patch fix the below compilation errors.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_ulp_pre_redownload_check’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2631:10: error: implicit declaration of function ‘brcmf_sdiod_regrb’; did you mean ‘brcmf_sdiod_readb’? [-Werror=implicit-function-declaration]
value = brcmf_sdiod_regrb(bus->sdiodev, SDIO_CCCR_IOEx, &err);
^~~~~~~~~~~~~~~~~
brcmf_sdiod_readb
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:42:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:437:2: error: implicit declaration of function ‘brcmf_sdiod_regrl’; did you mean ‘brcmf_sdiod_readl’? [-Werror=implicit-function-declaration]
brcmf_sdiod_regrl(sdh, D11SHM_ADDR(offset), ret)
^~~~~~~~~~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2636:18: note: in expansion of macro ‘D11SHM_RD’
ulp_wake_ind = D11SHM_RD(bus->sdiodev, M_ULP_WAKE_IND(
^~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:434:2: error: implicit declaration of function ‘brcmf_sdiod_regwl’; did you mean ‘brcmf_sdiod_readl’? [-Werror=implicit-function-declaration]
brcmf_sdiod_regwl(sdh, D11SHM_ADDR(offset), val, ret)
^~~~~~~~~~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2654:4: note: in expansion of macro ‘D11SHM_WR’
D11SHM_WR(bus->sdiodev, M_DS1_CTRL_SDIO(
^~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_firmware_callback’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:4388:9: error: implicit declaration of function ‘brcmf_bus_started’; did you mean ‘brcmf_bus_txctl’? [-Werror=implicit-function-declaration]
err = brcmf_bus_started(dev);
^~~~~~~~~~~~~~~~~
brcmf_bus_txctl
cc1: some warnings being treated as errors
scripts/Makefile.build:303: recipe for target 'drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o' failed
make[6]: *** [drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.o] Error 1
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
As per 'commit d09ae51a4b ("brcmfmac: pass struct in
brcmf_fw_get_firmwares()")', make changes in the brcmf_fw_get_firmwares()
call to fix the compilation error.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function ‘brcmf_sdio_ulp_reinit_fw’:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2597:45: error: ‘BRCMF_FW_REQUEST_NVRAM’ undeclared (first use in this function); did you mean ‘BRCMF_FW_TYPE_NVRAM’?
err = brcmf_fw_get_firmwares(sdiodev->dev, BRCMF_FW_REQUEST_NVRAM,
^~~~~~~~~~~~~~~~~~~~~~
BRCMF_FW_TYPE_NVRAM
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2597:45: note: each undeclared identifier is reported only once for each function it appears in
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2598:17: error: passing argument 3 of ‘brcmf_fw_get_firmwares’ from incompatible pointer type [-Werror=incompatible-pointer-types]
sdiodev->fw_name, sdiodev->nvram_name,
~~~~~~~^~~~~~~~~
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:22,
from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:42:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h:93:14: note: expected ‘void (*)(struct device *, int, struct brcmf_fw_request *)’ but argument is of type ‘char *’
void (*fw_cb)(struct device *dev, int err,
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
struct brcmf_fw_request *req));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:2597:8: error: too many arguments to function ‘brcmf_fw_get_firmwares’
err = brcmf_fw_get_firmwares(sdiodev->dev, BRCMF_FW_REQUEST_NVRAM,
^~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h:22,
from drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:42:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h:92:5: note: declared here
int brcmf_fw_get_firmwares(struct device *dev, struct brcmf_fw_request *req,
^~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
In Deep Sleep mode ARM is off and once Exit trigger comes than
Mail Box Interrupt comes to Host and whole Re Initiation should be done
in the ARM to start TX/RX.
Signed-off-by: Naveen Gupta <nagu@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Vipul: Fixed merge conflicts
Conflict:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Linux 3.6 introduces TSQ which has a per socket threshold for TCP Tx
packet to reduce latency. In fcmode 1/2, host driver enqueues skb in
hanger and TCP doesn't push new skb frees until host frees the skb when
receiving fwstatus event. So using skb_orphan before sending skb to bus
will make the skb removing the ownership of socket. With this patch, we
got better throughput in fcmode 1/2.
Tested 43455 TCP throughput in 20 MHz bandwidth with/without this patch.
fcmode 0: 59.5 / 59.6 (Mbps)
fcmode 1: 59.3 / 23.4 (Mbps)
fcmode 2: 59.6 / 21.5 (Mbps)
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
APSTA can work on two band concurrently with using VSDB(Virtual
Simultaneous Dual-Band) or RSDB(Real Simultaneous Dual-Band) features.
In this case, we have to keep apsta is 1 in firmware side. However, if
we start wpa_supplicant on wlan0 and then start hostapd on wlan 1, the
apsta will be set to 0, and we will see data stall on wlan0(station)
So that, we only set apsta to 1 when AP start on primary interface.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Firmware returns proprietary error code when getting error in
fil_cmd_data_set or fil_cmd_data_get. Sometimes the vendor tool or
utilities which uses libnl may stuck in some commands when wl is down.
For example, issue "scan" command after issuing "down" command, the
"scan" command will be the blocking call and stuck as no response from
firmware. It is caused by that firmware returns BCME_NOTUP(-4) when wl
is down, but in Linux the -4 is -EINTR, so libnl catches the error and
not pass to upper layer.
Because of that, the driver should return Linux error code instead of the
proprietary error code, and the tools or utilities need to get the real
firmware error code by another command "bcmerrorstr" after receiving
the error.
Signed-off-by: Wright Feng <wright.feng@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
broken_sg_support, sd_head_align, and sd_sgentry_align are used in
brcmfmac code but not configurable in dts file. Add the parsing logic.
Now they can be configured like below in dts:
brcm,broken_sg_support;
brcm,sd_head_align = /bits/ 16 <4>;
brcm,sd_sgentry_align = /bits/ 16 <4>;
Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Pulling the following commits and some general changes from custom
v3.10 kernel for supporting qcacld2.0 on kernel v4.9.11.
1. cfg80211: Using new wiphy flag WIPHY_FLAG_DFS_OFFLOAD
When flag WIPHY_FLAG_DFS_OFFLOAD is defined, the driver would handle
all the DFS related operations. Therefore the kernel needs to ignore
the DFS state that it uses to block the userspace calls to the driver
through cfg80211 APIs. Also it should treat the userspace calls to
start radar detection as a no-op.
Please note that changes in util.c is not picked up explicitly.
Kernel v4.9.11 uses wrapper cfg80211_get_chans_dfs_required which takes
care of this change.
Change-Id: I9dd2076945581ca67e54dfc96dd3dbc526c6f0a2
IRs-Fixed: 202686
2. New db.txt from git/sforshee/wireless-regdb.git
CONFIG_CFG80211_INTERNAL_REGDB is enabled in build. This causes
kernel warn messages as db.txt is empty. A new db.txt is added
from:
git://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git
IRs-Fixed: 202686
3. Picked up the declaration and definition of the function
cfg80211_is_gratuitous_arp_unsolicited_na
Change-Id: I1e4083a2327c121073226aa6b75bb6b5b97cec00
CRs-fixed: 1079453
Signed-off-by: Nakul Kachhwaha <nkachh@codeaurora.org>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
(Vipul: Fixed merge conflicts)
(TODO: checkpatch warnings)
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Pull cramfs fix from Al Viro:
"Regression fix, fallen through the cracks"
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
cramfs: fix usage on non-MTD device