Currently, add_rtap_ext flag which is used to update the tx_flags in
radiotap header is set for both TX and RX data/mgmt packets which
is wrong.
This change fixes the code to not set the add_rtap_ext flag for RX data
and management packets so that tx_flags is not filled in radiotap header
of RX data and management packets.
Change-Id: I9c5a28c9bd47c2567af5ddb3e8e9c95463fe710f
CRs-Fixed: 3639248
Offload TX data packets such as ARP response, EAPOL during roaming are
sent by firmware through HTT msg if packet capture mode is enabled.
Whenever any such packet is received via HTT msg, host inspects the
ether type of the packet and matches with the TX filter set by user
via vendor command. If the ether type matches with the TX filter set
by user, then host forwards that packet to packet capture mode interface
otherwise, drops it.
To inspect the ether type of any packet, host uses generic API which
expects packet to be in SKB format. Currently, whenever any offload
TX data packet is received in HTT msg, host wrongly passes the buffer
received in HTT msg instead of SKB to APIs expecting SKB buffer.
This leads to undefined behavior.
So, to fix above issue, whenever any offload TX data packet received,
first allocate the SKB, copy the payload buf of HTT msg which is TX
packet to SKB data and then pass that SKB to the generic APIs to get
the ether type.
Additionally, this change fixes the minor logging error.
Change-Id: If09d49d8a1dcc04ca81454fc262bb5789a0f56be
CRs-Fixed: 3613594
User can set following combination of configs in vendor command for
packet capture mode:
1. PKT_CAPTURE_MGMT_CONNECT_NO_BEACON: to receive all mgmt frames but
no beacons
2. PKT_CAPTURE_MGMT_CONNECT_NO_BEACON + PKT_CAPTURE_MGMT_CONNECT_BEACON +
connected_beacon_interval : to receive all other mgmt frames and only
connected SSID beacons at particular intervals
3. PKT_CAPTURE_MGMT_CONNECT_NO_BEACON +
PKT_CAPTURE_MGMT_CONNECT_SCAN_BEACON: to receive all other mgmt
frames and beacons only during scan.
But with current condition connected SSID or scan beacons config will
not be sent to FW as host checks for PKT_CAPTURE_MGMT_CONNECT_NO_BEACON
config only. Also, on reception of any beacon, host checks for only
PKT_CAPTURE_MGMT_CONNECT_NO_BEACON and if it is set, host drops the
beacon which is wrong.
So, enhance the conditions to send config to FW as well as
remove the condition on reception of any beacon so that connected SSID or
scan beacons are forwarded to packet capture interface when connected
beacon interval config or PKT_CAPTURE_MGMT_CONNECT_BEACON or
PKT_CAPTURE_MGMT_CONNECT_SCAN_BEACON is set by user in vendor command
along with PKT_CAPTURE_MGMT_CONNECT_NO_BEACON config.
Change-Id: I246b175f1c88ed45214527880ba14cdc17bf8206
CRs-Fixed: 3604708
Whenever packet capture mode is enabled, all packets are forwarded
to host from firmware which causes frequent wakeups if WOW suspend is
allowed. This leads to flooding of WMI transactions due to WOW
suspend/wakeup and other WMI events due to packet capture mode over CE.
So, to reduce number of WMI transactions due to frequent suspend and
then wakeup due to enablement of packet capture mode, acquire a
wakelock and prevent runtime suspend whenever packet capture mode is
enabled.
Change-Id: I71b73e7327e14890dc8509b81b22e8b5611cbac6
CRs-Fixed: 3603566
Due to limitation uCode always filling SGI as long in
rx_msdu_start_tlv.
This change is to update SGI for VHT Rx data packet which is
extracted from WMI_VDEV_SMART_MONITOR_EVENTID.
Change-Id: I5fcdc463ea2a6d83253e39cc377a2471aeb4e133
CRs-Fixed: 3459106
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
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
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
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
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
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
Add check for CONFIG_ARCH_PARROT to enable packet capture
compilation for parrot.
Change-Id: I9eab0c37f5a4a849ed6e340bb8b26153030ad5b6
CRs-Fixed: 3377226
The kernel-doc script identified a multitude of documentation issues
in components/pkt_capture, so fix them.
Change-Id: I9fc7922978cbfacf3f8a733561dd0f94c6cea3b4
CRs-Fixed: 3359684
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
In packet capture component change enum pkt_capture_mode
from value to bit map.
Change-Id: Ic777b5091e85ed8c906d7e855b5cadb0fa3319d5
CRs-Fixed: 3048502
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
Deliver management and control tx packets to monitor interface
only if corresponding filter is set by vendor command.
Change-Id: Ifc7f0ecfce7d7a105902e8a9ce522ba0325ee9cd
CRs-Fixed: 3044855
Deliver management and control rx packets to monitor interface
only if corresponding filter is set by vendor command.
Change-Id: I9aeb8071cfc6207359f8d7ec74af2a21e2742d1e
CRs-Fixed: 3044857
Deliver data packets to monitor interface only if
corresponding filter is set by vendor command.
Change-Id: Ibf24349d17d1e649819447b1cde36a834e5579a4
CRs-Fixed: 3046233
This commit adds check for data tx and rx packets based on vendor
command received from user.
Change-Id: Ieddb96d8778131ec5876c55462b518e1db552f57
CRs-Fixed: 3046231
Add tgt support in packet capture component to send user
configured beacon report interval to FW.
Change-Id: Ibeb9f9a7f9ad2c2afa6929c492bd1029784b5f9e
CRs-Fixed: 3046224
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
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
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
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
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
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
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
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
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
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