Commit Graph

8667 Commits

Author SHA1 Message Date
Basamma Yakkanahalli
a3f17ee459 qcacmn: Update new chip specific APIs to ipq5018
Added below chip specific changes for ipq5018
1. Read ppdu_id from reo_entrance ring
2. API to extract msdu end pkt tlv information at once
    and store in local structure

Change-Id: Ic23bbd03db0e4ac56d40618378dc4d428f88d083
2020-04-29 06:29:37 -07:00
Liangwei Dong
9051d27a9c qcacmn: Use API policy_mgr_get_can_skip_radar_event for Radar event
Dfs radar processing function dfs_process_radar_ind is called
in interrupt context. Add new API policy_mgr_get_can_skip_radar_event
to be called in interrupt context to get radar skip flag.
The policy_mgr_get_dfs_master_dynamic_enabled will acquire mutex and can't
be called in interrupt context.

Change-Id: Iffa4f56da56b991d817c36891c6f6a611f3a094e
CRs-Fixed: 2673808
2020-04-28 21:23:06 -07:00
Sumedh Baikady
b1e18c841d qcacmn: Export freq to opclass routine symbol
Export wlan_reg_freq_width_to_chan_op_class_auto symbol
to be used in qca_ol module for retrieving opclass.

Change-Id: I44d9c424d66caf168d443f3542361deb9b3de300
2020-04-28 17:52:15 -07:00
Ananya Barat
dcf1fef9b3 qcacmn: Correct the start frequency for 2G channel 14 in japan_op_class
The function reg_freq_width_to_chan_op_class calculates the channel
number and opclass to be filled in the ECSA IE. In this function,
there is a check if (op_class_tbl->start_freq + FREQ_TO_CHAN_SCALE
		     *op_class_tbl->channels[i] == freq)
In case of channel 14 in Japan opclass, since the start_freq =2407,
FREQ_TO_CHAN_SCALE=5 and channels[i] =14, this condition evaluates
to false and chan_num and opclass are not filled.

Fix this by setting the start_freq as 2414 as is done for the
global_op_class table.

Change-Id: I31b3720e4a74a3790275eb3d14b412b0366cbeba
CRs-Fixed: 2673001
2020-04-28 10:31:58 -07:00
Shiva Krishna Pittala
5baa725203 qcacmn: Host abstractions for Spatial reuse WMI pdev and vdev params
Add the Host abstractions for the following WMI pdev and vdev parameters
related to Spatial reuse operation.
   - WMI_PDEV_PARAM_ENABLE_SRP
   - WMI_PDEV_PARAM_ENABLE_SR_PROHIBIT
   - WMI_VDEV_PARAM_SET_CMD_OBSS_PD_THRESHOLD
   - WMI_VDEV_PARAM_SET_CMD_OBSS_PD_PER_AC

CRs-Fixed: 2672093
Change-Id: Id9b03e304676e2896b1d40b0c6319a69be32d7fd
2020-04-28 07:32:34 -07:00
Sumedh Baikady
b83a21dd94 qcacmn: Add 6Ghz module Id in QDF
Add 6Ghz module ID in QDF for debug
purposes.

Change-Id: Iea2677ac4d91e64fb324eabfc55970f019ae8a56
2020-04-28 07:32:30 -07:00
Sumedh Baikady
84bcbc29b5 qcacmn: Add WMI support for Tbtt sync in Multi Soc
Support synchronization of Tbtt in multi SoC case.
Add WMI to send vdev details of one soc to another.
Info includes beacon interval, bssid and tbtt calculated
in host wrt to other Soc.

Change-Id: I465140268b0fe5e0cb69f636ebeb08dc80667cf7
2020-04-28 07:32:27 -07:00
Jinwei Chen
446ac2d46e qcacmn: fix TX TDLS discover frame nbuf leak issue
crash scenario:
(1) during dp_vdev_detach_wifi3(), it will reset related outstanding
TX desc vdev pointer to NULL.
(2) In the meantime, if this vdev TX completion is received from HW,
dp_non_std_tx_comp_free_buff() do nothing for nbuf due to null vdev,
leak will happen.

add error handling in dp_non_std_tx_comp_free_buff() to fix it.

Change-Id: I942a3d690711c60e8299d86562f08f0fb77f0b32
CRs-Fixed: 2670186
2020-04-28 05:42:05 -07:00
Neha Bisht
9aa9221c98 qcacmn: Do Batched invalidate of tx completion descriptor
Do batched invalidate of tx completion descriptor to avoid
unnecessary D-cache miss for 32 byte size descriptor.

Change-Id: Ia580fe78dcef5b36f117aaad171a2df6d0e34966
2020-04-28 05:42:01 -07:00
Jeevan Kukkalli
da011044aa qcacmn: Add NULL check for VAP self peer
Validate VAP self peer before accessing it

Change-Id: I7c685eabee4571bfc706ef0ac8bb50b67df122c4
CRs-Fixed: 2662387
2020-04-28 05:41:56 -07:00
Vevek Venkatesan
9043089a40 qcacmn: Add prefetch_timer config for CE rings
Add prefetch_timer configuration for CE rings.
Set prefetch_timer=1 configuration for qca6490 destination CEs,
prefetch_timer=0 configuration for other targets CEs.

Basically setting to 1us asking CE hw to update ring tail pointer to
update within 1us. FW side CE SW sets all rings to 1us already.
Idea behind this change  is, we have seen pre-silicon issue where SRC
ring TP read by SW was not seen updated value when prefetch was set
to 8us. Changing prefetch timer value to 1us helps to resolve
pre-silicon issue.
So host side rings need to update the prefetch timer to 1us.

Change-Id: I0830c73517c29cf39e6b2974bf3faa44e5673741
CRs-Fixed: 2669762
2020-04-28 03:59:18 -07:00
Yeshwanth Sriram Guntuka
7dad533e6c qcacmn: Handle scattered msdu in OOR error scenario
In OOR error handling scenario, msdu is spread across
two nbufs. Due to this, there is a mismatch between
msdu count fetched from MPDU desc detatils and count
fetched from rx link descriptor.

Fix is to create frag list for the case where msdu
is spread across multiple nbufs.

Change-Id: I1d600a0988b373e68aad6ef815fb2d775763b7cb
CRs-Fixed: 2665963
2020-04-28 03:59:14 -07:00
Priyadarshnee S
4c6b5c6f69 qcacmn: DFS API support for Rolling CAC
An extension of preCAC feature is Rolling CAC. The distinct difference
between these features is that the FW runs the off channel CAC
timer for a "finite" time for preCAC and runs the timer for "infinite"
time on an off channel. Hence the infrastructure built for
preCAC feature is being modified to accommodate RCAC feature as well.
Following are the modifications done:

1. Add an enum to represent various off-channel CAC modes.
2. Remove the 'static' declaration of few APIS so as to re-use them.
3. Add 'dfs_rcac_ch_params' to DFS PDEV object to store the RCAC
channel params so as to use the channel params after radar detect.
4. Rename DFS APIs to match its functionality.

CRs-Fixed: 2670419
Change-Id: I0bf0d33955706941cffb4e9cf6fcebfb465a6c74
2020-04-28 03:59:10 -07:00
Saket Jha
87dac440fd qcacmn: Dump FW stats for MCS 12/13
Dump additional FW stats for MCS 12/13 due to additions in 4K QAM
support.

Change-Id: I8cf177cb93f484c69951a758c4542e4530617576
CRs-Fixed: 2656272
2020-04-28 03:59:05 -07:00
Pragaspathi Thilagaraj
2b12f986bb qcacmn: Fix NULL pointer dereference of roam stats event param buf
In extract_roam_scan_ap_stats_tlv, if param buf is null, null
pointer dereference can happen while trying to access
num_roam_ap_info in the error message print.

Return failure if param_buf is NULL

Change-Id: I9f5cbb5534d1ef58bb9406ba8dc0aa68a9f8c194
CRs-Fixed: 2669350
2020-04-28 01:03:33 -07:00
Utkarsh Bhatnagar
d34f264b07 qcacmn: Fix Mem leak in scm_sort_6ghz_channel_list()
Free memory in error cases for rnr_chan_info

Change-Id: Ia879dd8857a4af331bf2f41aefe0551c1f8976e7
CRs-Fixed: 2670414
2020-04-27 23:26:54 -07:00
nobelj
01dcfedca1 qcacmn: Support MU in tx capture mode
Support fix for MU related data frame in tx capture mode.

Change-Id: I8b63eaf320463a3a068beb589089582cafe05001
CRs-Fixed: 2656346
2020-04-27 23:26:50 -07:00
Pragaspathi Thilagaraj
0150333a89 qcacmn: Abort only host scans on roam start notification
The roam sequence in LFR-3.0 is roam scan start notification
from firmware followed by roam start indication and then
roam synch,roam synch frame events. Roam start is sent
after candidate selection and host driver will disable
queues when roam start is received.
But for emergency roam trigger, firmware sends roam start
indication directly without notifying roam scan start to disable
data path queues immediately after deauth received from the AP.
So roam start is received before roam scan is started at firmware
and before candidate selection is done.

After roam start notification, host sends scan abort for all scan
on vdev by setting scan command request type to
WMI_SCN_STOP_VAP_ALL. This results in roam scan getting aborted at
firmare in emergency deauth roaming case and roaming fails.

Introduce new vdev id value based on which the scan module will
abort only host triggered scans setting the flag
WMI_SCN_STOP_HOST_VAP_ALL in the scan request.

Change-Id: I3a162c55d4a008ff986fd957bed395b39c060bb5
CRs-Fixed: 2636410
2020-04-27 21:32:22 -07:00
bings
868ce7c912 qcacmn: Include device sleep time in the NOL timeout value
'jiffies' does not include the device sleep time.
Use qdf_get_monotonic_boottime to monitor lapse of time for nol.

Change-Id: I6e00e003b8ee3d456ac4ec62b23fdaa02d577672
CRs-Fixed: 2652692
2020-04-27 21:32:17 -07:00
phadiman
b133d310ec qcacmn: Split dp_rx_pdev_attach and dp_rx_pdev_detach
Split dp_rx_pdev_attach into dp_rx_pdev_desc_pool_alloc,
dp_rx_pdev_desc_pool_init, dp_rx_pdev_buffers_alloc and
dp_rx_pdev_detach into dp_rx_pdev_desc_pool_free, dp_rx
_pdev_desc_pool_deinit, dp_rx_pdev_buffers_free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: Ib543ddae90b90f4706004080b1f2b7d0e5cfbfbc
CRs-Fixed: 2663595
2020-04-27 18:02:37 -07:00
phadiman
9798b16f3f qcacmn: Split dp_mon_link_desc_pool_setup to alloc and init APIs
Split dp_mon_link_desc_pool_setup to alloc and init APIs and
dp_mon_link_desc_pool_cleanup to deinit and free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: I36b2a98bd317010124916e0b2779938eba3883ea
CRs-Fixed: 2663595
2020-04-27 18:02:33 -07:00
phadiman
8db0b893b4 qcacmn: Split dp_hw_link_desc_pool_setup and cleanup APIs
Split dp_hw_link_desc_pool_setup into dp_hw_link_desc_pool_alloc,
dp_hw_link_desc_pool_init and dp_hw_link_desc_ring_init APIs, and
likewise split dp_hw_link_desc_pool_cleanup into deinit, ring_deinit
and dp_hw_link_desc_pool_free APIs

This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: I1682a59847db5d3441e85b00768667066bf5edf2
CRs-Fixed: 2663595
2020-04-27 18:02:27 -07:00
phadiman
730a5bdaa8 qcacmn: Split dp_srng_setup and dp_srng_cleanup APIs
Split dp_srng_setup into dp_srng_alloc and dp_srng_init
likewise split dp_srng_cleanup into dp_srng_deinit and
dp_srng_free
This split is made because dp_pdev_init is introduced
as part of this FR and these APIs will be called from
dp_pdev_init/dp_pdev_deinit or dp_pdev_attach/dp_pdev_
detach accordingly to maintain the symmetry to DP init
and deinit path

Change-Id: I421fbd5bce074af6f75c147742f44e03568e6403
CRs-Fixed: 2663595
2020-04-27 18:02:21 -07:00
Amir
76ab3fc618 qcacmn: Change monitor ring reap sequence for qcn9000
For qcn9000 in case of monitor mode, reap monitor destination
ring first and status ring later to avoid backpressure
on monitor destination ring

Change-Id: I4e1931afe0453221f1326ca7bdb7f0273cc7363d
CRs-Fixed: 2670656
2020-04-26 23:54:04 -07:00
Adil Saeed Musthafa
60d18029b6 qcacmn: Add API to check if WMI is blocked or not
Add API to check if WMI commands have been blocked

Change-Id: I675b102b74d607332acf8a417c0c94955cbd5ecd
CRs-Fixed: 2662158
2020-04-24 08:57:39 -07:00
Vignesh Mohan
a23f9384c4 qcacmn: Add states events and API declarations for RCAC SM
As part of the Rolling CAC State Machine, introduce three state
enums (INIT, RUNNING and COMPLETE) and the corresponding state
events.

Introduce generic APIs such as dfs_rcac_sm_create,
dfs_rcac_sm_destroy and dfs_rcac_sm_deliver_evt for rolling
CAC State machine operations.

CRs-Fixed: 2659666
Change-Id: I528db71aa7d21dced7e47ff4f9cccfbfe94c8c21
2020-04-24 01:29:16 -07:00
Jeevan Kukkalli
31004de4c2 qcacmn: Make cnss diag kernel level logging unlikely
Module param qdf_log_dump_at_kernel_enable is set to
false by default in wifi script when no value configured
through UCI so make kernel level logging unlikely.

Change-Id: I4aa3547c4049562b1cad63eb20d75b5b166a04c2
CRs-Fixed: 2664926
2020-04-23 16:26:54 -07:00
Varsha Mishra
c71df5eef4 qcacmn: Restrict DMA Map/UnMap upto buffer size
Restrict DMA Map/UnMap upto buffer size for packets in rx process.
This gives 2-3% cpu gain in peak throughput.

Change-Id: Iaf5e9f6f734d80b6d2c234bd8e679cf2a81c7e2c
CRs-Fixed: 2660698
2020-04-23 16:26:49 -07:00
Yeshwanth Sriram Guntuka
ac0322cce9 qcacmn: Set runtime pm state prior to runtime_init
During initialization of driver, the runtime pm usage
count is incremented to 1 when the pm state is NONE.
Runtime get is done as part of htc send packet for
a wmi command in scheduler thread context. In kworker,
runtime_start is processed as part of driver load and
runtime put is done prior to updating the pm state to
ON. Runtime put triggered as part of htc send packet
causes a panic since the state is NONE and usage
count is 1.

Fix is to set runtime pm state to ON prior to doing
a runtime put as part of initialization.

Change-Id: I52cca5240f2f0872c681aab3a58a382f3fa1df0e
CRs-Fixed: 2669029
2020-04-23 14:50:58 -07:00
Manjunathappa Prakash
7de632a45c qcacmn: Decouple IPA TCLring and WBM ring size config
Decouple IPA TCLring and IPA WBM completion ring size from regular
Tx TCLring and WBM completion ring size configuration.
This is required as there is limitation on IPA GSI rin size
configuration.

Change-Id: I689d0e8ca72f069c5b68dc1789358e091c554d30
CRs-Fixed: 2665010
2020-04-23 11:32:27 -07:00
Manjunathappa Prakash
28b4573d27 qcacmn: Increase Tx HW and SW to 2K and 4K for qca6490
Increase Tx HW and SW to 2K and 4K for qca6490.
This parameter change is based on the tuning exercise of 1Tx:8Rx device
tests in NaN scenario. This is helping Tx device to burst to multiple
Rx peers, there by improving the TPUT.

Change-Id: I28e1eafb78612c68fe172a640b1386ac88e051a2
CRs-Fixed: 2657056
2020-04-23 11:32:23 -07:00
Varsha Mishra
1fb9b10ac1 qcacmn: Make _qdf_nbuf_unmap_nbytes_single API inline
Make _qdf_nbuf_unmap_nbytes_single to use in dp_rx_process.
Non-inline version takes more CPU.

Change-Id: Iaf5e9f5f734d81b6d2c234bd8e579cf2a81c7e2c
CRs-Fixed: 2634679
2020-04-23 02:18:13 -07:00
Ruben Columbus
4de3f492b0 qcacmn: enable/disable monitor other
monitor other gets disabled or enabled from input passed in set_monrxfilter

Change-Id: Ic6a00ce398ad0054b447f39f674eb6b9100b9d80
2020-04-23 02:17:57 -07:00
Wu Gao
0a5167bb21 qcacmn: Convert the number of rx chains from target to host
The number of rx chains in target is different to the value in host
side, this change converts the value from target to host.

Change-Id: I86044bf12e958da312924827a3fd1e6799beaf41
CRs-Fixed: 2668403
2020-04-22 21:53:16 -07:00
Nirav Shah
eb3405c26a qcacmn: Disable copy complete interrupt for HTT copy engine
Disable copy complete interrupt for HTT copy engine.

Change-Id: I09510298f873a3bc4ca802a6fed3b7b0e103fd65
CRs-Fixed: 2649845
2020-04-22 14:03:40 -07:00
Vivek
35e3d8647b qcacmn: Update parameter info in API doc
The parameter info is not updated in the
doc for qdf_bitmap interface.

Update the parameter info in the qdf_bitmap interface.

CRs-Fixed: 2660881
Change-Id: I4292d5563c2f92c42673098d7d87385d2b9be113
2020-04-22 14:03:25 -07:00
Radha Krishna Simha Jiguru
8ca2521ac8 qcacmn: Get Rx TLV offsets from structure
Size of the TLVs have changed across generation of chipsets
Offset values need to be configured into DMA register for preheader DMA
Added APIs to get offsets of each TLV based on chip type

Change-Id: Ic011332cbf3a1017f324f246e47c9e2c91441c70
2020-04-22 14:03:08 -07:00
Pavankumar Nandeshwar
d111e1ef43 qcacmn: Validate number of wds entries deleted during unmap
Validate number of wds entries deleted during peer unmap
handling with the number which firmware has sent in
peer unmap message, which indicates the number of
wds ast entries deleted by firmware after peer delete.

Change-Id: I09e1c41bab19cd023e7a83baf1e90d51aab4229e
CRs-fixed: 2667445
2020-04-22 06:23:30 -07:00
Linux Build Service Account
dba5d823b6 Merge "qcacmn: Add memory barrier to avoid inconsistent reg write" 2020-04-22 02:23:12 -07:00
Linux Build Service Account
d85a67a30a Merge "qcacmn: Add an API wlan_reg_update_pdev_wireless_modes" 2020-04-22 02:23:12 -07:00
Linux Build Service Account
cf66f84918 Merge "qcacmn: Interrupt changes in MSI path" 2020-04-22 02:23:11 -07:00
Rakesh Pillai
94ff74fcf9 qcacmn: Add memory barrier to avoid inconsistent reg write
The delayed register write enqueue fills a queue element
with the required data which can be dequeued in a workqueue
running on a different CPU. Since these operations are not
lock protected, there can be stale value access when memory
write has not been flushed to the actual address.

Using write memory barrier before setting the valid flag for
a queue element will make sure that the dequeuing worker
thread will always see the updated values if the element valid
flag is set and thereby avoid any race condition.

Change-Id: I81b0735f0fb39599095ad309157020c691e25a0b
CRs-Fixed: 2665576
2020-04-21 18:48:58 -07:00
Hariharan Basuthkar
529b8588c4 qcacmn: Add an API wlan_reg_update_pdev_wireless_modes
Add an API wlan_reg_update_pdev_wireless_modes to update the wireless
modes in regulatory pdev_priv_obj with the wireless modes given as
input to it.

Change-Id: I2388b26da0d4c485b1b73b3ffb8f4b30767c31ee
CRs-Fixed: 2661579
2020-04-21 14:05:17 -07:00
Sourav Mohapatra
227ff6c08a qcacmn: Validate vdev_id before accessing vdev_response_timer
As a part of vdev responses from the FW, the driver fetches the
appropriate vdev_response_timer info using the vdev_id. This vdev_id is
taken from the response coming from FW. Currently, this vdev_id is not
being validated and is being used to access the array psoc_vdev_rt. This
can potentially lead to out of bounds access.

Add validation to the vdev_id before performing the fetch operation.

Change-Id: I6f25a14ccc3c8a96a1b6c863a760809c29de4003
CRs-Fixed: 2658462
2020-04-21 07:55:15 -07:00
Abhishek Ambure
2ae12c22d3 qcacmn: Retrieve max tx power allowd from vdev start resp
Wlan firmware updates "max tx power allowed" to host in fixed params
of vdev start response event.

Change-Id: Ide0dd7f55ed4b280deaae380670ca5617c018783
CRs-Fixed: 2654017
2020-04-21 01:46:49 -07:00
Subhranil Choudhury
9e9fb6a437 qcacmn: QDF Module ID for new Repeater
Addition of QDF id for new wifi repeater module.

Change-Id: Id9adc5d3524e9406fafaca67e4d5e6bc3215bada
2020-04-20 22:31:32 -07:00
Alan Chen
a1d5e0c157 qcacmn: Change qtimer time-stamp from decimal to hex
In kernel logs, qtimer currently logs the time-stamps in decimal. Change
time-stamp from decimal to hex in order to order to help correlate
better with other logs in hex qtimer time-stamp.

Change-Id: I46964609645305b1847406841e1b1b641aae9074
CRs-Fixed: 2666868
2020-04-20 10:28:48 -07:00
Nandha Kishore Easwaran
0d69530ee2 qcacmn: Interrupt changes in MSI path
1) Modified MSI interrupt mask for QCN9000 so that rx and tx
interrupts can be decoupled.

2) Removed lmac interrupts from polling mode and switched
them to msi interrupts. Added MSI masks for lmac rings.

3) Enable monitor mode LWM interrupt. This was already enabled in
integrated ahb interrupts but missing in msi. Replenish buffers in
RXDMA refill ring based on low threshold interrupts in addition to
regular Rx processing. Also made interrupt batch counter threshold as 8
for monitor status ring since ppdu end interrupts are not available in
PCI chipset and require srng msi interrupts to reap monitor status ring

Change-Id: I5c84b14d6b0a9c26fb3f0d67c349e79751a60861
2020-04-20 06:58:08 -07:00
Amir Patel
e919b20a34 qcacmn: Replenish last entry in monitor status ring
In current monitor status ring implementation,
on pdev_attach, (srng->num_entires – 1) entries
(to keep one entry slot between hp and tp)
are replenished and last entry is not replenished to HW.

With qcn9000 monitor mode HW enhancements, status and destination ring
can be made lock-stepped.
for qcn9000 lock step is achieved by making monitor status ring
follow the monitor destination reap for a PPDU

However in existing flow during attach monitor status replenish logic
do not fill last entry but is filled up during first subsequent reap.
for first ppdu, i.e. after reaping destination ring,
when status ring is reaped, as first entry (hp = srng->num_entires – 1)
in status ring is NULL, so lock-stepping is not achieved.

To address this issue for qcn9000 as well as HK:
	a. Replenish last entry in monitor status ring during attach
	b. Modify src srng peek API to peek it from hp+1 entry
	c. Introduce new HAL API get cur desc and move next
	d. Remove WAR to skip status ring entries if DMA is not done

Change-Id: I60b8e7c075253d37e6b849a9b24f473c5afce82c
CRs-Fixed: 2626049
2020-04-20 05:54:54 -07:00
Pavankumar Nandeshwar
2d9f587695 qcacmn: Host-FW handshake improvements for WDS AST deletions
- For directly connected peers, during peer de-auth,
  a Single Peer delete request to the FW from host
  should delete all AST entries attached to the peer.
- This optimization is aimed at optimizing host-fw
  handshake messages

Change-Id: Iaebe2022f90ef9a10a6a0f37b21c409cf9e9ea39
CRs-fixed: 2647242
2020-04-20 05:54:48 -07:00