Commit Graph

8631 Commits

Author SHA1 Message Date
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
Priyadarshnee S
4dab98d3ce qcacmn: Add DFS APIs for Rolling CAC feature
Feature Description:
FCC/JP domains do not support PreCAC. However, we can always start
beaconning in a channel if we have completed CAC in that channel for more
than or equal to the CAC period of that channel.
If an Agile engine is available and the next channel is known, we can
start CAC in the next channel using agile, while continuing the Tx/Rx
in the current channel. And when we want to start beaconning in the
next channel after a radar detection (or after/for a user request) we can
do so without any new CAC. This allows us to jump to the new channel
without having to disrupt any ongoing data traffic. This type of
continuous CAC in the next channel while operating in the current channel
is known as Rolling CAC.

Following changes are implemented:
I)Per DFS PDEV:
1) 'dfs_agile_rcac_freq' to store agile RCAC frequency.
2) 'dfs_agile_rcac_ucfg' to enable/disable RCAC feature.

II)Per DFS PSOC:
1) 'dfs_rcac_timer' is the only RCAC timer for the device/Psoc. This will
be shared by pdev level dfs objects.
2) 'dfs_rcac_timer_running' to indicate if RCAC is running or not.

III) New APIs:
1. A dispatcher API 'ucfg_dfs_set_rcac_enable' to set rcac config.
2. A dispatcher API 'ucfg_dfs_get_rcac_enable' to get rcac_config.
3. A dispatcher API 'ucfg_dfs_set_rcac_freq' to set user configured
rcac freq.
4. A dispatcher API 'ucfg_dfs_get_rcac_freq' to get the user configured
rcac freq.
5. Rolling CAC timer init/deinit APIs.

CRs-Fixed: 2659666
Change-Id: Iae002b2ab77964fca4faf237b0d0a4e2f2afe4c2
2020-04-19 22:04:44 -07:00
Alan Chen
87df3e8c2d qcacmn: Remove static from the gwlan_logging struct
The gwlan_logging struct is used by offline tools, so it needs to be
made non-static. Remove the static keyword from gwlan_logging.

Change-Id: I05f47328914c40a2c957ca404b6681ba8507d367
CRs-Fixed: 2663164
2020-04-19 12:38:44 -07:00
Kai Chen
93d8e4ae42 qcacmn: enable monitor destination ring interrupt
Enable monitor destination ring interrupt to fix
packet is getting stuck in monitor mode.
Fix and add monitor mode debug count

Change-Id: I74efdcf6a4373dd73e373285c8cd3aa5757cd0b2
2020-04-19 10:03:37 -07:00
Pragaspathi Thilagaraj
91be4be6de qcacmn: Introduce crypto API for single pmk AP cache management
Add new crypto API to set the single PMK AP flag in
crypto pmksa entry and to clear the BSSID entries in the
crypto pmk cache with the SAE single pmk flag set.

Clear the entries with Sae single pmk flag on connection
and roaming success case. Mark the BSS as Sae pmk capable
after initial connection and roaming if the AP advertises
the VSIE

Change-Id: I42ca0c3a70945f974eec1065661ac0b781096126
CRs-Fixed: 2652936
2020-04-19 07:01:16 -07:00
Jingxiang Ge
b75ec972c4 qcacmn: Fix regression issue for EAPOL fail
This is regression issue.
regression cause I24cddb9d10e4cb675c8375cbd0f589c7718bd680.

Issue happens in get_htc_send_packets, and it is possible
htc_packet_dequeue but hif_pm_runtime_get failed as suspend
state.

Revise to original logical before regression change.

Change-Id: I74c309d7a3decdd6fe905e9f1e61916905876aec
CRs-Fixed: 2663338
2020-04-19 01:14:01 -07:00
Vevek Venkatesan
00689c8b2f qcacmn: set SRNG_FLUSH_EVENT if runtime suspended
During dp_tx_hw_enqueue writing into HW SRNG,
if devcie is already runtime suspended, set the
SRNG_FLUSH_EVENT, so that it will be flushed
as part of dp runtime resume callback.

Change-Id: I95e74844cf74eb4f73862da3da9d93422f1eea8c
CRs-Fixed: 2664660
2020-04-18 22:32:36 -07:00
Rakesh Pillai
f77acaf949 qcacmn: Fix memory leak in case of pdev attach failure
The cleanup done in case of pdev attach failure
does not deinitialize the IPA tx and rx buffers.
Also the tx descriptors are not freed in this
cleanup path.
Due to this, the tx descriptors and IPA tx/rx
buffers memory is neither freed not unmapped.

Fix this pdev attach failure cleanup path to
avoid memory leaks.

Change-Id: I570e3618f0f48f56749466fce5bcba5a4ef1c161
CRs-Fixed: 2663036
2020-04-18 16:28:55 -07:00
Alan Chen
528d6ccd70 qcacmn: Add check to avoid panic if FW is down
In order to avoid panic in hif_pci_runtime_pm_warn(), call
qdf_is_fw_down() to check if fw is down. If fw is down, return without
panicking.

Change-Id: I3fd3e0334220c1cf3ae6b3ec3fd5b1ede1705013
CRs-Fixed: 2664133
2020-04-18 13:50:35 -07:00
Nandha Kishore Easwaran
a8c046d68b qcacmn: Change DP interrupt names
Change DP interrupt names to unique values so that
interrupt affinity can be adjusted based on this. This is
similar to what is being done for Copy Engine interrupts.

Change-Id: I7f1789c8c0103e7c01b0a2956a7a37149c7462d1
2020-04-18 05:01:46 -07:00
Varsha Mishra
5cd2a434e1 qcacmn: Add QDF abstraction for dmac_inv_range
Add qdf wrapper for function dmac_inv_range. This
invalidates the specified virtual address range.

Change-Id: Ia3f92cb5136dbdbfea1e9cda8a52b474456a4e0a
CRs-Fixed: 2634679
2020-04-17 20:38:34 -07:00
Abhishek Singh
3b72c4bff0 qcacmn: Trigger recovery before sending failure resp for vdev cmd timeout
In target_if_vdev_mgr_rsp_timer_cb host send failure resp to vdev mgr
and then trigger recovery. Thus the next cmd can go to firmware before
recovery and this result in firmware states getting cleaned up and
this it's difficult to get the info from firmware for the timeout.

Thus trigger recovery before sending failure resp for vdev cmd timeout.

Change-Id: I645837e754750969744016f2da78c174308acfad
CRs-Fixed: 2665947
2020-04-17 13:20:00 -07:00
Priyadarshnee S
a519065a39 qcacmn: Add RX-ops to invoke Rolling CAC DFS APIs
Provide global function pointers for accessing DFS APIs that
1. Configures (enable/disable) rolling CAC feature.
2. Retrieves the current configuration of rolling CAC feature.
3. Programs a rolling CAC frequency.
4. Retrieves the current rolling CAC frequency.

CRs-Fixed: 2659495
Change-Id: I7fc63d150f4dc1cb5db4d671ff21c01caaf38aaf
2020-04-17 10:30:12 -07:00
gaurank kathpalia
dcc847a925 qcacmn: MCL specific movement from cmn to cld of stats
Move the MCL specific files related to cp stats from
the cmn to cld folder.

Change-Id: I62076512b1b407342338d4612087edd3ba2296df
CRs-Fixed: 2552452
2020-04-17 07:37:08 -07:00
Ashish Kumar Dhanotiya
dfaf7550a0 qcacmn: Add new vendor attribute to send he operation info
Currently he operation info is not sent to user space as
part of the response of get station info command.

Add support to send the he_operation with the new vendor
attribute QCA_WLAN_VENDOR_ATTR_GET_STATION_INFO_HE_OPERATION.

Change-Id: Ib4bab7b7b2aff688293c85f8574d9f2c306f00f0
CRs-Fixed: 2664347
2020-04-17 02:36:36 -07:00
Ashish Kumar Dhanotiya
674614ab3c qcacmn: Add serialization command to get disconnect stats
Currently for SAP case on the disconnection with the
client, host driver sends get stats command for the
disconnected peer to the FW and proceeds with the peer
deletion. There is a race condition where if the peer
gets deleted in the object manager before FW sends the
requested stats in that case host driver drops the
response from the FW.

To resolve above issue send the get stats request command
in serialization before peer delete command gets serialized
which will ensure that get stats response is processed
before peer delete in the object manager.

Change-Id: Iaa63e299ddfd3ca46c80bd79c3461c183fc0a62f
CRs-Fixed: 2664328
2020-04-16 16:19:56 -07:00
Ankit Kumar
002753cf61 qcacmn: Retrieve peer from mac addr
Retrieve peer from mac address to avoid accessing peer
even if peer is deleted.

Change-Id: I1c9740fc5d3090ef296c4dc4a5afe7022e83dca5
CRs-Fixed: 2663836
2020-04-16 05:38:13 -07:00
Hong Shi
5312595f75 qcacmn: enable athdiag access for QCN7605
Currently, athdiag can't work with QCN7605.

Thus made below change to make it work:
1. Skip pci address boundary check for QCN7605 as QCA6390.
2. Make QCN7605 access target memory via QMI.

Change-Id: Ibfcccb57486c99d78c02e322c4e2ae1a7c8dab81
CRs-Fixed: 2653814
2020-04-16 05:37:55 -07:00
Manjunathappa Prakash
3142406ced qcacmn: Add WAR to confirm WBM IDLE ring LSB write
On Lahaina platform it is seen that WBM IDLE ring init is failing,
Write to WBM_IDLE link ring LSB write is failing.
Add temporary WAR to do back to back write of WBM IDLE link ring
LSB address config register.

Change-Id: I7f72abb7226e1d7beee127ebda88488172147f21
CRs-Fixed: 2647762
2020-04-16 00:13:38 -07:00
Abhishek Singh
f50b491842 qcacmn: Add Api to flush all scan and non scan commands for vdev
Add Api to flush all scan and non scan commands for vdev

Change-Id: I17b90b8db782639897d7d32d36f562e25ae459e3
CRs-Fixed: 2664640
2020-04-15 16:18:27 -07:00
Rakesh Pillai
eee37dab3f qcacmn: Add dequeue value in delayed register write entry
The delayed register write for srngs will have
the value of the HP/TP at the time of enqueue,
but the final value which is written to the
hp_addr/tp_addr will be determined based on
HP/TP value at the time of dequeue of the
entry for a particular srng.

Hence to know what was the exact value which
was written to the HP/TP address, add one more
element in the delayed register write entry.
This element will contain the value of the
HP/TP which was actually written to the address.

Change-Id: I73e592611fa50b106da1deda06b839cf4fbe2126
CRs-Fixed: 2658331
2020-04-15 12:12:36 -07:00
Vivek
bb32488efe qcacmn: Define serialization active vdev bitmap using qdf_bitmap
The active vdev bitmap used in serialization is
32bits and it is per pdev.

But in cases, where there can be more than 32 vaps
configured, the bit positions of a 32bit bitmap cannot
be used to indicate the active commands for a vdev whose
id is more than 31.

So, we need to increase active cmd vdev bitmap to support
for max number of vdev ids that is possible for a pdev.

Considering the vdev id is per psoc scope and can spread
across pdevs, increasing the size of the bitmap to max
vdevs supported per psoc.

CRs-Fixed: 2656046
Change-Id: Ic7728145b208492af218320fa84f35bb1f918aab
2020-04-15 12:12:21 -07:00
Vivek
a7412197a6 qcacmn: Add QDF type to define a bitmap based on bits size
The bitmaps used in the driver are defined either as a single
or array of unsigned longs or some other types.

The bitmap variable size is different based on the platform(32/64 bit),
for unsigned long types.

Add support to have a platform agnostic consistent bitmap size
using the Linux provided interface for defining bitmaps.

CRs-Fixed: 2660881
Change-Id: I901778625ef9aaccc994d914c8adf98fbffeb980
2020-04-15 12:12:05 -07:00
Rakesh Pillai
d1f8fbb225 qcacmn: Clear the peer when it is deleted
The peer rx packets should be flushed when
deleting the peer and its state should be reset
to DISCONNECT, when deleting the peer.

If the state of peer is not set to DISCONNECT,
then the flushing of rx packets for the peer
which is being deleted will call the rx callback
and submit these packet to the stack, which can
cause unwanted behaviour.

This way the UMAC does not need to specifically
call clear peer before deleting the peer.

Change-Id: I3b5a737126350a361d968f6349aef6291b2e3f56
CRs-Fixed: 2659629
2020-04-14 19:03:58 -07:00
Sravan Goud
b7f1c6fa92 qcacmn: Set the peer ref count to one
For wlan stop modules any pending vdevs flush happens as part
of pdev deinit. If in case of any peer ref count leak, driver
is stuck in dp_pdev_flush_pending_vdevs as the vdev is not getting
cleaned up. This is due to vdev's peer is not deleted. So during
force flush of vdev's peers set the ref count to one before peer
unmap handler.

Change-Id: Ie54996522eac870d00ea7a75c8db40a1cce09d2d
CRs-Fixed: 2658032
2020-04-14 14:11:59 -07:00
Srinivas Pitla
34b51d3dcc qcacmn: Free nbuf on bpr disabled case only
If tx capture, sniffer are not enabled, mgmt nbuf is freed.
It is causing use-after-free in bpr enabled case
Added change to free only when bpr is disabled

Change-Id: Ia56254ca371cd9fbc21f5d58fac7ea96792d0bee
CRs-Fixed: 2663098
2020-04-14 03:04:55 -07:00
Radha Krishna Simha Jiguru
c4ae3d34b6 qcacmn: Add support for lock less access of Tx rings
For 4 core CPU system, Tx access can be made lockless by associating
one Tx ring per CPU. Three Tx DATA rings and one SW2TX command ring
can be used for sending data to Tx.

Change-Id: I6e38cad52dffa4e46ff2b736cd6b949d061fa2a4
2020-04-13 21:16:09 -07:00
Wu Gao
6ba047a381 qcacmn: Add interface to write string of CFR stopping
Add a interface to write string of CFR stopping, and indicate to
userspace that CFR has stopped.

Change-Id: Ib1d63cb75cd311b367d5d8100c5c4eb92980392d
CRs-Fixed: 2659373
2020-04-13 21:15:53 -07:00
Wu Gao
b4cc9a28bb qcacmn: Set mac id based on the working band
FW requires to receive WMI_CFR_CAPTURE_FILTER_CMDID with the pdev id
which is based on the working band. It requires srng id when looking
up or releasing DMA address. So add this change to check working band
and set mac id. This is MCL only change.

Change-Id: I763a25b4989607128b2b4c75186eb5bdcd204077
CRs-Fixed: 2641268
2020-04-13 21:15:40 -07:00
Wu Gao
e3ac7503d1 qcacmn: Enable CFR for QCA6490 in target interface
This change adds interface to interface to subscibe wdi ppdu desc
event, adds pdev init/deinit in target interface.

Change-Id: Id6b3dbd500f2f99ab62beeb99b58eb2c22d68857
CRs-Fixed: 2637137
2020-04-13 21:15:24 -07:00
Wu Gao
f8596da937 qcacmn: Use number of chainmask and bandwidth from DMA
CFR uses the number of chainmask and bandwidth from DMA and updates to
userspace.

Change-Id: I8f54cdbfdf77d39f9862848d3cacb61eb4924a05
CRs-Fixed: 2644015
2020-04-13 21:15:09 -07:00
Liangwei Dong
560f438d7b qcacmn: Add rate limit for HEX DUMP qdf api
Add rate limit for QDF_TRACE_HEX_DUMP API to avoid hex dump
message flood in kmsg and driver log.

Change-Id: I34fa16f3723169a07e66c0c806885c06abc2fa57
CRs-Fixed: 2660367
2020-04-13 21:14:55 -07:00
Varsha Mishra
681b2b4642 qcacmn: Make nbuf->next NULL before calling dp_rx_null_q_desc_handle
Invalid peer handler does double free of nbuf and leads to crash.
To avoid this make nbuf->next NULL before calling dp_rx_null_q_desc_handle.

Change-Id: Ia3f92cb5136dbdbfeb1e9cda8a52c474456a4e0c
CRs-Fixed: 2655792
2020-04-13 21:14:40 -07:00
Wu Gao
1391861d2d qcacmn: Remove mac2str in CFR
Use QDF_MAC_ADDR_STR and QDF_MAC_ADDR_ARRAY to replace mac2str.

Change-Id: Ic6382a03a2c4f390e6eaad038aa5a634a9e69153
CRs-Fixed: 2653061
2020-04-13 16:54:26 -07:00
Amir
8ca8f32971 qcacmn: Enable full monitor mode support for qcn9000
Read ini param 'full_mon_mode' and enable full
monitor mode support for qcn9000

CRs-Fixed: 2655293
Change-Id: I6550765246f6541453006fe2db28e01c8e06670c
2020-04-13 14:33:53 -07:00
Vulupala Shashank Reddy
1f34b9d74e qcacmn: Delete cdp ops as part of Componentization of packet capture
As part of componentization of packet capture feature
removed cdp ops of packet capture.

Change-Id: Iea07cbdc5782dee58cd1c87377363cc26479464f
CRs-Fixed: 2659439
2020-04-11 15:58:42 -07:00
Abhishek Singh
aadc772e84 qcacmn: Add igtk def index and igtk key type in crypto
In wlan_crypto_save_key store igtk def index, bigtk def index and
igtk key type in crypto priv.

Change-Id: I96161a6dd376e7e80f88da00c891d15a5645cfa7
CRs-Fixed: 2661197
2020-04-11 12:40:32 -07:00