Commit Graph

9278 Commits

Author SHA1 Message Date
Himanshu Batra
486612addf qcacmn: Add timestamp info in Vdev SM history
Add timestamp info in Vdev SM history

Change-Id: I5c3c5da2e48fccc5f85802c9021bd060f940a243
CRs-Fixed: 2756819
2020-08-20 10:07:35 -07:00
Chaithanya Garrepalli
ddc9e59e8f qcacmn: Add VDEV refcount debug support
Add debug support for VDEV refcount to take
refcount by module id and decrement corresponding
refcount with same module id

Change-Id: I15c075816994ba70155fefbc0bce208b20fb9a59
2020-08-20 10:07:32 -07:00
Chaithanya Garrepalli
a718007f03 qcacmn: increment vdev refcount for search by id
Add new API dp_vdev_get_ref_by_id() which will return vdev
pointer by holding a reference. Caller of this API has
to ensure that this reference is released by calling
dp_vdev_unref_delete() API

New lock soc->vdev_map_lock is introduced to protect
vdev id to object array

Change-Id: I883e328932e35ef31254125492dbae20cebe0e00
2020-08-20 10:07:28 -07:00
Rajasekaran Kalidoss
afac78b33d qcacmn: Add length check for twt additional parameters
Add length check in additional parameters extracted from
WMI_TWT_ADD_DIALOG_COMPLETE_EVENTID.

CRs-Fixed: 2755498
Change-Id: I913547bad8a1f823a01ff36f22dbe3d305e533bc
2020-08-20 08:00:50 -07:00
Rajasekaran Kalidoss
8841346dcb qcacmn: Enhancements to the TWT attributes/parameters (vendor command)
This commit does the following enhancements to the TWT interface:

Corrects the documentation for QCA_WLAN_TWT_SUSPEND and
QCA_WLAN_TWT_TERMINATE. Specifies that these operations carry the
parameters obtained through QCA_WLAN_VENDOR_ATTR_CONFIG_TWT_PARAMS. This
interface is very recently introduced and missed to document the same.
There are no user space or driver components using this interface yet.
Hence, enhancing/modifying the interface.

Corrects the documentation for
QCA_WLAN_VENDOR_ATTR_TWT_SETUP_WAKE_DURATION. Mentions that the units it
represent is a multiple of 256 microseconds rather than a TU. The host
driver always interpreted this as an unit in 256 microseconds and there
are no user space implementations that are impacted with this change in
the unit. Hence, modifying the documentation.

Introduces QCA_WLAN_VENDOR_ATTR_TWT_RESUME_NEXT2_TWT_SIZE, which is
similar to that of QCA_WLAN_VENDOR_ATTR_TWT_RESUME_NEXT_TWT, but carries
an offset/data of u32 size.

Introduces MAC_ADDR attribute to represent the peer for the TWT setup
and resume operations.

CRs-Fixed: 2755972
Change-Id: I1c43b9942489177af9b48639d1cb4fd20dfdd80b
2020-08-20 08:00:47 -07:00
Amar Singhal
74bb674e39 qcacmn: Use per channel maximum regulatory bandwidth
Per channel maximum regulatory bandwidth depends on country
bandwidth settings and the reg-domain bandwidth settings.
Therefore, take channel bandwidth into account in channel
bonding calculations.

Change-Id: I9d206c2fd8c5535eba813ac1da2878592ef5019b
CRs-Fixed: 2729638
2020-08-19 01:57:57 -07:00
Manjunathappa Prakash
cb751d11c1 qcacmn: Bypass PN check for open security mode defrag frames
Do not do PN check for open security mode defrag frames as it
is not applicable.

Change-Id: I7ed1073953c08b191c15c659a0d216eb7ed49b31
CRs-Fixed: 2753520
2020-08-18 23:55:54 -07:00
Ruben Columbus
f1973b22d7 qcacmn: Add fix to support frame control for MU ctrl frame
frame control for second and subsequent user are zero which overide the
master frame control. Added fix to update master frame control from user
position zero.

Change-Id: Ic0331dd5d486fbffa44d29c74b4f1f15414d0a65
2020-08-18 14:43:39 -07:00
Adwait Nayak
5e8254061e qcacmn: Modify data type of timestamp
The 'timestamp' field in CFR meta data corresponds to TSF
at the reception of PPDU in micro second unit. To capture
timestamp for one shot, periodic and repetitive channel
capture, this field is being used.

case 1:
For one shot and periodic capture, the clock used for
timestamp is private to the target and not visible to host.
So it is being passed by FW to host and the placeholder
being exchanged between Host and target is of 32 bit.

case 2:
In case of repetitive channel capture, the
timestamp is being populated from the received PPDU,
which is 64bit.

To accommodate the timestamp, in both above cases, change
the data type to u_int64_t from u_int32_t

Change-Id: Ifa612bd97dc4f597368daefcd4224b84f2484c03
CRs-Fixed: 2751408
2020-08-18 14:43:35 -07:00
Adwait Nayak
d4ef2e3959 qcacmn: Fetch cfr info from PHYRX & RXPCU ppdu end tlv
HAL changes to fetch cfr information from
PHYRX_PPDU_END_TLV & RXPCU_PPDU_END TLV

Change-Id: I5817fdc5d17ebea3f2376b7bef9e58981198d1ec
CRs-Fixed: 2752943
2020-08-18 14:43:32 -07:00
Adwait Nayak
9b8183fef6 qcacmn: Enable CFR support for IPQ5018
Enable CFR support for IPQ5018.
Calculate stream FS buffer length based on CFR payload,
CFR uCode header and CSI metadata.

Change-Id: Idd903ead75d635ce87ffc0df80e5c32fb62d15aa
CRs-Fixed: 2751408
2020-08-18 14:43:27 -07:00
Adwait Nayak
a265096932 qcacmn: Change data type of modified_in_curr_session
Repetitive channel capture configurations usually support
16 groups to be confugured. To check if a particular group
is enabled by user, qdf_test_bit is being used here.

qdf_test_bit usually operates with uint32_t and it takes
the argument as unsigned long type. Since,
modified_in_curr_session is declared as uint16_t, and then
typecasted into unsigned long.

Change the data type of modified_in_curr_session
from uint16_t to 'unsigned long' to avoid compiler
issues.

Change-Id: Iec778dc36d5671f2cfb643c9ced1bd2a6104de2b
CRs-Fixed: 2753267
2020-08-18 11:01:05 -07:00
Vignesh Mohan
cb9f7ad948 qcacmn: Add APIs to find preCAC status of the given channel
Introduce DFS utils APIs to find preCAC status of the given
channel.

Change-Id: If47411af82b43b9dcff04ba2f84cdb10ec9ca1f1
2020-08-18 11:01:02 -07:00
Mohit Khanna
27f16faa4d qcacmn: Exclude HTT metadata length when not in use during TX
Currently, when an extension descriptor is used during TX datapath, we
use HTT metadata length + msdu extension descriptor length, even we
do not fill HTT meta data. This is inefficient and hardware will end up
doing DMA of extra HTT metadata, even when not needed.
Include length of metadata in TCLdata command only if HTT metadata is
filled in.

Change-Id: Idd1b053c1c6bd8b39880efe5743980667454df0d
CRs-Fixed: 2738733
2020-08-17 22:02:35 -07:00
Vijay Krishnan
8461a8d5cd qcacmn: Do not skip CAC if Spoof test is not complete
In Dependent Repeater, if the Repeater STA is connected to a Root-AP
in a DFS channel, then the Repeater AP which is configured in ETSI
domain comes up in the DFS channel doing CAC.

In FCC domain, whenever Spoof radar pulse comes, we check if the Spoof
check is done and skip the CAC accordingly. In case of other domains,
Spoof events are not present. Therefore, Spoof test can be always
considered complete for non-FCC domains. Also the test can always be
considered complete if the target/FW does not support spoof test.

CRs-Fixed: 2756845
Change-Id: Icac4dee5f3f69a2578a0a34d7aea9456aab63ece
2020-08-17 15:12:22 -07:00
Harsh Kumar Bijlani
d47e448d58 qcacmn: Implementation of SKB Frag Debug Framework
SKB frag debug framework is required for debug purpose of frag based
approach in monitor mode

Change-Id: Ic7a5a2c3d7397c4d7dd2c5db32802b0f694e6101
CRs-Fixed: 2736136
2020-08-17 10:07:25 -07:00
Arun Kumar Khandavalli
ffaafd74ef qcacmn: Correct the tlv length of the hangdata
The Tlv of the hang data is reduced to 2bytes from the 4bytes
change the structure defnitions accordingly.

Change-Id: I675e4d837afa92496aeebec408ebfd90cbb7ad32
CRs-Fixed: 2753821
2020-08-17 08:06:33 -07:00
Arun Kumar Khandavalli
d564955d05 qcacmn: Trim the hang data size as per requirement
Trim the hang data as per the customer data size requirement.

Change-Id: I5a5d848f820ddeaa721dba176e67dba97fed7a71
CRs-Fixed: 2751370
2020-08-17 08:06:29 -07:00
Sridhar Selvaraj
dd33cca37f qcacmn: Increase scan age timeout to 90 seconds
Increase scan age timeout to 90 seconds for emulation
platforms.

Change-Id: I96c6efd26355b786a38c0ae6da5e37e0aa642ee0
2020-08-17 03:26:19 -07:00
Ramanathan Choodamani
fe082ae00d qcacmn: MSCS Procedures - Get the MSCS parameters
This change will acquire MSCS parameters from the
MSCS request sent by the STA and provide it to the
data path which will later use it for building flow
database.

Change-Id: I972154792c682527f8df04de693077188726e8da
CRs-Fixed: 2669386
2020-08-16 23:07:06 -07:00
Rhythm Patwa
759a833fdc qcacmn: Add API to get target capability for Preamble Puncturing Tx
Add API to get target capability for 'Preamble Puncturing Tx'

Change-Id: Ieb09bb4920112b52caf567381efb380e21d9c5cb
2020-08-16 15:03:03 -07:00
Rajeev Kumar
b23bb8b6f2 qcacmn: Increase spin lock bh timeout threshold in defconfig builds
In defconfig build(QDF_LOCK_STATS = 1 for slub debug enabled) increase
spin lock bh max time allowed to 2 seconds to accommodate for cache thrashing
and slow execution because of many debug features getting enabled.

Change-Id: I817d63a264079d25fed8a7ba1dbd9db5391abcdd
CRs-Fixed: 2754993
2020-08-15 18:55:22 -07:00
Ashish Kumar Dhanotiya
dc2d337116 qcacmn: Fill correct max BW to set channel params
Currently wifi positioning api to update channel bandwidth
info is invoking regulatory component api to set the channel
params with BW as CH_WIDTH_MAX, because of which regulatory
component is returning the maximum BW supported for the current
regdomain which is 160MHz. If target does not support 160MHz in
that case it may lead to undefined behavior.

To address this issue, pass max supported BW by target as
argument to regulatory component so that regulatory component
does not return the BW greater then the target supported BW.

CRs-Fixed: 2730665
Change-Id: I6051336ab2f3ea902a70ed80290e5a5f060de5b9
2020-08-15 16:56:10 -07:00
Pragaspathi Thilagaraj
ca77085fc5 qcacmn: Copy rssi threshold value for Periodic roam scan trigger
The driver doesn't copy the current rssi threshold for the
periodic roam scan trigger.

Copy the rssi threshold value for Periodic roam scan trigger
also.

Change-Id: I6745d5d6e011299d3fee9f89785083138b330183
CRs-Fixed: 2752991
2020-08-15 15:01:39 -07:00
Ananya Barat
f878c39090 qcacmn: Make init of dfs->dfs_soc_obj independent of the macros
With the current implementation dfs->dfs_soc_object was initialized in
function dfs_agile_soc_obj_init under the macro QCA_SUPPORT_AGILE_DFS
and ATH_SUPPORT_ZERO_CAC_DFS both of which are disabled for the low
memory profiles. Hence the dfs->dfs_soc_obj was not initialized for these
profiles, this led to a crash when the following access was made in
dfs_is_true_160mhz_supported and dfs_is_restricted_80p80mhz_supported.

psoc = dfs->dfs_soc_obj->psoc
Fix this by unconditionally initializing the dfs->dfs_soc_obj in
wlan_dfs_pdev_obj_create_notification.

Change-Id: I3438464e8efedaf2d62a68bbcf1bda5ee0579deb
2020-08-15 11:12:30 -07:00
Chaithanya Garrepalli
9b6f765f74 qcacmn: Use sa_peer variable to get source peer
While getting source peer in dp_ipa_intrabss use
sa_peer and release reference accordingly


Change-Id: I4011b10ee03bcb25af6eafa84dec5db8f840c112
2020-08-15 01:26:32 -07:00
Chaithanya Garrepalli
3ecfd5005c qcacmn: used id based search instead of mac search
As index based search is protected with refcnt now
reverting the changes which are added as a WAR to protect
peer memory

Change-Id: Iac837d45d0d4b2509bbf7d60401d9497c0d998b0
2020-08-15 01:26:29 -07:00
phadiman
9a47fcc650 qcacmn: Pass module ID to get peer reference
New approach requires module IDs to be passed to
acquire and release peer references

Hence pass module ID to acquire and release the
peer reference

CRs-Fixed: 2755560
Change-Id: Id351179da68f6ca30f13710a47575f3ff550ada3
2020-08-15 01:26:26 -07:00
Chaithanya Garrepalli
e2b00339f3 qcacmn: add APIs to iterate the peers at vdev level
Add new APIs to iterate through the vdev peer list
by taking the peer reference.

A call back has to be passed to these APIs which will
be called for every peer in the lisst

dp_vdev_iterate_peer() -> iterates through peer_list of vdev
dp_pdev_iterate_peer() -> iterates through peer_list of all
                          vdevs in pdev
dp_soc_iterate_peer() -> iterates through peer_lists of all vdevs
                         in soc

Additonal APIs are added to for itearations where the callback
will be called outside the vdev->peer_list_lock, as these APIs
have additional memory allocations suggested to use only in case
the iteration need to happen outside lock

dp_vdev_iterate_peer_lock_safe()
dp_pdev_iterate_peer_lock_safe()
dp_soc_iterate_peer_lock_safe

Change-Id: I24632fe611355cc3e93b7f16d90913d4b8686ca9
2020-08-15 01:26:23 -07:00
Chaithanya Garrepalli
1322dc7949 qcacmn: add state to data path peer
Add states to data path peer and appropriate
checks for transistion of states

Change-Id: Ieaadbf4b406351d48aece7fd3552abe42d61db1e
2020-08-15 01:26:20 -07:00
Chaithanya Garrepalli
f4701f13ec qcacmn: remove peer backpointer in DP ast entry
Remove the peer backpointer in ast entry and store
peer_id instead

Assign peer_id in AST entry in AST MAP event,
also add the ast entry to peers ast list

In AST map & AST unmap APIs use ast find by vdev_id

Change-Id: I74d9828dc309149d98f6f577b5c8304cb087fd76
2020-08-15 01:26:17 -07:00
Chaithanya Garrepalli
fdc6a808ae qcacmn: add module id for peer reference
Add support to get the peer reference with module id

To help debug the peer reference related issues

Change-Id: Ie20c7e710b9784b52f2e0f3d7488509282528a00
2020-08-15 01:26:14 -07:00
Chaithanya Garrepalli
113841906c qcacmn: increment refcount for peer find by id
Use unified version of dp_peer_find_by_id API
which will take peer reference

Also use unified peer ref release API dp_peer_unref_delete

Change-Id: Ibb516a933020a42a5584dbbbba59f8d9b72dcaa4
2020-08-15 01:26:10 -07:00
Chaithanya Garrepalli
e253cee043 qcacmn: Peer refcount FR update DB as per new design
Update peer DB as per new design

peer_hash_table: add at peer_create and delete at peer delete
peer_id_to_obj_map: add at peer map and delete at peer unmap
peer_list: vdev level peer list add at peer create delete at
	   peer delete

Call dp_peer_cleanup() at unmap event

dp_peer_cleanup -> dp_peer_tx_cleanup -> Tx capture cleanup
	|
	---------> dp_peer_rx_cleanup -> Cleanup Rx REO TID queues &
					 defrag queue free

Introduce ref_cnt variable per VAP which will be
incremented and decremented at peer alloc and free. This counter
will be used to delay the vdev free if there are any active
peers for vdev exist in system

Change-Id: Iec13bceed0db0db71655fdbf6f96df8795b5077b
2020-08-15 01:26:07 -07:00
Chaithanya Garrepalli
86d3df0605 qcacmn: use granular locks to protect peer structures
Remove the global soc->peer_ref_mutex lock to protect
peer access

Instead use granular locks to protect the individual
peer DBs

1) soc→peer_hash_lock : To protect peer hash table
2) soc→peer_map_lock : To protect id to objmap array
3) vdev→peer_list_lock : To protect vdev level peer list

Change-Id: I9f044c4d71fe1155817a2b22a5a050545ec37445
2020-08-15 01:26:03 -07:00
Srinivas Girigowda
5e4c6f6b29 qcacmn: qdf: Introduce QDF_MAC_ADDR_FMT and QDF_MAC_ADDR_REF
Introduce the feature to hide 2nd, 3rd and 4th octet of the
MAC address in the logs.

To enable this feature set CONFIG_WLAN_TRACE_HIDE_MAC_ADDRESS to y.
For example, if this feature is enabled, then
mac address ae:45:9c:f1:c0:98 shall be printed as ae:**:**:**:c0:98

If this feature is disabled, then QDF_MAC_ADDR_FMT translates to
"%pM".

Change-Id: I7b3823d33748120b0fa5eb372f7957de59760536
CRs-Fixed: 2751002
2020-08-14 23:06:23 -07:00
Sandeep Puligilla
41c1a2eb43 qcacmn: Fix the 6Ghz MBSSID connection failure
DUT failed to associate to 6Ghz non-tx profile
because the non-tx scan entry generated in driver
got corrupted HE IE's.

Modified scan logic to take care of HE IE's while
generating the scan entry for NON-TX profile.

Change-Id: I071bb6a1f98b38262677aedf5d4de7782ca7403a
CRs-Fixed: 2735121
2020-08-14 21:06:34 -07:00
phadiman
3df84438dd qcacmn: Add CDP API to get peer wlanstats ctx
Peer wlanstats context was accessed directly from
PPDU cookie, with this approach the cookie pointer
may become stale if peer goes for deletion

Hence access the wlanstats context using CDP API
with stats context protection

CRs-Fixed: 2740261
Change-Id: I54c785325f8852ad422f05527b98ebca6e4d6cf0
2020-08-14 14:44:25 -07:00
Abhishek Ambure
d4b5e25e98 qcacmn: Update proper band to mac param in INIT cmd
Host updates band to mac params and sends to FW in INIT command, FW uses
it to configure MACs. If host configures DBS in INIT command param but
FW doesn't advertise wmi_service_dual_band_simultaneous_support service
then host does not configure band to mac params in INIT command and let
the FW initialize MACs with default value.
As FW supports DBS and at the same time doesn't advertise
wmi_service_dual_band_simultaneous_support, host configures band to mac
params for only one MAC i.e. MAC0. FW either expects both the MACs
configuration from host or both not configured. If host configures only
one MAC, second MAC i.e. MAC1 configure remains empty. FW crashes as it
starts operation on MAC1. Hence host doesn't configure band to mac params
in INIT command.

Change-Id: I00104d7e6b911e0f792597346629b3c77c102c70
CRs-Fixed: 2752248
2020-08-14 14:44:21 -07:00
Himanshu Batra
07d99bea43 qcacmn: Add API to check vdev INIT state
Add API to check if vdev is in INIT state.
Also add api to iterate vdev list and test/set flag if
vdev is in init state

Change-Id: Idfc4268fd166a583de45a0f166ff5d0ac8ec660e
CRs-Fixed: 2755257
2020-08-14 12:34:48 -07:00
Hariharan Basuthkar
e808bb0cce qcacmn: Add 6G support for DFS Random channel selection
Add 6G support for DFS Random channel selection to move to a 6G target
channel in the event of a radar on a radio that supports both 5G and
6G channels.

Change-Id: I1ad65b36feba65b6bbc3affc243aae1beb12960c
CRs-Fixed: 2727958
2020-08-14 10:23:04 -07:00
Alok Kumar
9949f46e04 qcacmn: Use DEFERRABLE_WORK instead of DELAYED_WORK for BUS BW
For static display case, BUS BW work periodically wakes up the
APPS because bus bw work is created as DELAYED_WORK.
This has the power impact in case of static display.

Use DEFERRABLE_WORK instead of DELAYED_WORK for bus bw work.
DEFERRABLE_WORK won't wake up the APPS periodically in static
display case.

Change-Id: Id812907cc6962ab7a9bb2ce8a7417ca0546363ab
CRs-Fixed: 2748373
2020-08-14 08:13:01 -07:00
Yu Tian
a1264e5fea qcacmn: Fix static code analysis issues in DP
hdr_ptr is in skb_buffer data, it's assigned with 6B array,
use uint8_t point convert to avoid SA overflow warnning.

tid has asseration protect, but need to break execute to avoid
of SA warnning

Fix use-after-free of ast_entry

Change-Id: I0835f93291cf3da2b4fd57d8c9a90f20a60c11ee
CRs-Fixed: 2751678
2020-08-14 08:12:58 -07:00
Min Liu
44150359c9 qcacmn: Move get_peer_info into cp_stats component
Move WMI_REQUEST_PEER_STATS_INFO_CMDID related statistics into
cp_stats component.

Change-Id: Ie57f64e4ee195de30271260887c48ecf76f4a2ff
CRs-Fixed: 2680626
2020-08-14 04:12:25 -07:00
Edayilliam Jayadev
697ceba7e1 qcacmn: Add pdev flags related to scan radio
Add pdev flags to indicate

1) scan radio support
2) DFS disable, This flag is valid only for a scan radio pdev.

CRs-Fixed: 2753799
Change-Id: I2e875b0233bd1c5bf5421821c35170f3412a582a
2020-08-13 22:06:07 -07:00
Arun Kumar Khandavalli
45a38684b0 qcacmn: Check if the scheduler thread is already flushed
During the module initialization the scheduler thread and the
init thread run in parallel if there is a failure in the error
path, the scheduler thread is not aware and still sending
the messages to firmware resulting in system instability.
So, Disable the scheduler as soon as there is an error in the init path
and the same scheduler thread in the normal existing error path.

If the scheduler_disable  is called multiple times the infinite wait
for result will get the init thread struck.

Change-Id: I39782bc88d49dac2e2138c235c4666ea4f4f2faf
CRs-Fixed: 2754023
2020-08-13 22:06:04 -07:00
Nitin Shetty
279435cff4 qcacmn: clearing jitter statistics
adding support for clearing jitter statistics
for command "cfg80211tool athX txrx_stats 257"

Change-Id: Iaac9a6e6a849bbb08935ca581fa58c93ef51bdbd
2020-08-13 17:12:45 -07:00
Rajasekaran Kalidoss
9faef79402 qcacmn: Additional TWT attributes for response path and resume
Introduce additional attributes for the TWT response parameters from the
host driver. Also, add ATTR_TWT_RESUME_FLOW_ID for TWT Resume request.

Change-Id: I9fb2d2382acd5d82f8a3322c369d5e580a0a1442
CRs-Fixed: 2751902
2020-08-13 12:43:03 -07:00
Shwetha G K
31533ab3d9 qcacmn: Update signal strength calculation logic to consider -ve SNR
Update the signal strength calculation logic in CFR to consider
negative SNR i.e., a signal below the noise floor.

CRs-Fixed: 2753751
Change-Id: I2e2b95cc2ac2cf50ad5b7e38977ab971ddeb1ecf
2020-08-13 10:33:13 -07:00
Pragaspathi Thilagaraj
0df12365ac qcacmn: Add FILS crypto API for rIK generation
Replace the lim_default_hmac_sha256_kdf() & lim_create_fils_rik()
API  with crypto API since both these API are primarily for
cryptographic derivation of re-authentication integrity key(rIK)

Use the new crypto APIs qdf_default_hmac_sha256_kdf(),
wlan_crypto_create_fils_rik() for this.

Change-Id: I1c8f38ee0124b8b3eb527d4b01d39add134e181b
CRs-Fixed: 2752635
2020-08-13 10:33:09 -07:00