Commit Graph

9257 次程式碼提交

作者 SHA1 備註 提交日期
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
Yeshwanth Sriram Guntuka
acc1ea0d14 qcacmn: Break from the desc_freelist loop on REO cmd enqueue failure
UPDATE_RX_REO_QUEUE commands are queued in the REO_CMD
ring as part of peer cleanup for each tid. The cb
registered defers pocessing the entries in the
reo_desc_freelist based on either number of pending
entries or time threshold. In the scenario when
these entries from the freelist are processed as part
of next disconnection and if the REO_CMD enqueue fails,
the while loop over reo_desc_freelist does not exit
and will end up in a perpetual loop.

Fix is to break from the desc_freelist loop on REO
cmd enqueue failure.

Change-Id: I18ee31ec6a6150cd6952903cc154634b7de4ce60
CRs-Fixed: 2751223
2020-08-13 08:22:34 -07:00
Jianmin Zhu
71ab2b7021 qcacmn: Use after free in wlan_mgmt_txrx_psoc_obj_destroy_notification
Avoid use after free in wlan_mgmt_txrx_psoc_obj_destroy_notification.

Change-Id: Ia686792fe1014b9d7ee7177622d68443ecf2620e
CRs-Fixed: 2751958
2020-08-13 08:22:30 -07:00
gaurank kathpalia
1c65e1b75b qcacmn: Handle assoc disallowed in MBO OCE IE
Handle the assoc disallowed case in MBO OCE IE
and remove candidate from the candidate list.

Change-Id: Ieb5ebdd9528a3179a215dcd5ce8083178ab68ae8
CRs-Fixed: 2753508
2020-08-13 06:13:37 -07:00
Shwetha G K
5ae97cd65b qcacmn: Add freeze_tlv_version in cfir_enh_dma_hdr
Add freeze_tlv_version in cfir_enh_dma_hdr where,
    version 1: Cypress/HastingsPrime which supports single user
               channel capture
    version 2: Maple/Spruce/Moselle which supports MU channel
               capture for up to 4 users
    version 3: Pine which supports MU channel capture for up to
               37 users

CRs-Fixed: 2741027
Change-Id: Iadd6dc2ff82030f502776ce35988b4472450337e
2020-08-12 19:53:23 -07:00
Alan Chen
07789085f8 qcacmn: Add an ini item for stats over QMI
Currently, stats over QMI features can only be disabled over build flags,
which is not flexible. Hence, add a CFG ini item to enable/disable stats
over QMI.

Change-Id: If5d57d2fc781fecc8817c2da8f61a2f7977d9c77
CRs-Fixed: 2752310
2020-08-12 19:53:19 -07:00
gaurank kathpalia
63854a8235 qcacmn: Fix compile and other issues in connect request
Fix minor compile and other issues in connect req in connection
manager

Change-Id: I6c5d3146f4022cc4d12ac847815bca311962400c
CRs-Fixed: 2753498
2020-08-12 19:53:16 -07:00
Yu Wang
1761e41191 qcacmn: return error if the callback for spectral is NULL
The callback function for spectral may be not registered,
add checking before calling the function, return -ENOTSUPP
if it's NULL.

CRs-Fixed: 2751658
Change-Id: If04fb360cd4ef89f5c8ce007786d636110cb02df
2020-08-12 17:48:11 -07:00
Saket Jha
8a35dcfc63 qcacmn: Check for allocation failure in rx ring history
Add allocation check failure before accessing index in
dp_soc_rx_history. In case of allocation failure for a particular ring,
continue with allocation and history recording of other rings.

Change-Id: Ifae46ddf38b3af271900651cdbba662325220ef9
CRs-Fixed: 2747891
2020-08-12 17:48:08 -07:00
Subrat Mishra
ba8f08dd4e qcacmn: Support to set PPDU stats for ATF Stats
Add TxOps and RxOps functions for ATF to set PPDU stats.

CRs-Fixed: 2709102
Change-Id: I4ceacbe8f3abe44dbbc56d2a7bbe75b0c8d5ca45
2020-08-12 13:56:46 -07:00
Jia Ding
c07761e4cc qcacmn: Fix static code analysis issues in DP
In dp_srng_init, max_buffer_length and prefetch_timer are used
while uninitialized.

In dp_bucket_index, overrunning array cdp_sw_enq_delay leads to
out-of-bounds access.

In dp_rx_defrag_fraglist_insert, cur is first NULL checked but
cur is again set to qdf_nbuf_next and is accessed without
NULL check. Thus do a NULL check again before dereferencing
cur to avoid potential NULL pointer dereference.

In htt_t2h_stats_handler, soc could be NULL while cmn_init_done
is dereferenced. Thus fix it by NULL check soc first and then
dereference cmn_init_done.

Change-Id: Ie6a33347d34862f30ba04a10096d3892af7571d3
CRs-Fixed: 2751573
2020-08-12 13:56:42 -07:00
Amruta Kulkarni
2f48b53345 qcacmn: Prevent link down for SAP on DFS channel
For SAP on DFS channel, the PCIe link down should be prevented
so that HalPhy can access DDR memory to report Radar found event.

Change-Id: I5eb1076196c509f0279781dbe3269d62132aeabc
CRs-Fixed: 2712800
2020-08-12 13:56:38 -07:00
Edayilliam Jayadev
fa65000c6b qcacmn: Add helper APIs to check scan radio capabilities
A new BDF option is added for scan radio boards to disable/enable DFS
detection. This flag is advertised to host via scan radio capabilities
TLV in ext2 service ready event. If customer sets the BDF so that DFS
need to be disabled, host skips the CAC timer and ignores the Radar
detection event. This change adds the following APIs.

1) Check given radio is a scan radio
2) DFS needs to be enabled/disabled for scan radio

CRs-Fixed: 2746779
Change-Id: Iabd34261aaa1067c7bbb76677aebcc8a3f89de43
2020-08-12 08:47:45 -07:00
Edayilliam Jayadev
e0f284b015 qcacmn: Process scan radio capabilities TLV
FW advertises scan radio capabilities as part of service ready
ext2 event. This is an optional TLV, presence of which indicates scan
radio support for the that pdev.

CRS-Fixed: 2746769
Change-Id: I5a0231c54375e9f00c85f0ad92839e2fa6c79f39
2020-08-12 08:47:42 -07:00
Rakesh Pillai
1de57c2150 qcacmn: Handle the duplicate entries in reo exception ring
We have come across scenarios where rxdma is pushing
a certain entry more than once to the reo exception
ring. In this scenario, when we try to unmap a buffer,
it can lead to multiple unmap of the same buffer.

Handle this case, by skipping the process of this
duplicate entry, if alrady unmapped, and proceed to the
next entry.

Change-Id: Iae66f27e432f795ba4730911029fa1d63a75cb06
CRs-Fixed: 2739176
2020-08-12 06:42:21 -07:00
Subrat Mishra
9b715c34c5 qcacmn: Retrieve per PPDU phy tx duration
Add support to retrieve per PPDU phy tx duration without response time.
Add support to retrieve per User phy tx duration for MU-MIMO and OFDMA.

These metrics are useful for ATF stats feature. Stats processing done
only if atf stats flag is set.

CRs-Fixed: 2709102
Change-Id: I90db41aa45843808e07343a80750c154abbde9cd
2020-08-12 06:42:17 -07:00
Shivani Soni
c4c0a179f6 qcacmn: Monitor Status ring memory optimization
Memory optimization of monitor status ring by allocating buffers during
replenish using alloc_skb (linux API).
It creates buffer of required size rather than 4k size(dev_alloc_skb)

Change-Id: I3ae5e403de28c4570f8ac3b50d3ca878a9e4b2f9
CRs-Fixed: 2733931
2020-08-12 06:42:13 -07:00
gaurank kathpalia
bd6a237677 qcacmn: Serialize connect and disconnect request
Serialize connect and disconnect request in CM

Change-Id: I7eacafaf2fb1c71d7c42a493d4acb855f399c698
CRs-Fixed: 2750754
2020-08-11 16:08:09 -07:00
gaurank kathpalia
6a2f984c06 qcacmn: Add get candidates logic in connection manager
Adds get candidates logic in Connection manager.

Change-Id: I852b0bfab51f9914734181e4f748ef962d63b8b7
CRs-Fixed: 2749185
2020-08-11 16:08:06 -07:00
Ankit Kumar
1f948cbb6b qcacmn: Process mon dest buffer via nr_frag
Process mon destination buffer via nr_frags
if RX_MON_MEM_FRAG is enabled.

Change-Id: If49132b129e01f6a248544134ac9d9457aa2072d
CRs-Fixed: 2741789
2020-08-11 16:08:03 -07:00
Ankit Kumar
526bbe81de qcacmn: Handle frag based ops based on rx_Desc_pool flag
Rx desc pool have a flag to identify whether frag or nbuf
operation needs to be performed for alloc, map, prep and
free buffer for monitor dest buffer.

This flag will be set only for mon destination desc pool,
if RX_MON_MEM_FRAG feature is enabled.
In all other case, It will be set to Zero and default nbuf
operation will be taken.
This flag get initialized at the time of pdev rx_desc_pool
initialization and gets reset while pdev deinit.

Mon destination buffer will have support for frag if
RX_MON_MEM_FRAG flag is set.

Change-Id: I67c6c823ee4f114035b884c024a1a9054a40665b
CRs-Fixed: 2741757
2020-08-11 14:09:08 -07:00
Edayilliam Jayadev
37a135ca9e qcacmn: Add an API to check given vdev is a special vap
Add an API to check given vdev is a special vap.

CRS-Fixed: 2746740
Change-Id: Ic42ed105ef8051ae0bef6baba0920626bef854f0
2020-08-11 14:09:04 -07:00