Commit Graph

9783 Commits

Author SHA1 Message Date
Mohit Khanna
98181d9ccc qcacmn: Flush reg write work before bus suspend
Delayed register write work needs to be flushed before bus suspend to
make sure there are on pending writes after driver's bus suspend routine
exits. In case delayed work context is not able to finish before the bus
(PCI) is suspended (DRV), it may lead to a NOC error.

Change-Id: I40cbcec5d23ddd75ec87aed69ac45d95510fa880
CRs-Fixed: 2813733
2020-11-09 22:57:51 -08:00
Vignesh Mohan
dc6fecf304 qcacmn: Do not use preCAC timer check for Rolling CAC
While checking for the radar source, the status of preCAC timer
is used to check if rolling CAC is active or not.

However, rolling CAC uses a different timer which results in
radar during rolling CAC to be treated as radar in home channel.
Check for preCAC timer only if agile preCAC is enabled.

CRs-Fixed: 2811313
Change-Id: I1f41e4fb83213abb8fd93531174063fad339f3b7
2020-11-09 22:57:47 -08:00
Yu Ouyang
ee22cac551 qcacmn: Also update passive scan dwell in concurrent mode
In concurrent mode active scan, both active and passive scan dwell
time should be updated. Because FW will use passive scan dwell for
DFS channel scan. If it still is default value 110ms, DFS channel
scan will spend much time. AP KPI will drop much.

So, for active scan, update passive and active scan dwell together
in concurrent mode.

Change-Id: I9ceb4ece6da2a794fff3b87c7be3214a9dbc46ab
CRs-Fixed: 2790910
2020-11-09 09:16:59 -08:00
Ananya Gupta
ea977dc41c qcacmn: Count htc packets failed or not freed in misclist
HTC packets were mapped but not unmapped or freed. As part of
hdd_wlan_stop_modules(), all nbufs will be freed in misclist
and TxQueue.
Adding debug change to count number of htc packets failed to
send and count number of nbufs in misclist are skipped when
freeing them.

Change-Id: I868621a67cf89d9b84e202843990f576973ec334
CRs-Fixed: 2807407
2020-11-09 00:57:56 -08:00
Santosh Anbu
a958936486 qcacmn: Set bssid hint config in INI/CFG
Add change to enable bssid hint scoring for candidate selection in
connection manager.

Change-Id: I40a120781c93bf8fb09ec9591a94ee1484bb1a0c
CRs-Fixed: 2801397
2020-11-08 22:53:17 -08:00
Vivek
8ceed6b2bc qcacmn: Check for valid vdev queue for serialization
While removing command from serialization, it is possible
that with the last command removal of a vdev,
the vdev could be deleted and before attempting the
movement of command from pending vdev queue to active queue,
we need check if the serialization vdev object is valid.

Add a check to ensure that serialization vdev object is
valid before trying to move command from pending to active
for a vdev.

CRs-Fixed: 2807736
Change-Id: Iea6df72eeeb62b7868f30337e7da99039df8b23a
2020-11-08 22:53:12 -08:00
Yu Tian
e8889ab6b7 qcacmn: Refine code about ME buf's freeing
Part of change in 3382883 are deleted
unintentionally. Add them back

Change-Id: I2d806c800f0a238e154297c2e1c3b2fd56608252
CRs-Fixed: 2813756
2020-11-08 20:53:45 -08:00
Edayilliam Jayadev
f4001e93ea qcacmn: Remove host assert in Spectral Rx path
In Pine 160/165 MHz following are the expected sequence of events.
    1. Start scan WMI command
    2. FW param WMI event
    3. Direct DMA completion WMI events
If 3 and 2 happens in the reverse order (i.e., host receives a direct
DMA completion event before receiving a FW param WMI event), host assert
will be triggered.

This change removes the assert and drops the Spectral reports till
FW param WMI event is received.

CRs-Fixed: 2812403
Change-Id: I537d0077737baab8d3a8e90bdc4f9138690010bc
2020-11-06 22:50:52 -08:00
Abhinav Kumar
2bce1a8132 qcacmn: Print roam related info in kmsg
The event WMI_ROAM_STATS_EVENTID is received after
every roam, once the roam synch complete is sent by the host.
This event contains details regarding the btm response.

This helps to debug the scenario when roam failure happen.

Print the info received related to roam scan type & roam status
info into kmsg.

Change-Id: I7c01d482e3152dfbf500dba97001c328f39564de
CRs-Fixed: 2812515
2020-11-06 06:02:00 -08:00
Sandeep Puligilla
a5235578f7 qcacmn: Remove unused psoc private object
Interface manager is not using the psoc private
object structure. Remove the allocate and attach code
in psoc create and destroy code.

Change-Id: I9450052345769ef6627d76731b2b51b5414bd146
CRs-Fixed: 2811077
2020-11-06 03:57:35 -08:00
sheenam monga
3cb0095f11 qcacmn: Don't unregister WLAN_UMAC_COMP_IF_MGR during init
Currently WLAN_UMAC_COMP_IF_MGR is deregistered during
initialization of WLAN_UMAC_COMP_IF_MGR . During deinitalization
wlan_if_mgr_deinit tries to unregister WLAN_UMAC_COMP_IF_MGR which
may introduce errorneous behaviour as WLAN_UMAC_COMP_IF_MGR is already
unregistered.

Fix is not to unregister WLAN_UMAC_COMP_IF_MGR during initialization.

Change-Id: I0ee117b9fa7b48df8a5edb4217971553dc1c4a49
CRs-Fixed: 2802673
2020-11-06 03:57:31 -08:00
Srinivas Dasari
5a1b8f00f1 qcacmn: Define dummy APIs for 6g sort APIs
6g sorting APIs scm_sort_6ghz_channel_list and scm_add_rnr_info
are under define FEATURE_6G_SCAN_CHAN_SORT_ALGO. This is not
enabled for WIN platforms, which results in compilation error.

Also, allocate memory to hold tmp_list_count no.of 6g channels
rrm info instead of MAX_6GHZ_CHANNEL.

Also, do duty cycle scan in connected state as well. Full scan
including 6g PSC and non-PSC channels in connected state would
take lot of time. So, it's better to do duty cycle scan in
connected state as well.

Change-Id: I6e2622c49012237929c5e952c32d44c087851928
CRs-Fixed: 2810923
2020-11-05 18:25:24 -08:00
Srinivas Dasari
d7b3042685 qcacmn: 6g scan optimizations based on the ini
Below optimizations can help to improve 6g scan,
1. RNR-only: Consider only 6g RNR(PSC and non-PSC) channels found
   while scanning 2g and 5g bands, as the 6g APs are likely to
   present in RNR channels.
2. Duty cycle: There is a chance to miss the standalone 6g APs as
   they don't advertise RNR IEs. So, instead of optimizing all
   scan requests, we can consider to do a full scan with duty
   cycle(n) where optimization is skipped for every nth full scan.
   The full scan requests 1 to n-1 are going to be optimized as
   per RNR-only policy.
Driver shall maintain a scan count to track the full scans and
decides whether to optimize the scan (scan count 1 to n-1) or
send it as it is(scan count n) to firmware.

Change-Id: I35b31e900b74dbcd7791f4c2fcfe87b3c629758b
CRs-Fixed: 2806409
2020-11-05 16:13:04 -08:00
Srinivas Dasari
9305e680b1 qcacmn: Enhance the ini scan_mode_6ghz for RNR scan optimization
Add the below values to scan_mode_6ghz enum,
1. SCAN_MODE_6G_RNR_ONLY: Scan the channels (PSC and non-PSC)
   found in RNR-IEs while scanning 2g and 5g bands. Host fills
   all PSC and non-PSC channels in the scan request and set the
   flag FLAG_SCAN_ONLY_IF_RNR_FOUND for each channel.

2. SCAN_MODE_6G_PSC_DUTY_CYCLE: Scan the complete PSC channel
   list for every duty cycle. For every duty cycle scan, host
   fills all 6g channels and sets the flag
   FLAG_SCAN_ONLY_IF_RNR_FOUND only for non-PSC channels. Rest
   of the scans will be done only on RNR channels(PSC and non-PSC).

3. SCAN_MODE_6G_ALL_DUTY_CYCLE: Scan the complete 6g(PSC and
   non-PSC) channel list for every duty cycle. For every duty
   cycle scan, host fills all 6g channels and doesn't set
   the flag FLAG_SCAN_ONLY_IF_RNR_FOUND for any 6g
   channel(PSC/non-PSC). Rest of the scans will be done only
   on RNR(PSC/non-PSC) channels.
Change the default ini value to PSC_DUTY_CYCLE.

Change-Id: I73bc08d973bd57dbe2ba6644c3842da9ce850cec
CRs-Fixed: 2806406
2020-11-05 16:12:59 -08:00
Srinivas Dasari
da54959f21 qcacmn: Get per channel scan config service capability
Firmware advertises the service capability bit
WMI_SERVICE_SCAN_CONFIG_PER_CHANNEL when it supports per channel
scan config flags. Get this and cache in psoc.

If firmware supports WMI_SERVICE_SCAN_CONFIG_PER_CHANNEL, it uses
the upper-12 bits(bit-20 to bit 32) of channel_list for flags and
lower 20-bits(bit-0 to bit-19) for frequency. If firmware doesn't
support it, then channel_list holds the frequency value only.
Fill the flags and frequency accordingly.

Change-Id: I88a6f29f61e1ecea75bc5574cadcbbfbb7f8b188
CRs-Fixed: 2806405
2020-11-05 16:12:54 -08:00
Srinivas Dasari
58fe05f9ba qcacmn: Introduce new ini parameter for 6ghz scan enhancement
Introduce scan_mode_6ghz_duty_cycle ini parameter.

It disables full scan optimization after every default value
provided in ini and forward scan request as it is to firmware
without optimization.

Change-Id: I68c1f79432ae646157be94241a779af8189c3c8c
CRs-Fixed: 2801797
2020-11-05 16:12:50 -08:00
Srinivas Dasari
bac5be8a23 qcacmn: Support for history based scan request
Userspace/framework tracks last few days(e.g: 10 days) history of
connected APs and maintains best 10 channels out of that list by
considering multiple parameters like scoring, location etc.
It's likely to find an AP in one of these channels when a scan issued.
So, framework issues first scan request with a maximum of 10 channels
in the below cases currently,
1. When the wifi is turned on
2. When the wifi is in disconnected state and user turns on the screen.

Host driver shouldn't add any more channels to this scan request as
it's expected to complete the scan as soon as possible to connect
quickly to the known APs. Don't add 6g RNR channels also in the
scan request.
Further scans from framework would be full scans or with list a
of channels(more than 10) and RNR channels can be added to them.

Also, don't add all 6g channels if userspace hasn't given any as
the current framework/kernels are matured enough decide whether to
issue scan with 6g channels or not. RNR channels can be added as
mentioned. Remove SCAN_MODE_6G_NO_OPERATION as it's not needed
anymore with this.

Also, 6ghz scan functionality gets enahanced depending on various
requirements. This can be moved to a separate file so that core
scan_manager.c file won't be bloated with new code.

Change-Id: I1800a3e95e438720f94d8eec3544023cab16b081
CRs-Fixed: 2805900
2020-11-05 16:12:46 -08:00
Ashish Kumar Dhanotiya
f7f344ef2c qcacmn: Resolve compilation issues for connection manager
There are some fils related compilation issues, add a fix
to resolve these compilation issues.

Change-Id: Ia8fc03885a42447a2f13a58840f3c5174c485bcc
CRs-Fixed: 2811623
2020-11-05 14:03:09 -08:00
Varsha Mishra
1ba02a5794 qcacmn: Invalidate nbuf before reading TLV info
Buffer invalidation is required before reading any information
from it.

Change-Id: I7adc602ffc046a8194413e557c530ef062e48894
2020-11-05 11:55:15 -08:00
Balamurugan Mahalingam
d0b7b07b98 qcacmn: reduce the pktlog dest ce ring size to 128 in lowmem platform
Reducing the PKTLOG ring size to 128 as only USR_COMPLTN_FLUSH_TLV
alone is intended to be processed in this ring on a lowmem platform.
This is done only for IPQ5018 and QCN9000 to reduce the buffer
consumption

Change-Id: I82d3dd0286c97ea672b47613008c97dc6d5dce5c
2020-11-05 03:26:05 -08:00
Arun Kumar Khandavalli
d62d1d7186 qcacmn: Add API to get/set target global mode
Add API to get/set the target global mode when the driver
is loaded (or) dynamically switched between modes

Change-Id: I65857ef57a17645da94301e26c0daddc30c5ad79
CRs-Fixed: 2809955
2020-11-05 01:20:50 -08:00
Aditya Kodukula
74b41a6d6a qcacmn: Add WMI command to enable wow mode logging
Add the WMI command WMI_DBGLOG_MOD_WOW_LOG_LEVEL to enable
debug logs while in wow mode.

Change-Id: Ia1902d989964a5e35f590a075a2de64a9f66d5b7
CRs-Fixed: 2810326
2020-11-05 01:20:46 -08:00
Yu Tian
41dc191a51 qcacmn: Perform TSO seg unmap when HW enqueue failed
TSO segment struct is not unmapped and TSO buffer is
not got freed in HW enqueue failure case handler.
Implement similar unmap and free handling as TX comp
handling.
Change-Id: I83389fcc97a2e99497011e9e878f665be88f9f04
CRs-Fixed: 2795836
2020-11-04 22:46:47 -08:00
Ashish Kumar Dhanotiya
3faf318e8c qcacmn: Add a check for vdev with bssid mac
There is a possibility that driver already has a vdev
with the mac address same as bssid, in this case sta
should not connect to this AP as it may lead to undefined
behavior.

To address above issue add a check to compare bssid with
already existing vdevs before connect start.

Along with above changes add few renaming changes also.

Change-Id: Ia12be0b392a01bf935b5261e505290064de68805
CRs-Fixed: 2809147
2020-11-04 17:02:00 -08:00
Aditya Sathish
8491861767 qcacmn: Release spinlock after getting reference for scan node
Release the spinlock which was taken to get a reference to the
oldest node in the scan database.

CRs-Fixed: 2811548
Change-Id: I7d274e80575774bb1b41732b20f170c3f1f2dc60
2020-11-04 05:02:56 -08:00
Srinivas Girigowda
1aefc8972b qcacmn: Remove obsolete WMI_LOG(I/E/P/W/D) macros
Remove obsolete WMI_LOG(I/E/P/W/D) macros and
instead use wmi_(err/debug/info/alert/warn).

Change-Id: Ib401c5da873efc7a87323d9857d7f33989c3b29c
CRs-Fixed: 2776741
2020-11-03 13:17:04 -08:00
Yu Tian
cee4dbb1c5 qcacmn: Implement a light weight get_timestamp routine
For some 3rd party platforms, get_timestamp through legacy
kernel API is time costing. For spin_lock/unlock statistics
info, the resolution in ms level is enough. So use another
light weight API to save CPU resource for 3rd party
platforms only.

Change-Id: I9182f00adda0d3081a2c40b222ab37bb1ca9d6a1
CRs-Fixed: 2796263
2020-11-03 13:17:00 -08:00
Amruta Kulkarni
93a4498eba qcacmn: Add missing parameters in connect scan req
Populate scan IE and scan type in connect scan req
for connection manager.

Change-Id: I6199312541339ffdf391dd4e3d8645abf6da456a
CRs-Fixed: 2809491
2020-11-03 11:16:19 -08:00
Jianmin Zhu
66fcfe0178 qcacmn: Select candidate by ETP when connect
If ini vendor_roam_score_algorithm=1, for initial connect, select
candidate by estimated throughput(ETP). Calculate ETP of all
bssid of ssid selected by high layer, and try to connect AP by
order of ETP, legacy algorithm with following Parameters/Weightage
becomes useless. ETP should be [1Mbps, 20000Mbps],matches score
range: [1, 20000].
Add 11ax support besides 11ac/11abgn.

Change-Id: I3f55d2ae37801128b8a66f6d5c2ac55cb11a56d0
CRs-Fixed: 2704154
2020-11-03 08:35:29 -08:00
Manikanta Pubbisetty
a51d70591e qcacmn: reset monitor filter before ring reap
In monitor mode, as part of VDEV delete, we are reaping
monitor rings to avoid backpressure from RXDMA2SW ring.
Looks like the ring continues to grow even after reaping,
reset the monitor filters before reaping to avoid
ring backpressure.

Change-Id: I0d9dde61b62648f8ce11c15ba23612fc8491fff2
CRs-Fixed: 2807482
2020-11-03 08:35:25 -08:00
Debasis Das
d5b64eab69 qcacmn: Add wrappers to abtsract OS API's
Add wrapper API's to abstract various OS API's
related to network-device.

Change-Id: I0c8bc9091d32965a90025b9e7738ab6cfdc39d14
2020-11-03 06:23:36 -08:00
hqu
fc4c9c5a86 qcacmn: Remove old rso path code [PART 1]
Since new rso ROAM_OFFLOAD_V1 path is enabled, remove
the old rso path code for wmi related files.

Change-Id: Ie519ca7fac2d721f87a4c9bd11507cd83ddfb504
CRs-Fixed: 2810241
2020-11-03 06:23:32 -08:00
Rakesh Pillai
c864a10bd8 qcacmn: Add flag to indicate not to aggregate FISA flow
Add the flag "is_exception", to indicate that the
packets belonging to this flow are not to be aggregated
by FISA.

Change-Id: I3c1e781d4a2ad251082dacc189f23ffab15ae002
CRs-Fixed: 2810360
2020-11-03 00:55:41 -08:00
Yeshwanth Sriram Guntuka
138d9d7dd7 qcacmn: Replenish buffers when reaping non-monitoring ring
Nbufs are reused on non-monitoring status ring, so stale
values will still be present in the status ring nbufs post
channel change. A possible scenario where after mon channel
is changed to 5G from 2G, MAC-0 status ring is processed and
buffer_done tlv tag could be read from the stale nbuf even
though HW does not set this for the latest packet. This could
result in un-map and free of the status_nbuf even before HW
updates the buffer_done tlv tag.

Fix is to replenish buffers instead of re-using the buffers
when reaping non-monitoring status ring.

Change-Id: I239ddae04a57ee1078a6b7399d659ae1295276b5
CRs-Fixed: 2806422
2020-11-03 00:55:38 -08:00
Min Liu
ffddaeaf60 qcacmn: Add user stats and callback of DCS
Add user stats and callback to indicate DCS stats to userspace.

Change-Id: If841f9cad72ce2303046316d4c16ebf7efd9c3ec
CRs-Fixed: 2773531
2020-11-02 20:46:23 -08:00
Liangwei Dong
cee83b8a96 qcacmn: Fix build error in reference count tracing
Fix below build error when feature WLAN_OBJMGR_REF_ID_TRACE
enabled:
1: "line_node" may be used without initialized in function
wlan_objmgr_trace_check_line. Fix by linking new
line node to link_head.
2: Use "peer_obj" to print trace info of peer object.
The "vdev_obj" is invalid when object type is WLAN_PEER_OP.

Change-Id: I067704976bb8d2dd11873af96fa4778adce7901b
CRs-Fixed: 2802642
2020-11-02 17:32:42 -08:00
Adil Saeed Musthafa
5c48559237 qcacmn: setup the target_pdev_id on mode switch
We need to set pdev->target_pdev_id after mode switch so that the
correct target_pdev_id will be used for monitor mode ring configurations

Change-Id: I0c79d0e69f8d28f8a7c8823a1010baf317571c20
CRs-Fixed: 2803005
2020-11-02 13:05:34 -08:00
Balaganapathy Palanisamy
1ba65c35d7 qcacmn: Move the resource config command before init command
Move the resource configuration command after initializing
pdev wmi handle and just before wmi init command.

CRs-Fixed: 2801602
Change-Id: I3a476cbbccd5874c79cfa08f1252c728ebc9a5c6
2020-11-02 08:03:41 -08:00
Aditya Sathish
309120eac2 qcacmn: Acquire spinlock before taking ref for scan_db entry
Locks must be taken before accessing scan_db nodes to ensure
reference counts are not changed while changing entries within
the node or while freeing the node.

Ensure that a spinlock is used before increasing the reference
count to make sure that there is no other execution context
accessing the scan_db.

CRs-Fixed: 2791279
Change-Id: I4402ff15de7c8d4fc31009f7307ba262b4df6702
2020-11-02 03:54:25 -08:00
aloksing
b5692dc64c qcacmn: Replace WMI_LOGD() with wmi_debug()
Replace WMI_LOGD() with wmi_debug().

Change-Id: Ia5f00e0b54de30e2251e3313b46badbde7a90b40
CRs-Fixed: 2807905
2020-11-02 03:54:22 -08:00
Vignesh Mohan
46be7cdcbd qcacmn: Use 80MHz as next BW after radar during 80p80MHz
With bandwidth reduction enabled, when radar is detected during
80p80MHz operation, if the primary segment is unaffected, the
next expected BW for the device is 80MHz. However, the API
reg_set_channel_params has the following bw precedence list:
80P80 -> 160 -> 80 -> 40 -> 20 MHz.

This is valid in normal channel change cases but when used for
the bandwidth reduction feature, 80P80MHz should be considered
same as 160MHz and the next bandwidth (to be checked) should be
80MHz.

Update the channel width in the channel params to 80MHz if
the current channel is 80P80MHz and call the regulatory API
to check channel availability with the updated params.

CRs-Fixed: 2805939
Change-Id: I4337a3a797d1c4b0ef19e47d0933d4dd292733b5
2020-11-02 01:47:11 -08:00
Yu Tian
76fdb54e96 qcacmn: add an ini field to control rx frame pending check
Add a ini control field to control rx frame pending check
logic in WoW case. In some cases, power consumption is more
important than rx frame ping loss, so add a control flag

Change-Id: I8c4d3725edddb82a0f06dc70c22a8dd5243209f2
CRs-Fixed: 2806786
2020-11-02 01:47:07 -08:00
Jinwei Chen
56f94da675 qcacmn: Add reo destination indication info to skb
Get reo destination indication from REO2SW ring descriptor,
store it to qdf_nbuf_cb of skb.

Change-Id: I5a4c504b2550229a77a435b1f5ddb78c4abe51aa
CRs-Fixed: 2809080
2020-11-01 23:14:06 -08:00
Rajeev Kumar
c3f4e5678d qcacmn: Change QDF per packet proto log level to debug
QDF per packet proto logging is leading to excessive console
logging and hence change QDF per packet proto logging to
debug log level and avoid spamming precious kernel dmesg
log  buffer.

Change-Id: Iae562a8541c81e7708caa822a0ce293e7d6e47f3
CRs-Fixed: 2808600
2020-10-31 07:17:14 -07:00
Gururaj Pandurangi
a30081e58e qcacmn: Add a feature flag for 4.9 GHz channels
Condition 4.9 GHz channels under a macro CONFIG_49GHZ_CHAN
since only WIN uses these channels and not MCC.
This reduces kmalloc memory allocation in regulatory
component.

Change-Id: Ie9241dd68909f68fa70012b664c7bc7cf050c1a5
CRs-Fixed: 2766046
2020-10-30 22:16:14 -07:00
Arun Kumar Khandavalli
c05a963017 qcacmn: Add additional vendor specific hang reason codes
Add additional hang reason codes in enum qca_wlan_vendor_hang_reason to
address potential internal failure cases.

Change-Id: I4bf154805d3e06241e9fdd799f1e6ffc4c046fca
CRs-Fixed: 2803747
2020-10-30 17:07:39 -07:00
Kai Liu
4be28ba641 qcacmn: Enhance hang info feature
Add bus related info in hif layer in order to get bus status
when hang issue happened.

Change-Id: If922e0892e0f65de778b9696bbc56fc63c25c169
CRs-Fixed: 2801350
2020-10-30 13:03:35 -07:00
Amir
43b866f124 qcacmn: Free buffers if MPDU restitch fails
In case of monitor mode, if MPDU restitch fails,
Free all rxdma buffers from head msdu to tail msdu

Change-Id: I852b6095638578a48c07a6fb5d221ead40c5ffde
CRs-Fixed: 2657983
2020-10-30 11:01:53 -07:00
Jianmin Zhu
6ce6be5c32 qcacmn: Add MACRO qdf_ceil
Add MACRO qdf_ceil(x, y) as DIV_ROUND_UP(x, y)

Change-Id: I92ecffbaf29c43809712e2b950a8064890e98136
CRs-Fixed: 2807611
2020-10-29 23:35:39 -07:00
gaurank kathpalia
b8b58d8d12 qcacmn: Move disconnect wait logic from osif to connection mgr
Move disconnect wait logic from osif to connection mgr, so that
MLO/IF manager can use the wait logic for disconnect
during vdev delete.

Change-Id: Ied2bbcfd6a532209f8008499424f94acc41efc0e
CRs-Fixed: 2800990
2020-10-29 17:51:00 -07:00