Commit Graph

103 Commits

Author SHA1 Message Date
Surabhi Vishnoi
89dbd6c655 qcacld-3.0: Fix data rate for mgmt tx packets in packet capture mode
Currently, data rate for management tx packets is filled only as
1 or 6 Mbps which is wrong.
Sniffer expect data rate multiple of 2. Hence fill the data rate with
multiple of 2 for tx management packets which received from firmware
and converting into mbps.

Change-Id: I5dd6515804cd3751925af0992a30a7441ebf9bbb
CRs-Fixed: 3444177
2023-05-23 19:53:44 -07:00
Surabhi Vishnoi
e413c1a012 qcacld-3.0: Test PKT_CAPTURE_REGISTER_EVENT bit before processing packets
Currently, packet capture packets are processed until the mon list
is empty. There can be situation that while mon list is not empty and
mon thread is running, mon interface is deleted and as part of it 
PKT_CAPTURE_REGISTER_EVENT is cleared. After clearing the bit, interface
deletion will wait for completion of mon_register_event and flush the
remaining packets in mon list without processing them. In this case 
as mon thread is already running and processing the packets from mon list
without check for PKT_CAPTURE_REGISTER_EVENT bit, it may lead to
timeout in deletion of mon interface in case of high throughput scenarios.

To avoid this situation, add a check to test PKT_CAPTURE_REGISTER_EVENT
each time before processing a packet from mon list.

Change-Id: I21e7adc0149c2330f6008d54db8576ca705f2b55
CRs-Fixed: 3475349
2023-05-16 11:42:49 -07:00
Balaji Pothunoori
4466690e00 qcacld-3.0: Fix ofdm and cck flag info for mon mode data packets
Currently cck and ofdm flags are filled wrongly for monitor
mode data packets based on preamble and wireshark deriving
incorrect phy type for 11G & 11B.

This change is to update cck and ofdm flags based on packet
type.

Change-Id: I5fcdc463ea2a6d83253e39cc377a2471aeb4e144
CRs-Fixed: 3447567
2023-04-04 05:07:02 -07:00
Balaji Pothunoori
ad21e755af qcacld-3.0: tx rate update for data packet in legacy modes
Currently, For legacy modes monitor mode reporting incorrect tx rate
for data packet in radiotap header due to packetcapture_hdr rate
is hardcoded as '0'.
This change calculates the data rate of legacy packets using mcs
reported in tx completion.

Change-Id: I2a651b8fb36947672bd30f8a635f0e643219e520
CRs-Fixed: 3442376
2023-04-04 05:06:55 -07:00
Balaji Pothunoori
40d5be7c3f qcacld-3.0: update mcs value for HT and VHT mode for mon mode
Currently monitor mode HT & VHT data packet tx rate is not
matching with ota packet tx rate due to incorrect mcs value.

This change is to update proper mcs value for HT & VHT modes.

Change-Id: Ib4fb06a06ce35a4e8e683e5a22c8be226492b13f
CRs-Fixed: 3442509
2023-04-04 05:06:49 -07:00
Surabhi Vishnoi
19348c7d14 qcacld-3.0: Do input validation for beacon interval in packet capture mode
Beacon interval set from the vendor command in packet capture mode
should be greater than connected AP's beacon interval otherwise it
nth beacon value will be calculated as 0. So add a condition to
validate the value of user configured beacon interval before sending
it to firmware. Reject the connected beacon interval configuration in
packet capture mode if its value is not 0 and less than AP's beacon
interval.

Change-Id: I4b90ed239d54c5d59142a7a7b70c65b7df80a469
CRs-Fixed: 3423534
2023-03-15 17:40:57 -07:00
Vulupala Shashank Reddy
5d291699ed qcacld-3.0: Enable packet capture compilation for parrot
Add check for CONFIG_ARCH_PARROT to enable packet capture
compilation for parrot.

Change-Id: I9eab0c37f5a4a849ed6e340bb8b26153030ad5b6
CRs-Fixed: 3377226
2023-02-05 12:40:30 -08:00
Jeff Johnson
139cf10b44 qcacld-3.0: Fix Packet Capture Documentation
The kernel-doc script identified a multitude of documentation issues
in components/pkt_capture, so fix them.

Change-Id: I9fc7922978cbfacf3f8a733561dd0f94c6cea3b4
CRs-Fixed: 3359684
2022-12-27 21:14:10 -08:00
Roopavathi Lingampalli
fcb513f88f qcacld-3.0: Add Component APIs for required ucfg APIs in DP component
When component dependent functions calling from higher
modules or any other components, it uses ucfg APIs pattern.
Calling ucfg dependent APIs is acceptable for higher modules
like HDD, OSIF but for another components like DP to avoid
using ucfg APIs here, implementing component APIs for existing
ucfg APIs to other components like MLME, TDLS, Pkt capture in
DP component module.

Change-Id: Ib8857eeca6a88810d7875312ff6dc14ffb60bc70
CRs-Fixed: 3351486
2022-12-13 14:06:07 -08:00
Jeff Johnson
66902adf96 qcacld-3.0: components: pkt_capture: Fix misspellings
Fix misspellings in components/pkt_capture/...

Change-Id: Ib56201fd25e3c11b79be1fa83a70cc9f7d006e59
CRs-Fixed: 3303637
2022-10-04 20:34:31 -07:00
Rajesh Chauhan
7a91ba9a6a qcacld-3.0: replace complete_and_exit with kthread_complete_and_exit
In kernel 5.17, complete_and_exit is replaced with
kthread_complete_and_exit. So if kernel version is >= 5.17,
then use kthread_complete_and_exit.

Change-Id: I8b5ed5bbeade9d2044e375695e6e15208e10147d
CRs-Fixed: 3297438
2022-10-03 18:58:54 -07:00
Vulupala Shashank Reddy
44e5285e67 qcacld-3.0: Fix the channel for M2 packet in pkt capture mode
Currently in packet capture, channel for data packets is updated
from pdev. We are updating channel in pdev when we receive auth
frame in mon thread. But, sometimes we are updating channel in
radiotap of M2 in pkt_capture_update_tx_status, before mon thread
process auth packet and update channel in pdev, because of
which we are updating wrong channel in M2.

So, to avoid this move update of channel from mon thread to
pkt_capture_mgmtpkt_process.

Change-Id: Icf14c4331849ad7cfdfbd7a3043e4e4dc3d33721
CRs-Fixed: 3266890
2022-09-08 14:00:01 -07:00
Azmath Mohammed
0105fcdd46 qcacld-3.0: Fix for code error
Add missing break after the update of ret variable.

Change-Id: Ib9c54575d97d26f05239a2fb44a87a63440b9bdf
CRs-Fixed: 3277218
2022-09-07 16:34:13 -07:00
Dundi Raviteja
ea7b73b001 qcacld-3.0: Reinitialize mon_register_event before wait_for_completion
Reinitialize mon_register_event before wait_for_completion
to make sure that it waits for fresh completion.

"done" variable in struct completion increments in
complete() API and decrements in wait_for_completion() API.

In wait_for_completion() API, if "done" value is 0 then
it will wait for the completion else it will continue without
waiting.

If reinitialization is not done, there is a possibility that
wait_for_completion() may continue without waiting.

Change-Id: I780103f551938438f27a11b006cc7c3e6edc6820
CRs-Fixed: 3251876
2022-08-23 00:49:05 -07:00
Dundi Raviteja
bc660b9e93 qcacld-3.0: Use correct API to unsubscribe pkt_capture wdi event
Use cdp_wdi_event_unsub() to unsubscribe
PKT_CAPTURE_RX_NO_PEER_SUBSCRIBER in
pkt_capture_wdi_event_unsubscribe().

Change-Id: I43575df1402611d468b8523bf948d2dc86f31dd7
CRs-Fixed: 3260272
2022-08-10 04:04:03 -07:00
Vulupala Shashank Reddy
45cfd4b5fc qcacld-3.0: Fix the channel for M2 and M4 packets
Currently in packet capture, channel is updated from connection
manager. Connection manager channel is updated only after
roam is done, because of which for EAPOL tx packets old
connection freq is filled during roam from one AP to other.
So we are seeing previous AP freq in EAPOL tx packets
captured during roam.

So to avoid this fill freq in data tx packets from pdev
which will get update when auth frame is received.

Change-Id: I251c4dd084b459b7c85e80c5f7ad717d561c09ae
CRs-Fixed: 3248305
2022-08-03 01:33:56 -07:00
Vulupala Shashank Reddy
487a76179b qcacld-3.0: Fix vdev reference count in packet capture
In pkt_capture_datapkt_process and pkt_capture_mgmt_rx_data_cb
pkt_capture_vdev_put_ref is missing in error case, because of
which vdev ref count is not becoming zero when vdev is down.

Add pkt_capture_vdev_put_ref in all the error cases.

Change-Id: I55353356f059a367d57c64625f404e3940235be1
CRs-Fixed: 3228599
2022-07-15 11:51:24 -07:00
Aravind Kishore Sukla
d7823c2688 qcacld-3.0: Initialize bssid variable
Uninitialized variables in pkt_capture_process_tx_data()
and pkt_capture_callback() may lead to Unpredictable behaviour.

Initialize corresponding bssid variables to avoid it.

Change-Id: I1ca6e7e04c8920111414a83c29cb61883b72370c
CRs-Fixed: 3241885
2022-07-12 18:55:06 -07:00
Vulupala Shashank Reddy
7309dbf3db qcacld-3.0: Send correct Nth beacon config to FW in pkt capture
Currently, when user sets pkt capture beacon capture config
using vendor command, both nth beacon interval and connect
beacon config is sent to firmware. This leads to reception
of all beacons even if nth beacon interval is configured.

Whenever nth beacon interval and connect beacon is configured
from user, firmware expects host to not send connect beacon
config to FW. This change also adds Nth beacon filter check
for beacons in packet capture management rx path.

Change-Id: I046a282c5f79598b686c4fd95554e2330c6bfb39
CRs-Fixed: 3150806
2022-05-02 00:04:38 -07:00
Vulupala Shashank Reddy
014ec22131 qcacld-3.0: Avoid compilation error when pkt capture enabled
Currently tso_desc moved from dp_tx_desc_s to dp_tx_ext_desc_elem_s,
so make corresponding change in pkt capture to avoid compilation
error when pkt capture is enabled.

Change-Id: I18260c5df0872470b2309e31e8d2011f5fac70d1
CRs-Fixed: 3156011
2022-04-29 04:12:45 -07:00
Surabhi Vishnoi
ef1f94f9d5 qcacld-3.0: Fix deadlock scenario in packet capture mode
Ppdu_stats are received from firmware in softirq context.
While inserting the ppdu_stats into a qdf list, a spinlock
is held for its access, same qdf list is accessed by mon
thread using spinlock. There can be a scenario in which
mon_thread held spinlock for accessing qdf_list and is
interrupted by softirq in which ppdu_stats are received.
This leads to softirq spinning for lock forever leading
to deadlock.

To address this issue, use spin_lock_bh instead of spin_lock.
Also reduce the time for which lock is taken to access the list
for insertion and removal of ppdu_stats.

Change-Id: I52171fe3c1d22a1e9d1ab36daac54d8fa2b96020
CRs-Fixed: 3136901
2022-02-27 23:46:06 -08:00
Vulupala Shashank Reddy
b5e2542a4d qcacld-3.0: Add support for qos null filters in packet capture
Add support to send qos null frames received from firmware on
STA interface to mon interface based on config value. The config
value get update based on vendor command set by user.

The packet filter check in ucfg_pkt_capture_process_mgmt_tx_data
moved to target_if_mgmt_offload_data_event_handler. So that we
will not allocate any buffer if filter is not set.

Change-Id: I426b340c5a65711ada971062af95ae039d18d0bd
CRs-Fixed: 3076241
2021-12-22 14:06:50 -08:00
Vulupala Shashank Reddy
e27ae3edd3 qcacld-3.0: Fix phy type for mgmt rx packets in pkt capture mode
In packet capture mode currently the cck and ofdm flags are
filled by checking phy mode received from FW. But now FW is
sending below rate codes instead of phy mode. So update the
check in host to check rate code and based on rate code fill
cck and ofdm. The proper filling of cck and ofdm will help
Wireshark to derive correct phy type in the packet capture.

WIFI_HW_RATECODE_PREAM_OFDM,
WIFI_HW_RATECODE_PREAM_CCK,
WIFI_HW_RATECODE_PREAM_HT,
WIFI_HW_RATECODE_PREAM_VHT,
WIFI_HW_RATECODE_PREAM_HE,

Change-Id: Ie9b38dd403a0bf39397ff22e80dd24dfa152fdcd
CRs-Fixed: 3079456
2021-12-21 01:09:59 -08:00
Vulupala Shashank Reddy
3c92b7d541 qcacld-3.0: Fix signal strength for mgmt rx pkts in pkt capture
In qdf_nbuf_update_radiotap rssi is filled based on flag
DP_MON_RSSI_IN_DBM. When this flag is enabled
qdf_nbuf_update_radiotap is expecting rssi value in dbm.

So fill rssi_comb based on flag DP_MON_RSSI_IN_DBM.

Change-Id: I9a6542cc27a5e19072e89ae78ff05f4392c64157
CRs-Fixed: 3083133
2021-12-21 00:02:12 -08:00
Vulupala Shashank Reddy
17b4a5b9d6 qcacld-3.0: Add ref count for global vdev used in packet capture
Currently the global vdev gp_pkt_capture_vdev used in packet capture
does not have ref count.

Add ref count for global vdev used in packet capture component.

Change-Id: I1cc619b31c81a77af0842ce219cfcc96060626a0
CRs-Fixed: 3049225
2021-12-15 06:27:02 -08:00
Vulupala Shashank Reddy
5c72b5aded qcacld-3.0: Change ops from vdev specific to psoc level
Currently in packet capture component the tx and rx ops are
stored in vdev but the ops should be only per psoc and
the ops will be registered only once per psoc. So change
tx and rx ops from vdev specific to psoc level.

Change-Id: I09e9dd5d83e7b10c86e80ebf2584469071060813
CRs-Fixed: 3049207
2021-11-28 22:16:57 -08:00
Surabhi Vishnoi
2634d52576 qcacld-3.0: Add support for beacon filters in packet capture mode
Add support to send beacon received from firmware on STA interface
to mon interface based on management rx filters set by user in
vendor command.

Change-Id: I186ab0d697da831894854d7680265e82dd3adcef
CRs-Fixed: 3073478
2021-11-23 18:17:43 -08:00
Vulupala Shashank Reddy
aa2bded170 qcacld-3.0: Change enum pkt_capture_mode to bit map
In packet capture component change enum pkt_capture_mode
from value to bit map.

Change-Id: Ic777b5091e85ed8c906d7e855b5cadb0fa3319d5
CRs-Fixed: 3048502
2021-11-23 16:56:47 -08:00
Surabhi Vishnoi
6cdd0dd785 qcacld-3.0: Deliver tx offload mgmt pkts based on filter
Deliver tx offload management to mon interface in packet capture
mode based on config filters added by vendor command.

Change-Id: Id60529b963e3021d7744858980b316b546606550
CRs-Fixed: 3045460
2021-10-07 09:19:43 -07:00
Surabhi Vishnoi
f830f1fc71 qcacld-3.0: Add check for mgmt/ctrl tx packets in pkt capture
Deliver management and control tx packets to monitor interface
only if corresponding filter is set by vendor command.

Change-Id: Ifc7f0ecfce7d7a105902e8a9ce522ba0325ee9cd
CRs-Fixed: 3044855
2021-10-07 09:19:38 -07:00
Surabhi Vishnoi
aa11b6825c qcacld-3.0: Add check for mgmt/ctrl rx packets in pkt capture
Deliver management and control rx packets to monitor interface
only if corresponding filter is set by vendor command.

Change-Id: I9aeb8071cfc6207359f8d7ec74af2a21e2742d1e
CRs-Fixed: 3044857
2021-10-07 09:19:34 -07:00
Vulupala Shashank Reddy
b1e8b3f39e qcacld-3.0: Add filter for data packets in packet capture mode
Deliver data packets to monitor interface only if
corresponding filter is set by vendor command.

Change-Id: Ibf24349d17d1e649819447b1cde36a834e5579a4
CRs-Fixed: 3046233
2021-10-05 09:52:04 -07:00
Vulupala Shashank Reddy
f29e867e6b qcacld-3.0: Add check for data tx rx based on vendor command
This commit adds check for data tx and rx packets based on vendor
command received from user.

Change-Id: Ieddb96d8778131ec5876c55462b518e1db552f57
CRs-Fixed: 3046231
2021-10-05 05:06:38 -07:00
Vulupala Shashank Reddy
15f71d055b qcacld-3.0: Add tgt support to send beacon report period to FW
Add tgt support in packet capture component to send user
configured beacon report interval to FW.

Change-Id: Ibeb9f9a7f9ad2c2afa6929c492bd1029784b5f9e
CRs-Fixed: 3046224
2021-10-05 05:06:33 -07:00
Vulupala Shashank Reddy
e5e7e8049f qcacld-3.0: Add support to send config to FW based on filter
In packet capture component add support to send ctrl and beacon
frames config to FW based on frame filter received from user through
vendor command.

Change-Id: Ie45ea2135e237a156fb60663e3f85cc601490e4a
CRs-Fixed: 3046222
2021-10-05 05:06:28 -07:00
Vulupala Shashank Reddy
76dfbb1112 qcacld-3.0: Add support to send mode to FW based on frame filter
In packet capture component add support to send data and mgmt
mode to FW based on frame filter received from user through
vendor command.

Change-Id: Ib6d0d8abe53c29ea6c52900c628d87b603baf1e3
CRs-Fixed: 3046220
2021-10-05 05:06:23 -07:00
Vulupala Shashank Reddy
924b163c6c qcacld-3.0: Set frame filter based on vendor command
Currently, packet capture mode frame filter configuration
is done based on ini. This change enables user to set the
packet capture mode frame filter configuration at runtime
through vendor command
QCA_NL80211_VENDOR_SUBCMD_SET_MONITOR_MODE.

Change-Id: Ifd40a9295394324b0cde4ff15bb55ea77851a6bc
CRs-Fixed: 3046091
2021-10-01 07:51:51 -07:00
Vulupala Shashank Reddy
edb92df199 qcacld-3.0: Fix PHY type of rx legacy packets in packet capture
OFDM and CCK flags should not be set based on frequency. These
flags are already filled in pkt_capture_rx_get_phy_info based
on preamble.

Change-Id: Ie809ee2e3546ed69bedab12d73d408b379d6b73d
CRs-Fixed: 2965290
2021-09-20 02:01:12 -07:00
Vulupala Shashank Reddy
d593e54614 qcacld-3.0: Do not fill average rssi for RX packets
Currently average rssi is filled in rx packets as rssi not
available in rx tlv, but now ucode is providing rssi value
in rx tlv so do not fill average rssi as rssi is already
filled from rx tlv in packet capture component.

Change-Id: I67e5e4cf6f0eade0640012802d79fe92b87de001
CRs-Fixed: 3022166
2021-09-17 08:45:10 -07:00
Vulupala Shashank Reddy
4da65b82c1 qcacld-3.0: Update the channel only if AUTH resp is successful
Currently channel is updated whenever AUTH frame is received
irrespective of its status. So in case of unsuccessful AUTH
wrong channel is updated in pkt capture mode.

To fix this issue, update the channel only if AUTH response
is successful. Also if after AUTH success, association or
reassociation fails update the channel with last connected
channel.

Change-Id: I51ee6bb2466f765ce6058c411b0dc0ab74a0dd04
CRs-Fixed: 2987748
2021-09-07 10:42:59 -07:00
Vulupala Shashank Reddy
9a9225232b qcacld-3.0: Unsubscribe in reverse order of subscription
Ideally we should deinit in reverse order of init so we
should Unsubscribe in reverse order of subscription in
packet capture component.

Change-Id: Icb62a14c2d1fd20073f6924d03d523b7871c62d6
CRs-Fixed: 3019862
2021-09-07 07:58:49 -07:00
Surabhi Vishnoi
d24b3c4526 qcacld-3.0: Fill the nss in tx status in pkt capture mode
Currently, nss is not filled for tx data packets. Fill the
last received nss from ppdu stats in the tx status in pkt
capture mode.

Change-Id: I1833be5e19eaba4e88befe9970f079b91ec4bbe4
CRs-Fixed: 3004484
2021-09-06 00:54:49 -07:00
Surabhi Vishnoi
e850d08b1f qcacld-3.0: Fill the ppdu stats in tx status in pkt capture mode
Ppdu stats related to transmitted msdu are received from
firmware and queued to a list. Remove the received ppdu stats
from front of list and fill in tx status of current msdu.

Change-Id: I764aa909497971010202ce3decb3380a732ce12c
CRs-Fixed: 3004483
2021-09-06 00:54:44 -07:00
Surabhi Vishnoi
98bf0f00c3 qcacld-3.0: Register for wdi event WDI_PKT_CAPTURE_PPDU_STATS
WDI_PKT_CAPTURE_PPDU_STATS event is sent when packet capture
related htt ppdu stats tlv is received from firmware.
Register for WDI_PKT_CAPTURE_PPDU_STATS wdi event and add
logic to insert received ppdu stats to a list.

Change-Id: Ie78cf4b161c90a0bcf514a3e71a82c3c3e358c24
CRs-Fixed: 3004480
2021-09-06 00:54:39 -07:00
Surabhi Vishnoi
2bef5e1a61 qcacld-3.0: Register for WDI_EVENT_PKT_CAPTURE_RX_DATA_NO_PEER
Register for WDI_EVENT_PKT_CAPTURE_RX_DATA_NO_PEER in packet
capture mode and add logic to parse it. This wdi event
delivers rx data packets to packet capture component which are
received before peer is mapped in host, mostly in roaming scenario.

Change-Id: Ia718293c97dd11de6aab5a739683eec38e7e057b
CRs-Fixed: 3000153
2021-09-06 00:54:35 -07:00
Vulupala Shashank Reddy
843ce5f0eb qcacld-3.0: Remove unused linux header file
Remove unused linux header file in packet capture component.

Change-Id: I668061d0a6516cca51a153e3713e8c0a5634fb64
CRs-Fixed: 3019885
2021-08-27 05:44:36 -07:00
Surabhi Vishnoi
a8dd8d7845 qcacld-3.0: Fix compilation error due to change in hal api
HAL_RX_DESC_GET_80211_HDR is replaced by hal_rx_desc_get_80211_hdr
api. Due to this compilation error is seen.

Fix this by using new api hal_rx_desc_get_80211_hdr instead of
HAL_RX_DESC_GET_80211_HDR.

Change-Id: I52bbae9d1a58cb13c8e6706a47e300db824251f3
CRs-Fixed: 2992548
2021-07-27 09:24:04 -07:00
Surabhi Vishnoi
60cebbb9e9 qcacld-3.0: Fill correct 802.11hdr in rx data pkts in pkt capture mode
All msdu's which are received in single mpdu will have same 802.11
header. Hardware fills header of only first msdu. So copy the
first msdu's header to all msdu's which are received in single
msdu in packet capture mode.

Change-Id: I1c9fd55e571eda77be0ab0863e03cd61b848b842
CRs-Fixed: 2968770
2021-07-14 02:05:02 -07:00
Surabhi Vishnoi
0d47f72dee qcacld-3.0: Fill Coding and STBC in HE data of radiotap header
Fill the Coding info and STBC in HE data field of radiotap
header for TX data packets in packet capture mode.

Change-Id: I173ce1846259ee9e94587e360256161f8147df08
CRs-Fixed: 2984436
2021-07-12 14:20:18 -07:00
Vulupala Shashank Reddy
761caac574 qcacld-3.0: Fix channel freq for EAPOL M1 in packet capture
Some times there is delay in update of channel freq in vdev
because of which M1 channel freq is zero during initial
connection.

Fill freq from msdu start from rx_pkt_tlv.

Change-Id: Ia0a8f61c9113fbe5bc3ad932dcb67111b86629af
CRs-Fixed: 2964512
2021-07-08 02:38:38 -07:00