summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-01-26rtw88: use shorter delay time to poll PS stateYan-Hsuan Chuang
When TX packet arrives, driver should leave deep PS state to make sure the DMA is working. After requested to leave deep PS state, driver needs to poll the PS state to check if the mode has been changed successfully. The driver used to check the state of the hardware every 20 msecs, which means upon the first failure of state check, the CPU is delayed 20 msecs for next check. This is harmful for some time-sensitive applications such as media players. So, use shorter delay time each check from 20 msecs to 100 usecs. The state should be changed in several tries. But we still need to reserve ~15 msecs in total in case of the state just took too long to be changed successfully. If the states of driver and the hardware is not synchronized, the power state could be locked forever, which mean we could never enter/leave the PS state. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Reviewed-by: Chris Chiu <chiu@endlessm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: fix potential NULL skb access in TX ISRYan-Hsuan Chuang
Sometimes the TX queue may be empty and we could possible dequeue a NULL pointer, crash the kernel. If the skb is NULL then there is nothing to do, just leave the ISR. And the TX queue should not be empty here, so print an error to see if there is anything wrong for DMA ring. Fixes: e3037485c68e ("rtw88: new Realtek 802.11ac driver") Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26brcmfmac: add initial support for monitor modeRafał Miłecki
Report monitor interface availability using cfg80211 and support it in the add_virtual_intf() and del_virtual_intf() callbacks. This new feature is conditional and depends on firmware flagging monitor packets. Receiving monitor frames is already handled by the brcmf_netif_mon_rx(). Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26brcmfmac: simplify building interface combinationsRafał Miłecki
Move similar/duplicated code out of combination specific code blocks. This simplifies code a bit and allows adding more combinations later. A list of combinations remains unchanged. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26brcmfmac: sdio: Fix OOB interrupt initialization on brcm43362Jean-Philippe Brucker
Commit 262f2b53f679 ("brcmfmac: call brcmf_attach() just before calling brcmf_bus_started()") changed the initialization order of the brcmfmac SDIO driver. Unfortunately since brcmf_sdiod_intr_register() is now called before the sdiodev->bus_if initialization, it reads the wrong chip ID and fails to initialize the GPIO on brcm43362. Thus the chip cannot send interrupts and fails to probe: [ 12.517023] brcmfmac: brcmf_sdio_bus_rxctl: resumed on timeout [ 12.531214] ieee80211 phy0: brcmf_bus_started: failed: -110 [ 12.536976] ieee80211 phy0: brcmf_attach: dongle is not responding: err=-110 [ 12.566467] brcmfmac: brcmf_sdio_firmware_callback: brcmf_attach failed Initialize the bus interface earlier to ensure that brcmf_sdiod_intr_register() properly sets up the OOB interrupt. BugLink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908438 Fixes: 262f2b53f679 ("brcmfmac: call brcmf_attach() just before calling brcmf_bus_started()") Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26brcmfmac: use true,false for bool variablezhengbin
Fixes coccicheck warning: drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c:911:2-24: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26cw1200: use true,false for bool variablezhengbin
Fixes coccicheck warning: drivers/net/wireless/st/cw1200/txrx.c:718:6-16: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: use true,false for bool variablezhengbin
Fixes coccicheck warning: drivers/net/wireless/realtek/rtw88/phy.c:1437:1-24: WARNING: Assignment of 0/1 to bool variable Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: zhengbin <zhengbin13@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8821ae: Make functions static & rm sw.hAmadeusz Sławiński
Some of functions which were exposed in sw.h, are only used in sw.c, so just make them static. This makes sw.h unnecessary, so remove it. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8723be: Make functions static & rm sw.hAmadeusz Sławiński
Some of functions which were exposed in sw.h, are only used in sw.c, so just make them static. This makes sw.h unnecessary, so remove it. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8723ae: Make functions static & rm sw.hAmadeusz Sławiński
Some of functions which were exposed in sw.h, are only used in sw.c, so just make them static. This makes sw.h unnecessary, so remove it. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8192se: Remove sw.h headerAmadeusz Sławiński
It has one define, which is already defined in include from reg.h. All the declared functions are not implemented anywhere, sw.c has ones with similar names which are already static. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8192ee: Make functions static & rm sw.hAmadeusz Sławiński
Some of functions which were exposed in sw.h, are only used in sw.c, so just make them static. This makes sw.h unnecessary, so remove it. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8192cu: Remove sw.h headerAmadeusz Sławiński
It has one define, which is already defined in include from reg.h. All functions are declared in their own headers and included in *.c files belonging to them. This makes sw.h unnecessary, so we can remove it. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8192ce: Make functions static & rm sw.hAmadeusz Sławiński
Some of functions which were exposed in sw.h, are only used in sw.c, so just make them static. The rtl92c_init_var_map function is not defined anywhere, while declared in sw.h. Two other functions are also declared in phy.h (which is included in sw.c) and their definitions are in phy.c Overall sw.h is unnecessary and can be removed. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8188ee: Make functions static & rm sw.hAmadeusz Sławiński
Some of functions which were exposed in sw.h, are only used in sw.c, so just make them static. This makes sw.h unnecessary, so remove it. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtlwifi: rtl8192cu: Fix typoAmadeusz Sławiński
Replace USB_VENDER_ID_REALTEK with USB_VENDOR_ID_REALTEK. Signed-off-by: Amadeusz Sławiński <amade@asmblr.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: change max_num_of_tx_queue() definition to inline in pci.hZong-Zhe Yang
It's more reasonable to define max_num_of_tx_queue() as an inline function. Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: assign NULL to skb after being kfree()'edYan-Hsuan Chuang
Should assign NULL to skb after kfree(), in case of driver trying to free the same skb again. This could happen if driver failed to allocate an skb when building reserved page. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: use rtw_hci_stop() instead of rtwdev->hci.ops->stop()Chin-Yen Lee
Fix typo, should use rtw_hci_stop() Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: remove unused vif pointer in struct rtw_vifYan-Hsuan Chuang
As driver can easily get vif with container_of(), we can just remove it. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: remove unused variable 'in_lps'Yan-Hsuan Chuang
Unused, will not be used neither, because the hardware/firmware can only support one vif for LPS currnetly. If there's more than one vif, than driver will never enter LPS. So remove it. Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: remove unused spinlockTzu-En Huang
dm_lock is never used. Thus, remove this redundant spinlock. Signed-off-by: Tzu-En Huang <tehuang@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: 8822c: update power sequence to v15Tzu-En Huang
Update card enable power sequence flow, to fix CMD11 fail after reboot and wrong PLL clock. Signed-off-by: Tzu-En Huang <tehuang@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: fix TX secondary channel offset of 40M if current bw is 20M or 40MPing-Ke Shih
TX secondary channel offset is valid only if current bandwidth is 80M, otherwise leave this value as zero. The wrong value of txsc40 causes MAC unpredictable behavior. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: fix rate mask for 1SS chipPing-Ke Shih
The rate mask is used to tell firmware the supported rate depends on negotiation. We loop 2 times for all VHT/HT 2SS rate mask first, and then only keep the part according to chip's NSS. This commit fixes the logic error of '&' operations for VHT/HT rate, and we should run this logic before adding legacy rate. To access HT MCS map, index 0/1 represent MCS 0-7/8-15 respectively. Use NL80211_BAND_xxx is incorrect, so fix it as well. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Reviewed-by: Chris Chiu <chiu@endlessm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: Add wowlan net-detect supportChin-Yen Lee
Net-detect is an option of wowlan to allow the device to be woken up from suspend mode when configured network is detected. When user enables net-detect and lets the device enter suspend state, wowlan firmware will periodically scan until beacon or probe response of configured networks are received. Between two scans, wowlan firmware keeps wifi chip in idle mode to reduce power consumption. If configured networks are detected, wowlan firmware will trigger resume process. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: Add wowlan pattern match supportChin-Yen Lee
Pattern match is an option of wowlan to allow the device to be woken up from suspend mode when receiving packets matched user-designed patterns. The patterns are written into hardware cam in suspend flow if users have set up them. If packets matched designed pattern are received, wowlan firmware will get an interrupt and then wake up the device. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: support wowlan feature for 8822cChin-Yen Lee
Wake on WLAN(wowlan) is a feature which allows devices to be woken up from suspend state through wlan events. When user enables wowlan feature and then let the device enter suspend state, wowlan firmware will be loaded by the driver and periodically monitors wifi packets. Power consumption of wifi chip will be reduced in this state. If wowlan firmware detects that specific wlan event happens, it will issue wakeup signal to trigger resume process. Driver will load normal firmware and let wifi chip return to the original state. Currently supported wlan events include receiving magic packet, rekey packet and deauth packet, and disconnecting from AP. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: load wowlan firmware if wowlan is supportedChin-Yen Lee
Driver used to download normal firmware only, but some devices support wowlan and require to download wowlan firmware when system suspends. So modify rtw_load_firmware() and its callback to allow driver to download both normal and wowlan firmware. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: add interface config for 8822cYan-Hsuan Chuang
Some devices need to configure interface/HCI related reigsters in power on flow. Add interface_cfg for HCI for the settings. The driver only supports RTL8822BE/RTL8822CE now, and since RTL8822BE does not need to configure PCIE, the configuration is only added for RTL8822CE. Without it, some of the RTL8822CE device can crash and disconnected to host in suspend/wowlan mode. Signed-off-by: Tzu-En Huang <tehuang@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: pci: reset dma when reset pci trx ringChin-Yen Lee
When PCI trx rings are reset, the DMA engine should also be reset. Otherswise, the rx_tag of rx flow is not synchronous to hw. Remove DMA reset when rtw_pci_start() as we added it in rtw_pci_setup(). Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Reviewed-by: Chris Chiu <chiu@endlessm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26rtw88: pci: reset ring index when release skbs in tx ringChin-Yen Lee
When skbs queued for each TX ring are relased in PCI stop flow, the ring index should be reset at the same time. Signed-off-by: Chin-Yen Lee <timlee@realtek.com> Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26hostap: Adjust indentation in prism2_hostapd_add_staNathan Chancellor
Clang warns: ../drivers/net/wireless/intersil/hostap/hostap_ap.c:2511:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation] if (sta->tx_supp_rates & WLAN_RATE_5M5) ^ ../drivers/net/wireless/intersil/hostap/hostap_ap.c:2509:2: note: previous statement is here if (sta->tx_supp_rates & WLAN_RATE_2M) ^ 1 warning generated. This warning occurs because there is a space before the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns. Fixes: ff1d2767d5a4 ("Add HostAP wireless driver.") Link: https://github.com/ClangBuiltLinux/linux/issues/813 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26wlcore: mesh: Add support for RX Broadcast KeyMaital Hahn
In order to support authentication of equals peers, need to save RX Broadcast key per peer (on top of 1 TX broadcast key and unicast key per peer). Signed-off-by: Maital Hahn <maitalm@ti.com> Acked-by: Guy Mishol <guym@ti.com> Signed-off-by: Hari Nagalla <hnagalla@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26wcn36xx: fix spelling mistake "to" -> "too"Colin Ian King
There is a spelling mistake in a wcn36xx_err message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26ar5523: fix spelling mistake "to" -> "too"Colin Ian King
There is a spelling mistake in a ar5523_err message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26ar5523: Add USB ID of SMCWUSBT-G2 wireless adapterMert Dirik
Add the required USB ID for running SMCWUSBT-G2 wireless adapter (SMC "EZ Connect g"). This device uses ar5523 chipset and requires firmware to be loaded. Even though pid of the device is 4507, this patch adds it as 4506 so that AR5523_DEVICE_UG macro can set the AR5523_FLAG_PRE_FIRMWARE flag for pid 4507. Signed-off-by: Mert Dirik <mertdirik@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26ath10k: Use device_get_match_data() to simplify codeStephen Boyd
Use device_get_match_data() here to simplify the code a bit. Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26ath10k: Add newlines to printk messagesStephen Boyd
Some printks in here don't have newlines at the end, meaning the log will be sort of hard to read. Add newlines. Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26tcp: export count for rehash attemptsAbdul Kabbani
Using IPv6 flow-label to swiftly route around avoid congested or disconnected network path can greatly improve TCP reliability. This patch adds SNMP counters and a OPT_STATS counter to track both host-level and connection-level statistics. Network administrators can use these counters to evaluate the impact of this new ability better. Export count for rehash attempts to 1) two SNMP counters: TcpTimeoutRehash (rehash due to timeouts), and TcpDuplicateDataRehash (rehash due to receiving duplicate packets) 2) Timestamping API SOF_TIMESTAMPING_OPT_STATS. Signed-off-by: Abdul Kabbani <akabbani@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Kevin(Yudong) Yang <yyd@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-26ath10k: Correct the DMA direction for management tx buffersRakesh Pillai
The management packets, send to firmware via WMI, are mapped using the direction DMA_TO_DEVICE. Currently in case of wmi cleanup, these buffers are being unmapped using an incorrect DMA direction. This can cause unwanted behavior when the host driver is handling a restart of the wlan firmware. We might see a trace like below [<ffffff8008098b18>] __dma_inv_area+0x28/0x58 [<ffffff8001176734>] ath10k_wmi_mgmt_tx_clean_up_pending+0x60/0xb0 [ath10k_core] [<ffffff80088c7c50>] idr_for_each+0x78/0xe4 [<ffffff80011766a4>] ath10k_wmi_detach+0x4c/0x7c [ath10k_core] [<ffffff8001163d7c>] ath10k_core_stop+0x58/0x68 [ath10k_core] [<ffffff800114fb74>] ath10k_halt+0xec/0x13c [ath10k_core] [<ffffff8001165110>] ath10k_core_restart+0x11c/0x1a8 [ath10k_core] [<ffffff80080c36bc>] process_one_work+0x16c/0x31c Fix the incorrect DMA direction during the wmi management tx buffer cleanup. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1 Fixes: dc405152bb6 ("ath10k: handle mgmt tx completion event") Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26Merge branch 's390-qeth-next'David S. Miller
Julian Wiedmann says: ==================== s390/qeth: updates 2020-01-25 please apply the following patch series for qeth to your net-next tree. This brings a number of cleanups for the init/teardown code paths. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-26s390/qeth: remove HARDSETUP stateJulian Wiedmann
qeth_l?_stop_card() is _never_ called while in HARDSETUP state, and there's no other usage of the card state that relies on the DOWN -> HARDSETUP -> SOFTSETUP transition. As related cleanup, remove the check in qeth_realloc_buffer_pool() as it is already done by the callers. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-26s390/qeth: make cmd/reply matching more flexibleJulian Wiedmann
When data is received on the READ channel, the matching logic for cmds that are waiting for a reply is currently hard-coded into the channel's main IO callback. Move this into a per-cmd callback, so that we can apply custom matching logic for each individual cmd. This also allows us to remove the coarse-grained check for unexpected non-IPA replies, since they will no longer match against _all_ pending cmds. Note that IDX cmds use _no_ matcher, since their reply is synchronously received as part of the cmd's IO. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-26s390/qeth: consolidate online/offline codeJulian Wiedmann
Large parts of the online/offline code are identical now, and cleaning up the remaining stuff is easier with a shared core. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-26s390/qeth: consolidate QDIO queue setupJulian Wiedmann
Move some duplicated logic into a shared code path. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-26s390/qeth: shift some bridgeport code aroundJulian Wiedmann
qeth_l2_setup_bridgeport_attrs() is entirely unrelated to sysfs functionality, move it where it belongs. While at it merge all the bridgeport-specific code in the set-online path together. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Reviewed-by: Alexandra Winter <wintera@linux.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2020-01-26MAINTAINERS: update for mwifiex driver maintainersGanapathi Bhat
Remove Nishant Sarmukadam from Maintainer list, as he is no longer working in NXP. Signed-off-by: Ganapathi Bhat <ganapathi.bhat@nxp.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-01-26mwifiex: drop most magic numbers from mwifiex_process_tdls_action_frame()Brian Norris
Before commit 1e58252e334d ("mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()"), mwifiex_process_tdls_action_frame() already had too many magic numbers. But this commit just added a ton more, in the name of checking for buffer overflows. That seems like a really bad idea. Let's make these magic numbers a little less magic, by (a) factoring out 'pos[1]' as 'ie_len' (b) using 'sizeof' on the appropriate source or destination fields where possible, instead of bare numbers (c) dropping redundant checks, per below. Regarding redundant checks: the beginning of the loop has this: if (pos + 2 + pos[1] > end) break; but then individual 'case's include stuff like this: if (pos > end - 3) return; if (pos[1] != 1) return; Note that the second 'return' (validating the length, pos[1]) combined with the above condition (ensuring 'pos + 2 + length' doesn't exceed 'end'), makes the first 'return' (whose 'if' can be reworded as 'pos > end - pos[1] - 2') redundant. Rather than unwind the magic numbers there, just drop those conditions. Fixes: 1e58252e334d ("mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()") Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>