Commit graph

409 Commits

Autor SHA1 Nachricht Datum
Harsh Kumar Bijlani
e0e7eaeba6 qcacmn: Optimize Tx and Rx monitor stats update code
Optimize Tx and Rx monitor stats update code by replacing
multiple if checks with switch case statements

Change-Id: I07dd7784dccdfe0cf0e1ade822746d0c6f55cd95
CRs-Fixed: 3511037
2023-06-07 07:01:06 -07:00
aloksing
a0805fb4d0 qcacmn: Fix double free of frags
When decap type is invalid, freeing nbuf and while next monitor
buffer tlv picking last nbuf from queue. which has allocated frags
and valid data. expecting MPDU END TLV for previous mpdu
before monitor buffer tlv to allocate new nbuf.

Set rx_hdr_rcvd to false when we receive invalid decap type.

CRs-Fixed: 3503694
Change-Id: I97ede9e52df580769b78afc767ba9528914b3ea5
2023-06-05 03:40:10 -07:00
Mukul Dhiman
24fcc62ef2 qcacmn: Fix ol_stats enable if MLO is disabled for BE platforms.
On BE Platforms, currently if MLO is disabled, ol_stats does not
get enable on any soc. Fix is to enable ol_stats on particular
soc if MLO is disabled

Change-Id: I715f06776eda9539f68f440f86e3a403a6b14fa5
CRs-Fixed: 3508711
2023-06-02 16:50:02 -07:00
Jinwei Chen
5e84f6fe25 qcacmn: use right TLV tag header length for peach
In monitor mode, TLV tag header length should be 4 bytes for peach,
fix it.

Change-Id: I78beca168add8626c0fa99bfa407101ce4d36b30
CRs-Fixed: 3512227
2023-06-02 16:49:12 -07:00
Jeevan Kukkalli
958704d20e qcacmn: Make dp_rx_mon_append_nbuf function public
Function dp_rx_mon_append_nbuf is now accessed outside
the file where it is declared hence make it public

Change-Id: I6b596815a385ba367f70b9e5ea07c94520cca253
CRs-Fixed: 3488043
2023-05-29 12:54:57 -07:00
Yeshwanth Sriram Guntuka
4dc955351e qcacmn: Move prealloc DP descriptor types to QDF
Move prealloc DP descriptor types to QDF so that
the macros can be used in HIF layer.

Change-Id: I3de60876735e5aa37d80e9e698a86503b18574c1
CRs-Fixed: 3502615
2023-05-26 16:06:57 -07:00
aloksing
f5b6ab7666 qcacmn: Add check for sawf stats
Update deter stats only when sawf stats is enabled

CRs-Fixed: 3507349
Change-Id: I463750904cdec889274fb94ff1a0544545c1e0d0
2023-05-26 16:06:27 -07:00
Surabhi Vishnoi
d1895e091c qcacmn: Add support to parse HTT_PPDU_STATS_FOR_SMU_TLV
Currently NSS is required for packet capture mode to derive tx rate
and firmware sends NSS part of ppdu stats in new ppdu stats tlv
HTT_PPDU_STATS_FOR_SMU_TLV.
Add code to parse ppdu stats if feature is enabled via ini and
send the ppdu stats using wdi event to packet capture
component.

Change-Id: I5567007a91093dd342f37458760b3a61c040b778
CRs-Fixed: 3462436
2023-05-26 04:14:19 -07:00
Sushant Butta
c21470ebff qcacmn: Use monitor pkt tlvs and buffer size for monitor
Use monitor pkt tlvs size and monitor buffer size
instead of data pkt tlv size and data pkt buffer size
for York.

Change-Id: Ifc0d07ed96100ae79e81ac91bccd637e08d71e28
CRs-Fixed: 3494826
2023-05-22 00:10:31 -07:00
Santosh Anbu
4514cc3d43 qcacmn: Avoid resetting monitor buf ring size
Increasing the buf ring size for York is leading to memory corruption
issues.

Adding change to partially revert commit, specific for York alone.
I3099f6526aa11b353c8a5178de450d48f141a461

Change-Id: Ia9836bc982590fbeb14021dcc3b7bc7014d2fa36
CRs-Fixed: 3490257
2023-05-22 00:10:19 -07:00
Srinivas Girigowda
11edfc7c6d qcacmn: Do not apply lpc filter settings to HTT_RXDMA_HOST_BUF_RING
Local packet capture filter settings needs be to applied only to
HTT_RXDMA_MONITOR_STATUS_RING and not HTT_RXDMA_HOST_BUF_RING.

Change-Id: I2a2d2810407941310c88db551894806d0884d157
CRs-Fixed: 3501638
2023-05-20 04:03:47 -07:00
Srinivas Girigowda
c953dbb12d qcacmn: Avoid array out of bound access
Avoid array out of bound access by validating monitor channel band value.

Change-Id: I3b9c272e1fcf0d83a8d08884037af1eeed0a87ce
CRs-Fixed: 3501636
2023-05-20 04:03:37 -07:00
Srinivas Girigowda
6eaf41462a qcacmn: Add context to the logs
Logs without meaningful message or values serves no purpose in debugging.
Hence, add more context to the logs.

Change-Id: Ia463d239a9bf26f292a11bcc71cb1379374c45e4
CRs-Fixed: 3492593
2023-05-18 18:43:13 -07:00
Srinivas Girigowda
48cf24b446 qcacmn: Remove trailing newline from the DP Logs
Remove trailing newline from the DP Logs.

Change-Id: Iaf54e57fb44cf7c15d82bd5c0ffb3fc7c3d04a2b
CRs-Fixed: 3492501
2023-05-18 18:42:08 -07:00
Aniruddha Mishra
ba55e0f2a8 qcacmn: Add Tx TLV Recording support
Add Tx TLV recording support for monitor 2.0
Also add support to control Rx and Tx TLV
recording

Change-Id: I27a0d2c9ea8bdfacd46e6b7188b45b08ed47bbcd
CRs-Fixed: 3422787
2023-05-16 11:43:14 -07:00
Srinivas Girigowda
08ea5c2b80 qcacmn: Add support for local packet capture running
Add support for local packet capture running.

Change-Id: Id954c57a32210c180a8e0f9107e2469f96491173
CRs-Fixed: 3415816
2023-05-10 11:51:09 -07:00
Srinivas Girigowda
13554f0cdc qcacmn: Add support for local packet capture stop
Add support for local packet capture stop.

Change-Id: Ib12574f5b418ea009ec35ef85e170bc8c592c86f
CRs-Fixed: 3415812
2023-05-10 11:50:54 -07:00
Srinivas Girigowda
d52311a2b1 qcacmn: Replace IEEE80211_* macros with with QDF_IEEE80211_* macros
IEEE80211_* macros are defined in WIN specific header file which is not
available on MCL side, Hence replace these macros with QDF_IEEE80211_*
macros available in common header file

Change-Id: Ic2caaebacd9edded23aebefab87cd82dbbb06974
CRs-Fixed: 3415721
2023-05-10 11:50:41 -07:00
Srinivas Girigowda
5d8e550bb7 qcacmn: Add support for local packet capture start
Add support for local packet capture start and relevant changes.

Change-Id: I709e41e0be09cf73e93694efc59bfefbf51fe359
CRs-Fixed: 3415788
2023-05-10 11:50:28 -07:00
Srinivas Girigowda
980d883f07 qcacmn: Introduce HAL API to get phy ppdu id size
Introduce HAL API to get phy ppdu id size.

Change-Id: I125eb344787060336919fb361af032fddeb34526
CRs-Fixed: 3454206
2023-05-10 11:50:15 -07:00
Srinivas Girigowda
9c855c06e2 qcacmn: Separate out the implementation for RX 2.0 and TX 2.0
Separate out the common function implementing both RX 2.0 and TX 2.0
functionality in to RX 2.0 and TX 2.0 separate functions.

Change-Id: I29337aca9851dce1888a492a9534992277f595b5
CRs-Fixed: 3427301
2023-05-10 11:50:01 -07:00
Srinivas Girigowda
0e83621a7c qcacmn: Implement mon_ops to support RX 1.0 and TX 2.0
Currently WIN supports RX/TX 2.0 but MCC needs to support RX 1.0 and
TX 2.0. Hence implement the mon_ops callbacks as array of callback
pointers. Index 0 for 1.0 and Index 1 for 2.0.

Change-Id: I777b47be3af86f0b762b3563ef56204809a9a7ee
CRs-Fixed: 3427297
2023-05-10 11:49:48 -07:00
Srinivas Girigowda
ce736a1d8d qcacmn: Rearrange the functions to appropriate files
Rearrange the functions to appropriate files based on TX and RX 2.0.

Change-Id: Ie8e562a7aecdc91257210b55a323dfe47e67878c
CRs-Fixed: 3427296
2023-05-10 11:49:36 -07:00
Srinivas Girigowda
0419d28f6e qcacmn: Move TX 2.0 code under WLAN_PKT_CAPTURE_TX_2_0 macro
Move TX 2.0 specific code under WLAN_PKT_CAPTURE_TX_2_0 macro.

Change-Id: I20bb1e49a902ec085fbc3df6828fef94a7c577d6
CRs-Fixed: 3415780
2023-05-10 11:48:59 -07:00
Srinivas Girigowda
ec3b9bdbce qcacmn: Move cmn code under QCA_MONITOR_2_0_SUPPORT to TX/RX 2.0 macro
Currently QCA_MONITOR_2_0_SUPPORT macro is used for both TX and RX 2.0.
but on MCC side, only RX 1.0 is supported and as part of this feature
TX 2.0 need to be supported.
Enabling QCA_MONITOR_2_0_SUPPORT will enable both RX 2.0 and TX 2.0, but
to support RX 1.0 and TX 2.0, we need to separate out code under
QCA_MONITOR_2_0_SUPPORT to TX and RX 2.0 macro.

As part of this change, introduce separate macros for TX 2.0 and RX 2.0
and move the common code under both macros.

Change-Id: I7ef7e488800934291538a0bca9acd21e28901214
CRs-Fixed: 3415740
2023-05-10 11:48:32 -07:00
Jeevan Kukkalli
794367b541 qcacmn: Return missing link and mon desc and free associated buffers
It is observed that in some corner cases msdu count received
in montior destination ring descriptor is unreliable as a
result some of the link descriptor and associated monitor buf
descs are not returned. This change return such missing link/buf
descriptors and free associated buffers.

Change-Id: Iaad476b8e7a0372122981fd29c1f6e4685137817
CRs-Fixed: 3483157
2023-05-04 04:35:03 -07:00
Kenvish Butani
e8753b5a36 qcacmn: Fix ref leaks for vdev and peer
Fix ref leaks for vdev and peer in DP

Change-Id: If75b7dd1d96d211c2360ef65052e19e783c9ea40
CRs-Fixed: 3469902
2023-04-29 07:18:41 -07:00
Amit Mehta
5cfdbdb306 qcacmn: Force flush monitor destination ring
In the monitor mode case if some entry status entries are
not received then after the next monitor interface up host tries
to process pending old destination ring entries. As host drops
1 destination entry after processing 16 status entries if the entry
is not present in the status ring. which in case there is a high
number of old entries in the destination ring will result in the
destination ring getting full.

To fix the issue force flush monitor destination ring
during vdev delete.

Change-Id: Ie23a57add7b5bd372ab66f801e29e55cfacb5d4d
CRs-Fixed: 3411943
2023-04-27 21:29:30 -07:00
Himanshu Batra
08147113aa qcacmn: Update airtime stats last_update_time after the loop
The airtime stats last_update_time is getting updated within the loop
causing higher AC values to go out of sync.

Update airtime stats last_update_time after the loop

Change-Id: Icdb33335284e0a92b90c72099c18b6bc7690275c
CRs-Fixed: 3476253
2023-04-27 13:56:47 -07:00
Harsh Kumar Bijlani
2be2bf6a69 qcacmn: Fix memory leaks in Rx monitor path
Fix the following 2 memory leaks in Rx monitor path:

1. When MPDU queue is empty and MON_BUF_ADDR_TLV is received,
   then free page fragment memory.

2. In case of small size packets, 1 MPDU can have more than
   2*QDF_NBUF_MAX_FRAGS fragments wherein each nbuf can have maximum of
   QDF_NBUF_MAX_FRAGS frags. In this case, add the frags to nbuf in the
   following way.

   parent_nbuf (QDF_NBUF_MAX_FRAGS frags attached)
	|
	| (fraglist)
	|
	----> tmp_nbuf1 (QDF_NBUF_MAX_FRAGS frags attached) ----> tmp_nbuf2
							    (next)

Change-Id: I54e8162bf0b9da8629a3c80d123421fbeaf8df11
CRs-Fixed: 3453676
2023-04-27 04:08:30 -07:00
Naveen Gurujala
8a578fefe1 Revert "qcacmn: Add check for sawf stats"
This reverts Change-Id:	Ica417a53e91ebc8415f0f73c3c61b3b35e200de5

Change-Id: I304da02724d3ea97c61511b915a49513e87a55b7
CRs-Fixed: 3471399
2023-04-25 12:07:23 -07:00
Linux Build Service Account
93bac8788e Merge "qcacmn: Move mon mac filter func to mon ops structure" 2023-04-21 12:47:52 -07:00
Linux Build Service Account
956f3ba2c7 Merge "qcacmn: Fix pad byte place holder calculation" 2023-04-21 09:15:32 -07:00
Linux Build Service Account
f1a454c299 Merge "qcacmn: Add check for sawf stats" 2023-04-21 09:15:28 -07:00
Kannan Saravanan
20a57094a3 qcacmn: Initial changes for QCN6432 bringup in Common dev to DP
Add device Id and target type checks for qcn6432 target
compilation.

Change-Id: I4bc0fe66f9da9fb8be26fca8dc23524a4fb54009
CRs-Fixed: 3351564
2023-04-19 20:16:40 -07:00
aloksing
e7b42ae427 qcacmn: Add check for sawf stats
Update deter stats only when sawf stats is enabled

CRs-Fixed: 3471399
Change-Id: Ica417a53e91ebc8415f0f73c3c61b3b35e200de5
2023-04-19 10:28:23 -07:00
Jeevan Kukkalli
a913b30811 qcacmn: Move mon mac filter func to mon ops structure
Monitor ops functions are different for version 1 and 2.
Move mon mac filter func ptr to mon ops structure so that
its initialized properly according to monitor version.

Change-Id: Ie07ae3b7d3e9923e463db503aaa8b3500c1e1eac
CRs-Fixed: 3456620
2023-04-19 08:08:00 -07:00
Sushant Butta
aad187e304 qcacmn: Use monitor pkt tlvs and buffer size for monitor
Use monitor pkt tlvs size and monitor buffer size
instead of data pkt tlv size and data pkt buffer size.

Change-Id: I3099f6526aa11b353c8a5178de450d48f141a461
CRs-Fixed: 3406962
2023-04-18 12:10:42 -07:00
Srinivas Girigowda
3228443af7 qcacmn: Set Tx ring packet type flag properly
Currently, HTT Tx ring packet type flag is set as bitwise operation
which is incorrect and results in "Debug Assert Caught".

Set this CTRL and DATA packet type flag with a value of 1.

Change-Id: I62e89fe637441fcc680ea8d5fe8d157d8e7142ae
CRs-Fixed: 3415733
2023-04-14 08:24:44 -07:00
Srinivas Girigowda
7a5a84d777 qcacmn: Fix compile error 'address of array will always evaluate to true'
address of array 'tx_ppdu_info->hal_txmon.rx_user_status' will always
evaluate to 'true' [-Werror,-Wpointer-bool-conversion]

Change-Id: Ic148f34b82ce756eb07173b43f8f155a7b4a12d9
CRs-Fixed: 3415726
2023-04-14 08:24:33 -07:00
Jinwei Chen
075d9641ff qcacmn: fix dp_peer ref_cnt leak in CFR processing
dp_peer ref_cnt is increased in dp_rx_mon_populate_cfr_ppdu_info(),
but it does not release it at last, this leads to dp_peer ref_cnt
leak which then dp_peer memory can't be freed and corresponding dp_vdev
leaked as well.

release the ref_cnt for dp_peer at the end of
dp_rx_mon_populate_cfr_ppdu_info().

Change-Id: I8ac301609deb3790ad9f3d6eda85d502cede9799
CRs-Fixed: 3461642
2023-04-14 08:24:21 -07:00
Jeevan Kukkalli
2d6a71891c qcacmn: Fix pad byte place holder calculation
Fix pad byte place holder calculation during restitch

Change-Id: I577a9efe750ef519d2279d5e7426334549550628
CRs-Fixed: 3464890
2023-04-13 17:18:37 +05:30
nobelj
3e8ff635aa qcacmn: Add fix to check number of users
Add fix to check number of users to avoid overrun.

Change-Id: I00286db736d10ecfae6ca0c4bfc8850cc9b02178
CRs-Fixed: 3454011
2023-04-12 11:07:57 -07:00
Neha Bisht
af9bf76f1b qcacmn: Fix overrun issue of rx_user_info array
Fix overrun issue of rx_user_info array

Change-Id: I09b97f189e52a05aa42cdb0269385b5d9b497313
CRs-Fixed: 3451734
2023-04-06 10:38:46 -07:00
Sushant Butta
623d334801 qcacmn: Fix typo while getting ppdu_info
Use ppdu_free_list_elem while getting
free ppdu_info from kmem_cache.

Change-Id: I4ea921deb962dafd3f751954d6e7d2f1f98d3125
CRs-Fixed: 3455202
2023-04-06 10:38:34 -07:00
Harsh Kumar Bijlani
82afb1d8d2 qcacmn: Mask ppdu_id received in Tx HTT PPDU completion path
FW sends ppdu_id for every TLV in Tx HTT PPDU completion path.
This ppdu_id has 8 MSB bits filled with FW metadata which is different
for every TLV. Host uses this ppdu_id for list maintenance.
Presence of the FW metadata results in ppdu_id mismatch for different
TLVs even when they belong to the same PPDU.
Consider only LSB 24 bits for ppdu_id on host side.

Change-Id: Ic6ec780fe97f0597fcd841b33ac0dce33ad986c9
CRs-Fixed: 3445603
2023-04-05 09:04:11 -07:00
Aniruddha Mishra
dc75883972 qcacmn: Free buffer after processing flush_tlvs
Buffer was freed before processing the TLVs
(while flushing) leading to use after free access.

CRs-Fixed: 3425044
Change-Id: Ida3bcf9add95041c43b2b1e8e3450853bd0ed88c
2023-04-02 06:53:24 -07:00
Jeevan Kukkalli
785b786014 qcacmn: Reduce log level to avoid console flooding
Reduce log level to debug from error to avoid console flooding
when low mem condition is hit.

Change-Id: I0341beed9059c4db2eba2cc481a797d67dd35b25
CRs-Fixed: 3442503
2023-03-31 06:06:54 -07:00
Santosh Anbu
a9419151d6 qcacmn: Support MAC filtering for York platform
Add change to support MAC based filtering for York platform.

Change-Id: I4815c53f3d4babd11f3ebae95175d0ba0871aafe
CRs-Fixed: 3442299
2023-03-30 02:32:20 -07:00
Adwait Nayak
c2c736472a qcacmn: Subscribe RX PPDU START USER INFO TLV for pktlog modes
As of now, RX PPDU START USER INFO TLV is not subscribed as
part of pktlog. Since enable_ol_stats is set by default and
it subscribes RX PPDU START USER INFO TLV, we can see
RX PPDU START USER INFO TLV being available as part of pktlog
data. But recently, with all the automation testing scripts
it is decided to set enable_ol_stats to 0, hence subscription
of RX PPDU START USER INFO TLV is taken care during the filter
set up for all the pktlog modes.

Change-Id: Ib8c7e668a17fcb8e791784d29ef6f00fbdd2df34
CRs-Fixed: 3440721
2023-03-29 11:30:04 -07:00