Commit Graph

762 Commits

Author SHA1 Message Date
Balaganapathy Palanisamy
3020842b6d qcacmn: Serialize PDEV CSA channel switch
CSA channel switch call directly interacts with VDEV
state machine, move CSA restart to go through serialization
service.

CRs-Fixed: 2598123

Change-Id: Ic0bea64b56f54eed354e11d0873ae4423e365cca
2020-01-17 21:29:38 -08:00
Himanshu Batra
8fcc17ccf9 qcacmn: Create wrapper API to check all leaks at psoc
The current implementaion check for peer, vdev and pdev leaks on
psoc in order and if any leak is found for peer then QDF_DEBUG_PANIC
is called and vdev and pdev leaks are not checked. Similar is the case
if vdev leak is found, pdev leaks are not checked

Adding a wrapper API to check all the leaks and then do panic if any
leak is found

Change-Id: Icf6622760f3646b82f893beb7415b95307e2ccd7
CRs-Fixed: 2599228
2020-01-16 08:08:33 -08:00
Neha Bisht
503663c6da qcacmn: Structure optimized through poke-a-hole tool
Structure memory is being optimized by aligning field with
bus address length using pokeahole tool.
This patch optimizes structure linked in obj_mgr and scheduler
modules.
Structure           Bytes saved (64bit)   Bytes saved (32bit)
scheduler_ctx       8 bytes               4 bytes
wlan_channel        8 bytes               8 bytes

Change-Id: I298946b55328d8d9b564c140e0a59e0b8702fab0
CRs-Fixed: 2587842
2020-01-11 16:18:50 -08:00
Yu Wang
1cd103900e qcacmn: Initial version of coex component
Add initial set of coex files, implement the basic functions.
Coex component is used to process coex related configurations.

CRs-Fixed: 2565088
Change-Id: I8b9600809691b808f97c621cb329a6ab9941814c
2020-01-09 02:40:23 -08:00
Amruta Kulkarni
0f0a36c8d4 qcacmn: Change info/err prints to debug in roaming path
The printk buffer is protected by a global raw spinlock for readers
and writers. This restricts the contexts that are allowed to
access the buffer. So large latencies exists when printing to
kmsg done with QDF trace levels WARN, INFO, ERROR. This results
in roaming KPI for maximum transition time exceeding the expected
100ms.
So change info/err prints to debug prints in roaming path
to reduce delays in roaming time.

Change-Id: I9cdf043da6e88d735ab39812e74ed24784ceede3
CRs-Fixed: 2594867
2020-01-08 20:11:15 -08:00
Sandeep Puligilla
904e527aa7 qcacmn: Add new feature to control fils discovery on 6Ghz Sap
6Ghz SAP needs to send either a probe response or fils
discovery at every 20ms.

Add a new feature to configure the probe response or
fils discovery frame.

Change-Id: I3b9842021db94515ae4dccbcdc573a4cd84caa56
CRs-Fixed: 2591147
2020-01-07 00:41:39 -08:00
aloksing
18f309c7f4 qcacmn: Add debug support for vdev/peer reference and release
Allocate node for new entry and add it to existing list of function or line
If function or line already present in list then increment count

Change-Id: I3d737dcd33862f133b52c6d694c89f6d6b1517a5
2020-01-02 05:18:15 -08:00
Surya Prakash Raajen
a3baeee819 qcacmn: Memory optmization of Node/peer structure variables
Remove unused variables and reduce the memory by
the structure padding.

Change-Id: Ic49829ab463d75af6d7fc1ac36df16cabdf447e2
CRs-Fixed: 2587049
2019-12-27 01:40:40 -08:00
Alok Singh
192bbaa088 qcacmn: Add debug support for vdev reference and release
Add function name and line number while taking/releasing
references for vdev to trace Object Manager references

Change-Id: Ie8a7d77db2f3c7b58536ab267c665299cb67152e
2019-12-24 20:34:09 -08:00
Alok Singh
c5394665b2 qcacmn: Add debug support for peer reference and release
Add function name and line number while taking/releasing
references for peer to trace object manager references

Change-Id: I93c30d62ecaa979f8c2680eec68f723d2d3c4292
2019-12-24 20:33:55 -08:00
Disha Das
cde63cdd01 qcacmn: Obtain current PN number for a peer
On rekey, the STA resets it’s PN to 0 but, the
AP sends out pending traffic with old PN values
before it resets the PN as well.
This causes traffic to stall and hence, TSC (transmit
sequence counter) should not be set to zero during rekey.

Instead, obtain last PN number for a non-bss peer while
configuring new key and pass the values to hostap.

Change-Id: I4a604f23944c941c6ade2f57ab03781bc78f7b40
2019-12-18 09:24:44 -08:00
Abhinav Kumar
04b61d6e39 qcacmn: Get the valid vdev in get_vdev_by_macaddr_from_pdev
In wlan_objmgr_get_vdev_by_macaddr_from_pdev driver checks the
first vdev matching the mac address and try to get ref and return
NULL if it fails.

In case if a vdev is logically deleted but not physically deleted
(some ref are pending) and a new vdev is added with same mac address
at the tail of the vdev list, the
wlan_objmgr_get_vdev_by_macaddr_from_pdev always return NULL cheking
for the logically deleted vdev, even when a valid vdev is present
after the logically deleted vdev.

Thus continue to next vdev if try get ref fails for the vdev.

Change-Id: Icd67ce8830460fca7bb4c19e81b2e9f764fb5dba
CRs-Fixed: 2580697
2019-12-10 00:51:59 -08:00
Abhinav Kumar
4c3c73a375 qcacmn: Remove unused serialization API
Remove unused serialization API
wlan_serialization_get_active_list_count.

Change-Id: I80c1cd5693fb3dda91ffd7de01c1df244e648135
CRs-Fixed: 2580681
2019-12-10 00:51:51 -08:00
Shashikala Prabhu
1e7bd262fd qcacmn: Add restricted 80+80 MHz bit in soc caps
Restricted 80+80 MHz  capability is reported by FW in service bitmap.
Based on this support set soc's extcap feature bit.

Please note, wmi_service_bw_165mhz_support will be renamed as
wmi_service_restricted_80p80_support once the FW changes are available.

Change-Id: I88f89eecd916c40ea8669c792dde3a335e4bac56
CRs-Fixed: 2579543
2019-12-10 00:51:42 -08:00
Pooventhiran G
9a1b59247c qcacmn: Reset keys to zero after use
In functions that use key values, reset the local variables (key) to
zero after use to avoid security vulnerability.

Change-Id: I105b1abf7c707102ef99bbe4fa213708039d933e
CRs-fixed: 2581402
2019-12-09 18:57:51 -08:00
Srinivas Pitla
8e869fff23 qcacmn: Define Peer free notification framework
Define framework to notify registered callbacks on peer freed.
Interested modules can register their callbacks with object manager.

Change-Id: I9ab0e45f7841b1609b9ada3b50335299b462b630
CRs-Fixed: 2578099
2019-12-09 17:29:02 -08:00
Disha Das
bcb1f1738f qcacmn: Replace return value 0 with QDF_STATUS_SUCCESS
Replace return value 0 with QDF_STATUS_SUCCESS as
per coding standards.

Change-Id: I27104d4a9eed29a7008b8970cf78c2ecd097b996
2019-12-06 08:41:10 -08:00
Arun Kumar Khandavalli
614d1e4476 qcacmn: create the vdev response timers in psoc_mlme
Move the vdev response timer from the vdev object manager structure
to the psoc mlme structure.

Change-Id: Ieb87ac6549aa23e0beb61441fea459d3db78c2f3
CRs-Fixed: 2563410
2019-12-05 10:45:08 +05:30
Pavankumar Nandeshwar
5f29f5f5c2 qcacmn: Update obj_mgr debug ids for ol_if_ops changes
Remove WLAN_TGT_IF_DP_PEER_REF_ID and add WLAN_PDEV_TARGET_IF_ID

Change-Id: I316d108c3e5bd27f6abc00b8d162a45284fffec6
2019-12-04 07:44:33 -08:00
Gururaj Pandurangi
85d32ab984 qcacmn: Rate limit logs in serialization API
Rate limit logs in wlan_serialization_peek_head_active_cmd_using_psoc
to prevent excessive logging

Change-Id: I25bc93754cf4fe5d56fdb67c15b79b72fcda9efd
CRs-Fixed: 2574786
2019-12-03 01:15:38 -08:00
Rachit Kankane
98ec4d132b qcacmn: use spinlock before iterating
Before iterating in pending list, use spinlock to avoid possible
race condition.
Remove function wlan_serialization_get_active_list_next_node_using_psoc
as it not being used and is part of legacy flow which is suppose to be
removed eventually.

Change-Id: I9e7cbd9db8b5a1c45915bf5291cd5011c276d0e2
CRs-Fixed: 2573425
2019-12-02 12:39:42 -08:00
Pragaspathi Thilagaraj
120b2490ec qcacmn: Add support for RSNX IE
SAE key derivation requires use of a secret element, PWE. This
element is deterministically discovered by repeatedly hashing
the password with some additional information until the
resulting hash is the abscissa of a point on the elliptic curve
(for ECC) or by exponentiating the hash digest to a constant to
produce an element (for FFC). This "hunting-and-pecking" loop
method is prone to side channel attacks.

To avoid this, a direct hashing to element technique in SAE is
introduced in IEEE P802.11-REVmd/D3.0. Support new RSNX IEEE
as part of the hash to element PWE derivation. The user space
sends the RSNX IE in the connect request.

Add support for new RSNX IE with element ID 244.

Change-Id: I61a40ff14e15612735c3f3750e2c47d764feeb62
CRs-Fixed: 2569600
2019-11-26 07:10:53 -08:00
Vivek
f011832a65 qcacmn: Update blocking command flags atomically
When moving a blocking command from pending to active queue,
we release the lock and call the activation cb.
After the activation cb returns, we update the blocking cmd
waiting flag based on the active cmd node's "is_blocking" param.

If the activation cb is also resulting in removing the command,
then after the cb returns, the active cmd node is returned to the
free pool and our check fails, and we miss to update the blocking
cmd waiting flag, resulting in no further commands moving to the
active queue.

The update to the blocking command should be done atomically,
immediately after it moves to active queue and before releasing
the lock for the activation callback.

Change-Id: Idedccb16ce68bb2166fb3970cd231fe738ec6af2
CRs-Fixed: 2554767
2019-11-19 13:05:08 -08:00
Arun Kumar Khandavalli
5377f457a1 qcacmn: Introduce new api to disable the vdev serialization queue
MCL presently sends the vdev delete to firmware via serialization,
with a new requirement vdev delete cannot be sent via serialization.
So, disable the serialization for the vdev before sending the vdev
delete to firmware.

Change-Id: Ieffccaf815eff7627d39b0191a7be121e85965fd
CRs-Fixed: 2566113
2019-11-15 16:01:32 -08:00
Sandeep Puligilla
aba2b0c42b qcacmn: RNR IE parsing support
Add RNR IE parsing support on scan module.

Change-Id: I7a0685f16a61a45910212b2d8fe5cbc12b5bd92e
CRs-Fixed: 2557271
2019-11-09 19:10:25 -08:00
Abhishek Singh
3c5f8ef089 qcacmn: Fill cfreq0 and cfreq1 in scan entry from HT/VHT/HE IEs
Secondary channels cfreq0 and cfreq1 are not filled in scan entry,
So fill secondary cfreq0 and cfreq1 in scan entry from HT/VHT/HE IEs.

Change-Id: I09ee15a27debe554d8ddbac8e8b3c0315aec2c1a
CRs-Fixed: 2560273
2019-11-08 00:11:11 -08:00
Arun Kumar Khandavalli
95b3c1a9a2 qcacmn: Avoid possible use-after-free in wlan_objmgr_vdev_obj_create
There is use-after-free of vdev object in wlan_objmgr_vdev_obj_create
wherein vdevid is being accessed to log the create failure after the
vdev is freed.

To resolve the issue, Log the error with vdev_id before freeing the
vdev

Change-Id: Ia509f90cd2219f657ecdecbfb26d397daa3beda6
CRs-Fixed: 2559556
2019-11-07 16:48:14 -08:00
Sourav Mohapatra
d5dde1b9ae qcacmn: Increase timeout to avoid false assert
Currently, the timeout value LOG_DEL_OBJ_DESTROY_ASSERT_DURATION_SEC is
set at 24 seconds. This is not sufficient for various cases where the
delay caused are genuine (FW and HW delays), thus leading to unwarranted
device assert.

Increase the timeout to 32 seconds to mitigate this.

Change-Id: I799b45b0d5f25a9fcf68f88d385994e31c56e939
CRs-Fixed: 2546641
2019-11-07 01:18:49 -08:00
Abhishek Ambure
986f5c97b9 qcacmn: Get phymode from HE phy capability
WLAN phy mode is calculated from HE capability.

Change-Id: I217cf6609f526a761c183395fe67f67adc95c4af
CRs-Fixed: 2550362
2019-11-05 09:27:42 -08:00
Wu Gao
5988e8b7d2 qcacmn: Remove unnecessary logs in loop
There is unnecessary logs in loop which affect useful log capturing.

Change-Id: I37b2c8123a280e4ec080ac1fb75e43135936fd79
CRs-Fixed: 2552104
2019-10-27 19:27:56 -07:00
Pavankumar Nandeshwar
0336eb937e qcacmn: Add an API to get peer using mac from vdev
Add an API that iterates through the peer_list of a vdev
and gets peer using peer mac address.

Change-Id: I9b7edd3816a51ee89d68be4cc876155fa1a79049
2019-10-24 21:42:07 -07:00
Manikandan Mohan
ae310478dd qcacmn: Fix channel conversion utility functions
Update wlan_chan_to_freq and wlan_freq_to_chan utility functions to
handle invalid channel number and freq value of 0 respectively.

Change-Id: I92e2d5026bb93439b77b749d447654ceb9413fde
CRs-fixed: 2546771
2019-10-19 22:11:54 -07:00
Rhythm Patwa
7232cb187e qcacmn: Add support to parse 6GHz specific IEs
Add support to scan for the 6GHz band capabilities
IE and parse the IE. Added peer assoc param for updating
the minimum data rate advertised by the peer in 6GHz
Opration information.

Change-Id: Iebb4379d321832f3ed2bcd3174a54843fa2d497c
2019-10-16 21:54:30 -07:00
Vivek
4ad877f928 qcacmn: Print vdev, pdev and psoc info before being destroyed
Add debug code to print the vdev, pdev and psoc info before getting
destroyed. This will help in cases where we dont get crash dumps
for panics and we need to look up few important data, which
can be done by enable object manager debug.

Change-Id: Iab1895d348ccf225ee6390abef26b76936fbe560
CRs-Fixed: 2528290
2019-10-14 20:39:24 -07:00
Abhishek Singh
f3f9797014 qcacmn: Fix enum wlan_phymode to include proper phymode value
Few phymode are missing from enum wlan_phymode and many are not
valid phymode, e.g for 5ghz 40minus and 40plus are not valid.

So add the missing enums and remove invalid enums from enum
wlan_phymode.

Change-Id: Id6a1fb4cf0d629cc410bd262a048b5050d05ed5d
CRs-fixed: 2505422
2019-10-12 13:10:32 -07:00
Shiva Sankar Gajula
8e829748d9 qcacmn: Handiling FT action frames in driver
STA is unable to do roam from one AP to another AP due
to not handiling FT action frames that are received from
the STA.
So, Added changes to handle FT action frames without
dropping the FT action frames in driver.

Change-Id: I6461fe84ffb29b33636b6831e6ed046fae22e19e
2019-10-05 05:40:28 -07:00
Santosh Anbu
659379aeff qcacmn: Update log level of the debug message
During vdev reference release if double free is attempted for, then
the vdev references are printed. But the vdev id and the reference id
for which the reference release was attempted is not printed.

Add change to print this log, which will help in debugging vdev
reference release related issues.

Change-Id: I8c1942dc770a1dce2e25cda8c3c6aa8c056afb8e
CRs-Fixed: 2531227
2019-09-29 21:58:56 -07:00
Abhishek Singh
21116dd976 qcacmn: Fix removal of the serialization command if timer start fail
In case vdev is logically deleted the serialization active timer fails
to start because it fails to get vdev ref count. Now in this case the
cmd is not removed from the active queue and is just marked
CMD_ACTIVE_MARKED_FOR_REMOVAL because CMD_MARKED_FOR_ACTIVATION is set.

Even during pdev stop as CMD_MARKED_FOR_ACTIVATION is set the command is
not removed.

Fix is to reset CMD_MARKED_FOR_ACTIVATION flag and handle it in same way
as the activate failure case.
Also reset the timer cmd after timer start failure to avoid vdev ref count
release by WLAN_SERIALIZATION_ID even when it failed to take the ref count
in first place.

Change-Id: Ic078efa8ce4ad563087381b8c95eba91894d8a48
CRs-Fixed: 2535245
2019-09-27 02:46:53 -07:00
Himanshu Batra
591b333f00 qcacmn: Decrease log level of some expected prints
Log level of some expected prints were set to error level because
of which the prints were coming frequently.
Moving log level of these expected prints from error to debug level.

Change-Id: Ifd2672cd73db02488ce3055ca5e35d423d4f4761
CRs-Fixed: 2522164
2019-09-26 22:05:30 -07:00
Srinivas Pitla
9e37733c50 qcacmn: Increase Logical deleted object timeout value
Currently, FW has TTL of 5 sec for management frames, if a frame
is queued just before logical deletion, it takes max 5 sec to complete,
by considering other latencies, increaseing it to 8 sec.

Change-Id: I6861d9557489bcf10e60ff32d06e88be23535d48
CRs-Fixed: 2526239
2019-09-25 03:42:10 -07:00
Min Liu
2c14fae3d5 qcacmn: Add interface to get / set eLNA bypass
Add interface to get / set eLNA bypass from / to firmware via WMI.

Change-Id: I2ed78aece6703c18999fdfbfdfa159a2abd477a6
CRs-Fixed: 2498526
2019-09-21 02:47:10 -07:00
Rajeev Kumar Sirasanagandla
63b0f33c4c qcacmn: Use frequency for channel operation
As a part of 802.11ax amendment, 6GHz band operation is added.

Since the 6 GHz channel numbers are overlapping with existing 2.4GHz
and 5GHz channel numbers, use frequency to identify unique channel
operation instead of channel number. Channel frequency is unique across
bands.

As a part of above requirement, in the existing WMI interface handlers
and related functions, wherever missing, add frequency attributes to
identify unique channel operation.

Change-Id: I7c7542aa8488b4c55764c733590b77c64c397029
CRs-Fixed: 2517900
2019-09-18 11:23:14 -07:00
Vivek
91dcde9050 qcacmn: Check for pdev/psoc before requesting serialization psoc object
The serialization vdev destroy handlers extracts the psoc
from the vdev, and get its psoc component object.

If the pdev or psoc is NULL for some reason, we get a
crash in object manager while trying to retrieve the serialization
psoc object.

So check for valid pdev/psoc before we get the serialization psoc object.

Change-Id: I9ca45654250403a8b5fe674431251defd1aac6e8
CRs-Fixed: 2524231
2019-09-17 03:56:23 -07:00
Alan Chen
7a0394d444 qcacmn: Move wakelock outside of spin lock
Wake lock acquire and release API is doing console logging, which has
side effects and hence move wake lock APIs outside spin lock.

Change-Id: Ib697c5fc1b1c44dbeafd94a72cb79e63640cb0d7
CRs-Fixed: 2521000
2019-09-11 17:27:50 -07:00
Ashok Kumar
39c0fea7c7 qcacmn: Prevent FILS delkey from calling CRYPTO_OPS
Prevent delkey to call crypto_ops for FILS cipher
type, as this keys are not present in FW.

Change-Id: Ica13a62b6822ee3cee40acffa98b7cc1cb122120
CRs-Fixed: 2520517
2019-09-10 09:04:06 -07:00
Gururaj Pandurangi
2be1af58a5 qcacmn: Change logging level in object manager
Change log level to debug level since any console logging
under the spin lock has side effects due to slow UART

Change-Id: I21dca8f4eb9ba563d2ce96274d32405d1817d13e
CRs-Fixed: 2521056
2019-09-09 18:46:47 -07:00
Bala Venkatesh
ae946e39c7 qcacmn: Reduce the log level
Reduce the log level from err or info to debug so that logs
are not printed on console.

Change-Id: I0d33c2a8f5b4bb4974656ac0d1eb6713a74cb5f4
CRs-Fixed: 2516287
2019-08-29 01:44:16 -07:00
Disha Das
07721fc036 qcacmn: Add wlan_crypto_is_key_valid check
Add wlan_crypto_is_key_valid to check if key
is valid.

Change-Id: Ica71f56f1739261fff425e793ec8c15d2523e8e7
2019-08-19 06:19:30 -07:00
Akshay Kosigi
07df14c270 qcacmn: Move config files out of cmn dev
Move AP specific CONFIG files out of cmn dev

Change-Id: I53adb20ea910c0bc8842daa85cb762d4d3968e45
CRs-Fixed: 2506563
2019-08-19 02:10:57 -07:00
bings
b2e00f901f qcacmn: Add new obj mgr api wlan_pdev_peek_active_first_vdev
wlan_pdev_vdev_list_peek_active_head can't be used out of object
manager, because object manager structures can't be referenced
outside object manager.

Add wlan_pdev_peek_active_first_vdev which can be used out of
object manager, because it only needs pdev parameters.

Change-Id: I1d32ec2b5342dbdcbbb817d80623f802011892b0
CRs-Fixed: 2507969
2019-08-15 23:31:24 -07:00