Commit Graph

869 Commits

Author SHA1 Message Date
Ruben Columbus
2216aa520b qcacmn: lock on queue
Adding lock for dp_txrx_ppdu_stats_handler given
that insertion and deletion happen in different cores.

Change-Id: Ic0102d615f02cbfed70acc1114a314426466638e
2021-03-18 13:47:18 -07:00
Yeshwanth Sriram Guntuka
b23bcc8b6b qcacmn: Add support to reset SOC rx ext stats
Add CDP interface to support reset of soc rx ext stats.

Change-Id: I381f9b6b27d8d023b1932b7d8587df240c1ff4d0
CRs-Fixed: 2889565
2021-03-11 09:48:46 -08:00
Manikanta Pubbisetty
14d38b77fb qcacmn: disable EXT grp irqs and drain TXRX during suspend
Any update to the SRNG TP/HP when the device is in low power
state would result in system errors. It is recommended to disable
EXT grp irqs and drain TXRX before sending power save enter command
to the FW. This will ensure that no interrupts are received while
in power save mode and as a result there wont be any HP/TP updates.

Change-Id: Ibf952bbc2c6d13fb3e4ca6b4845bc9cc887fa694
CRs-Fixed: 2883135
2021-03-11 19:41:34 +05:30
Nisha Menon
ed3a77563a qcacmn: Add wbm head/tail pointer stats to dp_txrx_stats
Add wbm head/tail pointer stats to dp_txrx_stats and ring
usage percentage for all SRC and DST rings.
Stats added to the following cmd: iwpriv wlan0 txrx_stats 26 0

CRs-Fixed: 2865996
Change-Id: I7d144d87c5f3485ec9ba85f50b036b69a64e53c6
2021-03-11 18:01:27 +05:30
Aditya Kodukula
7679b0651a qcacmn: Add params to the wlan_minidump_remove function
For the minidump feature, the wlan_minidump_remove function
definition is modified. So, update the function parameters
accordingly at all instances of the wlan_minidump_remove function.

Change-Id: I5a346f6cdf423ece02fb08d68e4422251af54876
CRs-Fixed: 2860435
2021-03-09 21:07:01 -08:00
Basamma Yakkanahalli
4adab0e0a9 qcacmn: enable reo_status ring process in NSS offload mode
Add support to process reo_status rings in NSS offload mode
for lowmem profile.

Change-Id: If5aa3649f33fa8e1a9b328b8506dd398646d179c
2021-03-08 15:17:12 -08:00
Amir Patel
6c6f067b65 qcacmn: Fix monitor link descriptor memory alloc failure
In existing approach, monitor rings get initalized
on monitor vap init time,
For linux 5.4 kernel, physical contiguous memory(512Kb) is not
available on vap init time.
Initialize monitor related rings on monitor vap creation time
to get required memory.

Change-Id: I288c27cfcf77b3d224c2f21bbe8ac65670f32dda
CRs-Fixed: 2865141
2021-03-03 00:49:09 -08:00
Basamma Yakkanahalli
5c02cbbc5e qcacmn: Reset rxdma2host dst ring mask for ipq5018 target
During interrupt mask initialization bitmap of rxdma2host
destination ring mask is filled in host mode.
To avoid spurious interrupts reset this interrupt mask
when NSS offload is enabled.

Change-Id: I513a78639898c6f2bd9ea5418def03d64d7232d0
2021-02-23 23:40:23 -08:00
Kai Chen
2667f112d8 qcacmn: Add CBF support for pktlog
Fix issue on enabling packet log.
Fix issue on logging CBF pkt in AP/STA mode.
Fix issue on setting data length 4 bytes aligned in pktlog header
, htt stats indication message header and Rx management TLV header.
Add CBF support for pktlog WMI enable command for firmware to enable
CBF receive.

Change-Id: Ib0067f32d7414be96503c4c67846c1312a59586e
2021-02-10 20:27:29 -08:00
Vevek Venkatesan
07c4fc98d1 qcacmn: add lockless SRNG access support for Rx Rings
Add lockless SRNG access support for Rx rings.

Change-Id: Ia44f612cc5f6e50255aafaaf895044dea7a88aa7
CRs-Fixed: 2868991
2021-02-09 19:56:53 -08:00
Nitin Shetty
71e3244d46 qcacmn: skip MEC ast entry creation in wlan fw
MEC ast entry will be created only in software
and adding MEC entry to wlan fw is skipped.

Change-Id: I6991f9f12ceb22a7c599cdf3cc2a13c996d93671
2021-02-09 15:35:27 -08:00
Shwetha G K
335982bd3d qcacmn: Change dp_pdev_init as non-inline function
Change the dp_pdev_init as non-inline function for
code size reduction.

Change-Id: I5720ba2e5bdf221de584b722768e23ae6a6f2b79
2021-02-09 13:02:27 -08:00
Lihua Liu
74efc61848 qcacmn: Avoid using small buffer address
The memory below 0x2000 is reserved for the target use,
so any memory in this region should not used by host.
But on some third-party platforms, we observe such
memory is allocated for RX buffer, which cause HW/FW
NOC error, then RX is stuck. To address this,
re-allocate RX buffers when small buffer appear.

Change-Id: Iad118e82f3fe10f92cbf5f7388dc0960542fc03c
CRs-Fixed: 2707190
2021-02-04 06:43:41 -08:00
Amir Patel
50133e4345 qcacmn: Fix Smart monitor init issue
For smart monitor initialize monitor buffer ring,
Monitor direct mode onto monitor status ring expects monitor buffer
ring to initilized with at least 64 buffers.

CRs-Fixed: 2863316
Change-Id: Ie67ff465522184ad776a9ba76a68c00f02f92221
2021-02-03 01:50:24 -08:00
Himanshu Batra
ec2e7778ea qcacmn: Modify logs for QDF_MODULE_ID_CDP
Use macros like dp_cdp_debug, dp_cdp_err, dp_cdp_info to
print logs for QDF_MODULE_ID_CDP

Change-Id: I550eefa82c3417b8bf83378d4a9c6f382098fea6
CRs-Fixed: 2855937
2021-01-30 00:51:20 -08:00
Vijay Krishnan
4427314322 qcacmn: Setting up filters and destination ring for CBF logging
This change will set up monitor mode status and destination ring
filters for enbale CBF logging and will enable destination ring to
capture CBF frame. This change will get the CBF frame from the
destination ring and send it to the pktlog module for post processing
through WDI event. CBF is a compressed beamforming report.

Change-Id: I4cc419440ba8d60446dd1f01747340a89f023171
2021-01-29 16:48:58 -08:00
Rakesh Pillai
783f811315 qcacmn: Send ring sel cfg to configure rx pkt tlvs offset
Currently the FW configures the mac with appropriate
offsets for rx pkt tlvs using the structure defined in
te FW and the host does not send the ring selction config
HTT message. This can create a problem when FW stops subscribing
to tlvs or changes its rx pkt tlvs offset.

Fix this by configuring the rx pkt tlv offsets via HTT
ring selection config message.

Change-Id: I1a2865f91b34dd7bda1af8651d7831097dac0bee
CRs-Fixed: 2860504
2021-01-29 00:04:19 -08:00
Mainak Sen
059ed74e8b qcacmn: Placeholder for peer mesh latency changes
Add support to update per peer latency parameter
from datapath

Change-Id: I1096374ebd3aeb5dc11759f1512cdee744e170c6
2021-01-27 00:27:00 -08:00
Manikanta Pubbisetty
63e599de11 qcacmn: clean up inactive peers/vdevs during driver unload
DP references of the peer will be removed once we receive PEER
unmap message from the firmware. If the firmware has failed to
send the peer unmap message (due to an assert in FW), then the
peer entries will remain the inactive peer list and will trigger
a explicit QDF_BUG() during driver unload.

Force clean the inactive peer/vdev list during driver unload in such
cases.

Change-Id: Ib8a5f8179ce51378a825034e411f89ff024017e1
CRs-Fixed: 2847742
2021-01-19 12:57:46 -08:00
Chaithanya Garrepalli
76d4ea4287 qcacmn: fix use after free in WDS aging timer
In case of pdev attach failure reset pdev reference in
soc->pdev_list to NULL before free to avoid use after
free

Also initialize WDS aging timer only when ast hash is
allocated

Change-Id: I6a406bd94aa46a95d9e5bb970ae83b3dfde29d0a
2021-01-18 23:52:21 -08:00
Pavankumar Nandeshwar
d6c9f3ad8a qcacmn: change qcn9100 to qcn6122 in data path
Change the name of target type qcn9100
to qcn6122 in data path.

Change-Id: Ia1463ca276b7c107ca4c1ebce4ffc8b517134a5e
CRs-Fixed: 2849577
2021-01-18 21:45:30 -08:00
Jianmin Zhu
6ef2047d56 qcacmn: Fix long ping delay after enable RTPM
Issue1: Driver RTPM state is ON/NONE, Kernel state is RESUMING.
cdp_runtime_resume is already complete,
hif_pm_runtime_get return -E_INPROGRESS,
dp_tx_hw_enqueue will set the flush event,
but cdp_runtime_resume is already done,
this flush event will be handled only on next pkt tx.

Issue2: Driver RTPM state: Resuming
hif_pm_runtime_get returns -EBUSY,
dp_tx_hw_enqueue is interrupted by any IRQ,
cdp_runtime_resume is completed,
dp_tx_hw_enqueue will set the flush event,
This flush event will be handled only on next pkt tx.

Fix:
Introduce a link_state_up atomic variable in hif to track the link state
change by pld_cb.
Set atomic variable link_state_up=1 in pmo_core_psoc_bus_runtime_resume
just after pld_cb. pld_cb brings the PCIe bus out of suspend state.
Set atomic variable link_state_up=0 in pmo_core_psoc_bus_runtime_suspend
just before pld_cb. pld_cb puts the PCIe bus into suspend state.

Introduce dp_runtime_get and dp_runtime_put.
dp_runtime_get get refcount with increment of an atomic variable.
dp_runtime_put return refcount with decrement of  this atomic variable.

If hif_pm_runtime_get returns -EBUSY or -EINPROGRESS,
take the dp runtime refcount using dp_runtime_get,
check if the link state is up, write TX ring HP,
return the dp runtime refcount using dp_runtime_put.

cdp_runtime_suspend should reject the suspend, if dp_runtime_get is non
zero.
cdp_runtime_resume should wait until dp_runtime_get becomes zero or time
out, then flush pending tx for runtime suspend.

Change-Id: I5b97d50cba710082f117f3845f7830712b86cda7
CRs-Fixed: 2844888
2021-01-14 07:46:48 -08:00
Amir Patel
e41f64cc9e qcacmn: Fix monitor mode init issue
During monitor vap creation time, do not allocate monitor buffer
and link descriptors memory if already initilized.
Check if pdev->pdev_mon_init flag is true and return.

CRs-Fixed: 2852399
Change-Id: I87ceaf0af771abed1bff651ef6f2b9ca21e038b9
2021-01-13 04:43:10 -08:00
bings
3f59477859 qcacmn: Do not check MSI group number for one MSI vector mode
Some platforms only permit the device to allocate 1 MSI interrupt, then
macro WLAN_ONE_MSI_VECTOR is added to support this one MSI vector mode.
There is only one MSI data count for one MSI vector mode, so it is valid
that 2 more MSI dp groups share one MSI data.

Change-Id: Iaab2a2ba538ea3750a32454855144a0cb0776eca
CRs-Fixed: 2843378
2021-01-12 22:14:08 -08:00
phadiman
e4eda79524 qcacmn: Move multipass deinit to vdev detach
Multipass init is called from vdev attach and
multipass deinit is called from tx vdev detach

To maintain symmetry between init and deinit
move multipass deinit to vdev detch

CRs-Fixed: 2840338
Change-Id: I18657497b9e09ec5cc75d245765f6d0fd7d061fd
2021-01-12 14:34:45 -08:00
Shwetha G K
b3fafa78c8 qcacmn: Cleanup rssi and snr used interchangeably
Cleanup rssi and snr used interchangeably

Change-Id: Idc78ca1ceb62af766aaf69e42ab5d6e8990a6f0b
2021-01-11 15:13:44 -08:00
Yu Tian
ab67bf289d qcacmn: Fix the error statistics field for CNE
rx_mpdu_missed statistics used by CNE records instances
of BA hole happens, not duplicated frames instances.
Fix this field with correct value to avoid incorrect
VOLTE switching.

Change-Id: I815b9a4caeb6eedf36be66f8650ca98d00542c60
CRs-Fixed: 2848460
2021-01-07 21:13:55 -08:00
Mainak Sen
37a91751be qcacmn: Enable Peer authorization support in RX path
In security mode, allow only EAPOL frames in receive path
when peer is not authorized. This feature is enabled per VAP
based on vdev flag and will be applicable for all peers in that
VAP

Change-Id: Ic5dea09c2083f31e8cd301a0cdc3565f247b735c
2021-01-07 16:48:52 -08:00
Pragaspapthi Thilagaraj
d5cfa3829a qcacmn: Reduce excessive kmsg logging in roaming path
Reduce excessive data path logging to kmsg during roaming and
change the logging level for such prints to debug/info
high.

Change-Id: I1e6506de83e59a31304234905a3dd38f6d8b03f3
CRs-Fixed: 2848624
2021-01-07 08:17:44 -08:00
Rakesh Pillai
f1aa992998 qcacmn: Pre-alloc rx rings history when feature is enabled
Currently the rx rings history is allocated dynamically
on load time. The memory requirement for saving these
history are more than a page (order 5 to 6 allocations).
Such big memory allocation can fail due to various
reasons, one of them being memory fragmentation.

Fix this by pre-allocating the rx ring history memory.
Also allocate the rx reinject history memory when the
HW accelerated path is used.

Change-Id: Id957cd5df91a2ca7f182dea691a0557b4e386f55
CRs-Fixed: 2844388
2021-01-06 21:55:07 -08:00
Manikanta Pubbisetty
a5c11aabcb qcacmn: avoid FSE cache flush messages during runtime suspend
When runtime power management is enabled, until the system is fully
resumed, we do not post any message to CE, instead they will be queued
in HTC. Once the device is fully resumed, all HTT messages in the queues
will be downloaded to CE at once. In some corner cases, it is found that
too many FSE caches flush messages getting queued during the runtime
resume; once the device is fully resumed, all these would be downloaded
to the FW/HW at once causing unintended crashes.

Avoid posting FSE cache flush messages until the device is fully resumed
to fix the issue.

Change-Id: I2be21406e8c7a9dcd86df3e93c2568797defcad0
CRs-Fixed: 2843541
2021-01-05 18:14:39 -08:00
Amir Patel
76b9febd3d qcacmn: Delay allocation of rings for monitor mode
In existing implementation, for monitor mode below allocation
are done at pdev attach and init time.

	a. 64 monitor buffer allocation for RxDMA monitor buffer ring
	b. Link descriptor memory allocation for monitor link descriptor ring

This memory is waste of memory for customers not using monitor mode and
low memory profile.

To optimize this memory, allocate all buffers and link descriptor memory
at monitor vdev creation time.

Change-Id: I873c76d2f625a782532a101037915b0353928a5b
CRs-Fixed: 2829402
2020-12-29 03:16:09 -08:00
Jinwei Chen
b3511e0844 qcacmn: support FSE cache flushing suspend/resume
scenario:
FISA new FST entry is initialed, host will start one timer to
send HTT MSG DP_HTT_FST_CACHE_INVALIDATE_FULL to FW in 5 ms,
WOW suspending happened in the same time, PCIe bus get suspended.
5 ms later, HTT msg sending will try to prevent PCIe L1 to update
CE SRNG HP register, hit assert as PCIe bus suspended already.

suspend and cancel the FSE cache flushing timer when dp_bus_suspend,
resume it when dp_bus_resume.

CRs-Fixed: 2843214
Change-Id: Ie2bc115a0de068335d6c46749f52d205cc21f5a3
2020-12-24 04:50:29 -08:00
Shikha Bakshi
3eeace37b2 qcacmn: Modify logs for QDF_MODULE_ID_DP_CDP and QDF_MODULE_ID_DP_VDEV
Add macros like dp_cdp_debug, dp_cdp_err, dp_cdp_info, dp_vdev_info,
dp_vdev_err, etc. to define logs

Change-Id: I176c0579af9b5ef2f14846fac1e8182309636464
CRs-Fixed: 2840489
2020-12-22 18:47:49 -08:00
Shikha Bakshi
c1e00a21ba qcacmn: Modify logs for QDF_MODULE_ID_DP_PEER
Add macros dp_peer_info, dp_peer_info_low,
dp_peer_info_high, dp_peer_alert, dp_peer_err,
dp_tx_capture_debug to define logs.

Change-Id: Icf71595c10b1a4f0dca53f6953af4df19210e924
CRs-Fixed: 2832004
2020-12-22 06:40:31 -08:00
Shikha Bakshi
89662c1eeb qcacmn: Modify Logs for QDF_MODULE_ID_DP_INIT
Add macros like dp_init_debug, dp_init_err, dp_init_info, etc. to
define logs

Change-Id: I5b0f48b2f0b4b5d6be19850e2fff928672d09ad1
CRs-Fixed: 2837411
2020-12-22 06:40:26 -08:00
Shikha Bakshi
7cdc796f7e qcacmn: Modify logs for QDF_MODULE_ID_DP_RX_MON_DEST
Add macros dp_rx_mon_dest_info, dp_rx_mon_dest_debug,
dp_rx_mon_dest_err,etc. to define logs

Change-Id: I2a016ee8e3e74b745e776f1f7266d94bb9698892
CRs-Fixed: 2830629
2020-12-22 02:45:52 -08:00
Shikha Bakshi
7ae3ccdc47 qcacmn: Modify logs for QDF_MODULE_ID_DP_TX and QDF_MODULE_ID_DP_TX_COMP
Add macros like dp_tx_info, dp_tx_comp_info,
dp_tx_debug, dp_tx_comp_debug, dp_tx_err,
dp_tx_comp_err, etc.  to define logs

Change-Id: If0eef8112db1f8e99fb95ee943d5ddbff94425b8
CRs-Fixed: 2830563
2020-12-19 12:46:07 -08:00
phadiman
d1bb528ae7 qcacmn: Host Static Memory Optimization (in NSS offload mode)
Low memory profiles like 256M and 16M profiles support
only NSS Wi-Fi offload mode and HOST data path APIs are
not used in NSS offload mode

Disable HOST data path APIs which are not used in both
NSS Wi-Fi offload mode and in HOST mode (in NSS offload mode)

CRs-Fixed: 2831478
Change-Id: I6895054a6c96bd446c2df7761ce65feef662a3cc
2020-12-15 13:34:26 -08:00
Saket Jha
9e21d6689a qcacmn: Check for valid monitor vdev during init
As part of monitor mode init, add check for null monitor vdev before
accessing vdev_id in case prevous cleanup of monitor vdev still ongoing.

Change-Id: I0165684c8aa2abea73fa8c0d1692dac789fb20f6
CRs-Fixed: 2835758
2020-12-14 17:34:14 -08:00
Narayan Subramhanyan
2351a30e12 qcacmn: Reset interrupt mask based on host mode ring count
During interrupt mask initialization, bitmap of tx ring
mask and reo dest ring mask are filled in host mode based
on the number of rings.

When NSS offload mode and dynamic HW mode are enabled,
interrupt reset is done based on modified ring count.
This is causing invalid hal_srng access for interrupt
context which are not reset.

So, resetting tx ring mask and reo ring mask based on host
mode ring count. Also reset when mask value is non-zero.

Change-Id: I6e3ef2df7a1f71aa17ebf8499467b39bc84f88bf
2020-12-11 05:30:30 -08:00
Aniruddha Paul
b42ee01aec qcacmn: Change the DST_ALT_IND_0 to WBM from REO2TCL
Change the alternate indication_0 to WBM instead of
REO2TCL. This is done such that, WBM takes care of
the of the de-linking of the link descriptors and
release the buffers to the respective WBM rings.
WBM should take care of the NULL entries if present
in link descriptor as WBM internal errors.

Change-Id: Ie084e54861bb4611a45cd724bb32d211c62f4f21
2020-12-08 01:12:32 -08:00
Ananya Gupta
a660173209 qcacmn: Pre allocate pdev during attach
Pre-allocate pdev context as size exceeds dynamic allocation
threshold (4KB).

Change-Id: Ida866275ed1ddea5a9b6aa1cf114ccd226ed0f22
CRs-Fixed: 2825110
2020-12-08 01:12:27 -08:00
Rakesh Pillai
2989d9b1fc qcacmn: Add CDP API to dump srng SW hp-tp info
Add CDP API to dump the SW head pointer and tail pointer
of a few important srngs. This can be used to debug or
get a direction when the device doesn't dump ram info.

dp_print_ring_stat_from_hal is not being used, since without
device force wake recipe in place, reading hardware hp/tp
value can lead to NOC errors.

Change-Id: Ib0381acb007f1b4431f6a02cd9762e461d6393e8
CRs-Fixed: 2826084
2020-12-03 17:35:13 -08:00
nobelj
da9b69116b qcacmn: remove ppdu_info from list before free
during pdev deinit, while freeing ppdu_info it need to be
removed from the list before freeing.

Change-Id: I2829daf3ed58c7a143fba09d68eb6f0278accdf0
2020-11-25 22:25:14 -08:00
Jinwei Chen
18762e5b16 qcacmn: Use rxdma error frame as rx_mpdu_error count
RX error stats from REO2TCL ring is just for RX 2K jump/
OOR frame, host should not count them as rx_mpdu_error
stats for user space which will think wifi connection is bad
easily in noise environment.

Align this part logic with Helium that count TKIP/MIC error
frame, for HST/HSP, use error counted from RXDMA instead.

Change-Id: I2e488bedaed166ce410c53eb7e9710d7933c2717
CRs-Fixed: 2821147
2020-11-21 18:07:31 -08:00
phadiman
95b9a6e63a qcacmn: HOST Memory Optimizations (in NSS offload mode)
Number of DP rings used in HOST mode and NSS offload mode differ
and in current scenario the rings are allocated unconditionally.

Allocate only required number of rings based on the HOST mode and
NSS Wi-Fi offload mode and based on the number of radios supported
per SOC.

CRs-Fixed: 2790504
Change-Id: I20ce1908da47c197ea3b406f8704b964f3d8f7d1
2020-11-21 02:20:19 -08:00
Tiger Yu
9fc47f763e qcacmn: Add cfg_dp_sg_enable to get ini key dp_sg_support
Add cfg_dp_sg_enable to get ini key dp_sg_support by cdp_cfg_get.
And add some comments for CFG_DP_SG to clarify more.

Change-Id: I34de242eacbdcf55398afe64b91f5534f205fa22
CRs-Fixed: 2822536
2020-11-20 10:43:43 -08:00
Tiger Yu
36bf66878e qcacmn: Fix buffer overflow written in the dp_soc_interrupt_detach
Use sizeof instead of REG_BAND_UNKNOWN to fix buffer overflow written
in the dp_soc_interrupt_detach.

Change-Id: Iffad59346c487e34632f1c60b2c88e635f6e83a0
CRs-Fixed: 2822433
2020-11-20 04:03:42 -08:00
Nisha Menon
4677d5bdf5 qcacmn: Memory stats for SKB usage and Tx desc cnt in datapath
Add sysfs node for DP level memory stats:
/sys/kernel/wifi/wlan/wlan_dp_mem_stats
These include Tx, Rx SKB memory allocated, Tx/Rx
buffer count, outstanding Tx desc count.

Change-Id: I839a5f2ec4e763ca11cdea2093368ca6dc52d8cf
CRs-Fixed: 2724460
2020-11-18 16:23:53 -08:00