Commit Graph

833 Commits

Author SHA1 Message Date
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
Rakesh Pillai
904ad769a0 qcacmn: Skip setting rx tids for monitor mode self peer
Currently the rx tids are getting setup for the
self peer in monitor mode. This leads to sending
commands to the reorder-hw and the hardware generates
its responses.
In Monitor mode, none of these rings are reaped, since
the reorder-hw is not used. This opens up a possibility
of backpressure on the reorder-hw rings.

Skip setting up the rx tids for monitor mode
self peer, since they are not used.

Change-Id: I37bade9ef5c8bd536a01371cc059ebbcfb85ee5a
CRs-Fixed: 2815866
2020-11-18 12:04:04 -08:00
Amir
df60a16001 qcacmn: Disable rxdma1 functionality for LM256 profile
As monitor mode is not supported on LM256 profile,
disable rxdma1 functionality on same

Change-Id: I64e5de02d56801bfd46e32a6c64a1286e4d7ecb0
CRs-Fixed: 2819904
2020-11-18 05:40:30 -08:00
Saket Jha
b46ee401e1 qcacmn: Enable monitor mode in mission mode
While in mission mode, add support for monitor mode to be created as
another interface to support STA + monitor mode. Create a new
mon_vdev_timer to be started during vdev_attach and calling
dp_mon_vdev_timer to reap monitor rings while in this mode.

CRs-Fixed: 2815653
Change-Id: I631deb5121d7997cded524befd11883079a23aaf
2020-11-17 23:18:52 -08:00
Mohit Khanna
a939d20dbf qcacmn: Move delayed-reg-work active_work_cnt decrement
Currently, we decrement active_work_cnt in a while loop in delayed
register worker and later on make a "allow_l1" call to enable L1ss.
The bus suspend routine depends on the value of active_work_cnt to
determine if any register writes are pending. In case there are, bus
suspend is rejected.
As a result its possible that when bus suspend happens, the
delayed worker while processing the last remaining enqueued
write,  makes the active_work_cnt to 0. This will allow the bus suspend
routine to continue to disable the bus, even before the
delayed-reg-worker has called allow_l1 and run to completion. This may
lead to a NOC error while calling "allow_l1" API from
delayed-reg-worker.

Hence, move the decrement of active_work_cnt to the very end in
hal_reg_write_work function.

Change-Id: Iec602f97c953df1c6a018310fd02ab458547ce3a
CRs-fixed: 2813733
2020-11-14 20:04:04 -08:00
Wu Gao
32cab9b00c qcacmn: Fix compilation issue on arch32 by gcc 9.3
This change fixed compilation error about implicit-fallthrough and
pointer to in cast.

Change-Id: Iea2c25d97d8a039ed0f8083078427a8f8de70cd1
CRs-Fixed: 2814658
2020-11-11 10:23:54 -08:00
Mohit Khanna
98181d9ccc qcacmn: Flush reg write work before bus suspend
Delayed register write work needs to be flushed before bus suspend to
make sure there are on pending writes after driver's bus suspend routine
exits. In case delayed work context is not able to finish before the bus
(PCI) is suspended (DRV), it may lead to a NOC error.

Change-Id: I40cbcec5d23ddd75ec87aed69ac45d95510fa880
CRs-Fixed: 2813733
2020-11-09 22:57:51 -08:00
Manikanta Pubbisetty
a51d70591e qcacmn: reset monitor filter before ring reap
In monitor mode, as part of VDEV delete, we are reaping
monitor rings to avoid backpressure from RXDMA2SW ring.
Looks like the ring continues to grow even after reaping,
reset the monitor filters before reaping to avoid
ring backpressure.

Change-Id: I0d9dde61b62648f8ce11c15ba23612fc8491fff2
CRs-Fixed: 2807482
2020-11-03 08:35:25 -08:00
Adil Saeed Musthafa
5c48559237 qcacmn: setup the target_pdev_id on mode switch
We need to set pdev->target_pdev_id after mode switch so that the
correct target_pdev_id will be used for monitor mode ring configurations

Change-Id: I0c79d0e69f8d28f8a7c8823a1010baf317571c20
CRs-Fixed: 2803005
2020-11-02 13:05:34 -08:00
Yu Tian
76fdb54e96 qcacmn: add an ini field to control rx frame pending check
Add a ini control field to control rx frame pending check
logic in WoW case. In some cases, power consumption is more
important than rx frame ping loss, so add a control flag

Change-Id: I8c4d3725edddb82a0f06dc70c22a8dd5243209f2
CRs-Fixed: 2806786
2020-11-02 01:47:07 -08:00
Kai Chen
f71662bc1a qcacmn: Not able to enable pktlog when monitor mode is enabled
This change enables pktlog when monitor mode is enabled.

Change-Id: Ia471c2a5ff92ad590c8c61bc1527b2760d4ba51c
CRs-Fixed: 2799509
2020-10-27 04:56:55 -07:00
Manikanta Pubbisetty
b265955389 qcacmn: reap monitor rings before vdev delete
In monitor mode, as part of VDEV delete, monitor mode
poll timer is stopped; it is good to reap the monitor rings
once after timer stop to avoid crashes that arise due to
RXDMA2SW ring backpressure.

Change-Id: Ib15b3398087073ad053616c6aa68e295eaebdd17
CRs-Fixed: 2796608
2020-10-22 01:47:34 -07:00
Himanshu Batra
8656266cf7 qcacmn: Enable/disable full monitor mode for mcopy mode
mcopy mode uses monitor destination ring to sniff mgmt frames, 
send enable/disbale full monitor mode by sending HTT msg to FW
when configuring mcopy.

Change-Id: Ie9510bda223861c13054abac640b2c879c4d334d
2020-10-21 07:20:55 -07:00
Yeshwanth Sriram Guntuka
c5a9883e25 qcacmn: Drop packets from RXDMA2SW ring on the non-monitoring MAC
In monitor mode, if channel is initially configured from 5G
band and then moved to channel from 2G band, packets are still
received on MAC-0 RXDMA2SW ring since IMPS is disabled for both
MACs. Since driver reaps only MAC-1 RXDMA2SW ring, ring full
condition is hit for the MAC-0 ring causing ring backpressure.

Fix is to drop packets received on the non-monitoring MAC
ring.

Change-Id: I49cb276827f4a06791183ee3fe8c88ba84df085d
CRs-Fixed: 2791341
2020-10-19 07:08:01 -07:00
Varsha Mishra
807a1944f2 qcacmn: Update dscp tid mapping table for IPQ5018/QCN9100
IPQ5018/QCN9100 dscp tid mapping table is reduced to 32.

Change-Id: Iec19814722b574a28eac66558240efa38313f07b
2020-10-16 13:46:40 -07:00
Ananya Gupta
936ca8fe36 qcacmn: Deregister IPA handler from pdev during deinit
A htt message arrived after ipa context is freed as part of
deinitialization which was dereferenced by event handler
assigned to pdev->ipa_uc_op_cb, resulting in crash.
To fix this, during deinit pdev->ipa_uc_op_cb is deregistered
and assigned NULL before freeing up ipa context.

Change-Id: I8125cb104a538e88cda93960f7443129fabd850a
CRs-Fixed: 2793295
2020-10-13 00:08:18 -07:00
Radha Krishna Simha Jiguru
3048f53867 qcacmn: Set default REO of radio through ini
Set default REO of radio through ini parameter

Change-Id: I576f3ddffe4d18b955099e0b75ecb297228475da
2020-10-12 06:27:25 -07:00
hqu
ba45fe7e2c qcacmn: Fix implicit-fallthrough compile error casued by gcc 9.3
Compiling with gcc 9.3 will cause many implicit-fallthrough
compile errors.

Fix is to add keyword fallthrough to resolve such compile error.

Change-Id: I2e7dd1525861d951e3be44f6665e149499f0f5d6
CRs-Fixed: 2785178
2020-10-08 12:24:02 -07:00
Vevek Venkatesan
3970f133ee qcacmn: add API to do IPA Tx buf smmu_unmapping for Hastings
Add API to do IPA Tx buf SMMU-S1 unmapping and register it
with cdp ops for Hastings, also assert if map/unmap failed.

Change-Id: I4071b5fccd84c3c97b9dccc40c6f798d70993189
CRs-Fixed: 2792170
2020-10-07 12:49:07 -07:00
Chaithanya Garrepalli
650f0ffd7d qcacmn: avoid updating peer stats under SOC AST lock
In teardown API update logical delete state to peer
before deleting AST entries of peer. Also in delete
AST API use __dp_peer_get_ref_by_id to get the peer

Change-Id: I6db227a284cf3726cc241ebc98386230eca58fcf
2020-10-06 19:31:36 -07:00
Mainak Sen
eb011c8f02 qcacmn: Add cdp ops for MSCS feature
Add a new cdp datapath ops - mscs_ops for Mirrored
stream classification signalling feature. This function
will be invoked from ECM flow acceleration manager

Change-Id: I749623846395057b6ea8328c881efa8733700b0e
2020-10-05 17:50:29 -07:00
Aniruddha Paul
ec14dd22d8 qcacmn: DP histogram print fixes
This change fixes the below issue.
1. Clear the histogram statistics per peer.
2. Separate out the Tx/Rx histogram prints.

Change-Id: I5fc51f6bca14dc4c615c5501441e1a6b28bb0f02
2020-10-04 15:20:21 -07:00
Nirav Shah
0fb3541617 qcacmn: Add support to configure REO ring threshold
Add support to configure REO ring threshold through ini
for WLAN_DP_PER_RING_TYPE_CONFIG feature.

Change-Id: I02a14adcf243905ab25c2af12cb9499f32ff453f
CRs-Fixed: 2789147
2020-10-04 03:49:27 -07:00
Shivani Soni
e82dcc6541 qcacmn: HTT stats debugfs deinit from dp_pdev_detach
Deinit of HTT stats debugfs files from dp_pdev_detach to prevent
deleting of files after 'wifi".

CRs-Fixed: 2782235
Change-Id: I77d86225762063af16bc8c2b716ca834698f1520
2020-09-23 05:20:44 -07:00
Jinwei Chen
18989f8ede qcacmn: support multiple pages prealloc for descriptor
Support multiple pages prealloc for DP descriptor

Change-Id: I66d4cef3acf69acf4b6fc8e5a6d01c3d67921dca
CRs-Fixed: 2751338
2020-09-21 01:33:16 -07:00
Varsha Mishra
c7789836fd qcacmn: Extended WDS solution RX
1. Register peer->osif_peer for per-STA netdevice delivery.
2. Wi-Fi 3-address frame packets received would be processed
   through AP netdevice.
3. Wi-Fi 4-address frame packets received would be processed
   through per-STA netdevice.

Change-Id: I102874ea1de9fba40ab7f0e2c32c9de1c9b4d075
2020-09-19 10:25:18 -07:00
Manikanta Pubbisetty
905d9e33fb qcacmn: add INI to place FST in CMEM
In addition to firmware capability, add INI param to decide FST
placement in CMEM.

Change-Id: Icc5fdfa49e35665b59efce3fc1f1855d84c16140
CRs-Fixed: 2778898
2020-09-17 10:18:38 -07:00
Manikanta Pubbisetty
b36165ae23 qcacmn: export CMEM FST firmware capability to DP
Firmware advertizes its support to place FST in CMEM,
export this capability to DP.

Change-Id: I265246bcfd38a36e34c4ede66e117a92bb185032
CRs-Fixed: 2772238
2020-09-17 10:18:34 -07:00
Ankit Kumar
bdddeb7c22 qcacmn: Add frame vdev id check in tx
Drop frame if it is not for the vap, to which
client is connected.
Enable this check only for ap.

Change-Id: I33d7eb79267490bdb8697e4e45f789e9f6279f0e
CRs-Fixed: 2756304
2020-09-16 09:30:33 -07:00
Chaithanya Garrepalli
be355211df qcacmn: initialize dp peer state lock before ast add
As DP peer state lock is used in add_ast API initialize
it before calling this API

Change-Id: I212449f6bd25b05241c35678f2d77f779f4fab4e
2020-09-16 02:33:17 -07:00
Naga
c4cd90a9c4 qcacmn: FR-64492 WDS Extended support
- Added data structure for wds ext peer
- Enhanced DP peer structure to maintain
  wds ext peer data structure, which inturn
  maintain pointer to osif device.
- Enhanced DP vdev structure to maintain feature
  configuration, which will be updated during vdev
  creation when feature is flag is set at control
  psoc.
- Enhanced cdp_vdev_param_type and cdp_config_param_t
  to set wds ext configuration into DP vdev
- Enhanced cdp_cmn_ops structure and corresponding
  call back definitons to get peer id, which will
  be saved in osif private structure and to set
  wds ext peer rx.
- Enhanced cdp_ctrl_ops to send event to control
  path when 1st 4 address frame is received from
  backhaul.

Change-Id: Ide0ea54e7b2d480ad646fb84b6e4e3108930f986
CRs-Fixed: 2773492
2020-09-15 07:19:50 -07:00
Srinivas Girigowda
a104d7b453 qcacmn: dp: Remove redundant __func__ from the logs
The logging macros implicitly takes care of embedding function name
in the log, hence there is no need to include __func__ again.
Getting rid of redundant __func__ reduces driver memory footprint.

Change-Id: I26bfac840ac6732ac83fb008db8e1702996eb21e
CRs-Fixed: 2774457
2020-09-15 02:45:47 -07:00
Mainak Sen
6f892d8f22 qcacmn: Enable hlos tid override on STA VAP
Enable hlos tid override support on STA VAP
as required for EasyMesh.

Change-Id: Idef271c2459cdb58847313ae04f09917b1858031
2020-09-14 09:55:22 -07:00
Chaithanya Garrepalli
3ac6dedea7 qcacmn: update peer reuse logic and add peer state lock
With new design, peer is deleted from hash table in
cdp_peer_delete. Hash table search in dp_peer_can_reuse
API at cdp_peer_create will always fail

Update the peer reuse logic to search from inactive list.

Insert peer to inactive list from cdp_peer_delete() and
in peer reuse case search in inactive list to get
peer.

Also add a new lock to protect peer state transition

Change-Id: I2e672fc4a9346c95d67716d437538dd0f96b2207
2020-09-11 13:55:42 -07:00
Rakesh Pillai
08e5f5bf9d qcacmn: Add cdp API to enable/disable SWLM
Add CDP APIs to enable or disable the Software
latency manager.

Change-Id: I1ec182e97a245ec5848660fa912eebe83cfba2fc
CRs-Fixed: 2769030
2020-09-10 03:15:13 -07:00
Rakesh Pillai
b6835a9413 qcacmn: Add support to dump SWLM stats
Add the support to print the software
latency manager statistics.

Change-Id: I7b6f77eefc6f4f800996dc868d41e7e0f7dd3331
CRs-Fixed: 2769020
2020-09-10 01:04:35 -07:00
Rakesh Pillai
21af5ba8cf qcacmn: Add data structures for SWLM
Add the necessary data structures for the
software latency manager.

Change-Id: Ibf55f0eef7ee6602b007de39a28f09c4622bd356
CRs-Fixed: 2769004
2020-09-10 01:04:20 -07:00