Commit Graph

238 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
Abhishek Ambure
c76db37021 qcacmn: Clean up CMN_VDEV_MGR_TGT_IF_ENABLE
WIN and MCL both uses common targer_if code for vdev manager.
So legacy code and "CMN_VDEV_MGR_TGT_IF_ENABLE" macro is removed.

Change-Id: I2984ae44f3a7cfa01b8f1455353d09deb4db5759
CRs-Fixed: 2503804
2019-08-11 10:38:20 -07:00
Gyanranjan Hazarika
8e0ae99446 qcacmn: Add target_if changes for dynamic hw-mode config
This feature enables a user to change HW mode dynamically
from DBS to DBS_SBS mode and vice-versa. Currently, HW
mode configuration is only possible through INI setting
requiring a subsequent reboot.

Primary target_if changes are:

1. Add structure definition wlan_psoc_host_hal_reg_cap_ext
to parse and store the new extended regulatory capability
info in WMI_MAC_PHY_CAPABILITIES tlv sent in EXT service
ready WMI event
2. Add API target_psoc_get_num_radios_for_mode to retrieve
the number of radios corresponding to a hw-mode
3. Add API target_psoc_get_mac_phy_cap_for_mode to retrieve
the pointer to the mac_phy_cap info of the first radio
corresponding to the input hw-mode.

Change-Id: Ia10f0fd5e50c0ce0cbe99f9281147266aedce4e9
CRs-fixed: 2490212
2019-08-09 11:18:45 -07:00
Sumeet Rao
eda56478de qcacmn: Process RX FSE Support service advertised by firmware
A new firmware capability advertising support for flow search engine
in HW has been added. Process the new service for flow tagging.

CRs-Fixed: 2475913
Change-Id: Ie69cfd5733b6d6c02792da59dee4f823a72fb431
2019-08-07 04:58:13 -07:00
Alan Chen
bf06e91c8c qcacmn: Add BSS peer for NaN mode
NS offload is not working for NaN mode because BSS peer is not set.
Hence, set the BSS peer for NaN mode as it is done for SAP/P2P GO.

Change-Id: I4c8fbd502cb1d90dd235ae35d0a85a9981e68773
CRs-Fixed: 2494515
2019-07-26 18:21:57 -07:00
Himanshu Batra
e596ea4cbf qcacmn: Replace objmgr void * members with union
Replace objmgr void * members with union of specific datatypes.

Change-Id: I3f9df2b00ca333ebcabdc1a87d1047ea205b0cdc
CRs-Fixed: 2477389
2019-07-19 11:26:07 -07:00
Himanshu Batra
556930bba9 qcacmn: Replace void * tgt_if_handle with abstract type
Replace void * tgt_if_handle of objmgr psoc/pdev with
abstract type handles provided by target interface

Change-Id: I9e0ae991776daa0c25c4ad7b4e4dc022441318a3
CRs-Fixed: 2482708
2019-07-19 02:48:20 -07:00
Abhinav Kumar
8b51c23a16 qcacmn: Handle use-after-free scenario while stopping soft AP
Currently, driver sets BSS peer and self peer to NULL
only in case of PEER AP/GO. It nither set BSS peer nor self peer
to NULL for GO/AP while de-attaching peers. This results in bss peer
use after free issue while stopping soft AP.

In order to fix this issue, the driver should set bss peer and self
peer to NULL for GO/AP as well.

Fix is to set bss peer and self peer to NULL for both PEER and AP
cases.

Change-Id: I055573c062c5a4e71fef2a699131e10fb6d97d71
CRs-Fixed: 2488371
2019-07-16 15:53:45 -07:00
Naga
8e5172276f qcacmn: Add WMI support for vdev delete all peer
Add WMI support for vdev delete all
peer request which will replace individual peer
delete of peers under a vdev during vdev down.

Change-Id: Ia41ae5fbf96a75d2a3e608564742d2a43e0ed2cc
CRs-Fixed: 2456858
2019-07-05 10:26:44 -07:00
Balaganapathy Palanisamy
ac6e852e8c qcacmn: Add new DEBUG IDs for objmgr
Add new DEBUG IDs for more granularity in object manager

Change-Id: Iffedabde1e3ca8d3d5e8b4e5f7f77c2019c2c6bb
2019-07-03 07:26:03 -07:00
Sourav Mohapatra
9301751243 qcacmn: Do not assert for ref leak if SSR/PDR is ongoing
The driver uses a timer to check if there is a potential ref leak by
inducing assert if a given module does not release ref even when the
object is in L-state. But in case there is SSR/PDR, it might take more
time to clean up/release the refs. In this case, no assert should be
triggered.

Add a check in wlan_objmgr_iterate_log_del_obj_handler before calling
the assert API.

Change-Id: Ifb7568e11bff2b9fc610633af730461e33dc5539
CRs-Fixed: 2468301
2019-06-21 10:20:32 -07:00
Jeevan Kukkalli
e454174cf6 qcacmn: Set osif priv to NULL when vdev comp object create fails
In the normal execution osif priv is freed when the object manager
is freed. Whenever there is a error w.r.t to creation of vdev,
osifpriv is deleted as part of vdev destroy. When this error
propagated to caller. Caller tries to again free the osif_priv
in the error path.

Hence set osif priv to NULL in error case to prevent any double
free by caller.

Change-Id: Iaa074ad39aa473e99ab2fd7b14194422f19c168d
CRs-Fixed: 2467327
2019-06-09 02:57:10 -07:00
Paul Zhang
5ea0a91a89 qcacmn: Implement api for interop issues ap
Implement the interface to transfer the info between
host driver and firmware about the ap which has interop
issues with the DUT. It is detected by firmware and
forwarded to user sapce for persistent storage. User
space configs these APs to firmware when the DUT
starts up next time.

CRs-Fixed: 2425197
Change-Id: I3857d2a605baa2673af333a7a0412f1690b59769
2019-05-24 16:01:00 -07:00
Abhishek Singh
3b2666f1a5 qcacmn: Cleanup VDEV SM related flags and unused code
Legacy code for VDEV_SM is no more used, thus clean up flags
CMN_VDEV_MLME_SM_ENABLE and CMN_VDEV_MLME_CMPT_ENABLE.

Change-Id: I4f7b1099d4929f6250b1868c53b73d7c235a9c22
CRs-Fixed: 2457270
2019-05-24 06:42:20 -07:00
sheenam monga
d74e1fdc5f qcacmn: Fix bss peer use after free in stats
wlan_vdev_get_bsspeer() return bss peer without taking the ref count
of the peer and thus if peer is deleted after wlan_vdev_get_bsspeer()
returns a valid peer, the caller will have stale entry of the peer.
Stale entry of peer can lead to Assert.

Use wlan_objmgr_vdev_try_get_bsspeer API for stats to get the BSS
peer which increment the refcount if peer is valid. With this the
peer won't be deleted till the caller release the ref count of the
peer.

Change-Id: I3690f1309cbc7643ed55d8e903814b06f9d8755f
CRs-Fixed: 2454080
2019-05-23 09:31:06 -07:00
Arun Kumar Khandavalli
52ac4710fa qcacmn: Move osif priv deallocation to vdev destroy
osif priv is allocated as part of the vdev object and freed as part of
the logical vdev deletion. There is a race condition where in a
component
holding the reference to the vdev is trying to do an operation using
the osif priv. But in the other thread osif priv can be freed.
This can lead to null pointer exception.

Hence, move the osif priv deletion to the vdev physical destroy.
Change-Id: Iea3fd87cb272a51c5691ee2e39a590861c1b1637
CRs-Fixed: 2449996
2019-05-14 13:03:20 -07:00
Santosh Anbu
261451a46c qcacmn: Add API to fetch logically deleted peer list of a vdev
Add API to fetch the logically deleted peer list for a given vdev
and also add change to move peer delete request and response
related stats from pdev to vdev layer

Change-Id: Ibaac286a1e6ca86988b223055c15a6b9ba6cf4b9
CRs-Fixed: 2448111
2019-05-13 03:31:44 -07:00
Vivek
16ad475315 qcacmn: Return on failure of releasing reference of object
The release ref APIs for an object first checks,
if the caller is holding a ref, and if yes, it decrements
the count.

If not, there is an error print and an assert, and if the assert is
disabled, the total ref count is decremented in the code, which could
lead to the object getting destoyed, even when it is being used or
some other component holding its ref.

So, if release ref API for an object is called by a component, which
is not holding the ref, we should return, so its handled correctly
even when assert is disabled.

Change-Id: I90de5c1b2e485e80c4b3138fc0fd99f5509d06a2
CRs-Fixed: 2417616
2019-05-08 04:47:19 -07:00
Abhishek Singh
7528ff39ce qcacmn: Add API to get and increment ref count of valid bss peer
wlan_vdev_get_bsspeer() return bss peer without taking the ref count
of the peer and thus if peer is deleted after wlan_vdev_get_bsspeer()
returns a valid peer, the caller will have stale entry of the peer.

Thus add an API to get the BSS peer and increment the refcount if
peer is valid. With this the peer won't be deleted till the caller
release the ref count of the peer.

Change-Id: Ifb3b4de54f3aace359a35a821265c80119df1f50
CRs-Fixed: 2444996
2019-05-01 12:27:09 -07:00
Karunakar Dasineni
142f9baf47 qcacmn: Add new feature to support protocol tags
With this feature, using appropriate commands, link layer, network layer,
transport layer and some of the application protocols can be tagged with
the user provided tag values for easier identification of protocols. The
supported protocols today are as follows.

ARP, DHCPv4, DHCPv6, DNS over TCP (v4), DNS over TCP (v6), DNS over UDP
(v4), DNS over UDP (v6), ICMPv4, ICMPv6, TCPv4, TCPv6, UDPv4,
UDPv6, IPv4, IPv6, EAP.

Receive packets are tagged by hardware. Tags are applied after the first
matching rule. Hence it is recommended that the rules are
programmed in such a way that tags are configured from application layer
to data link layer to get expected results.

Change-Id: Ibdc2bd2b78234f482074955e89fb93f05988eaca
2019-04-26 15:31:10 -07:00
Sourav Mohapatra
1792251be9 qcacmn: Assert in case any obj is in L-state for long
Any obj ref can be taken by modules. In the case the obj is logically
deleted but not deleted physically due to some pending reference not
released, it leads to memory curruption issues in unexpected places.
Debugging these issues becomes difficult as there is no indication where
the ref leak has happened. Especially when the curruption occurs before
stop_modules is called (where there is check for ref leaks)

To ease the process of debugging such issues, add a print to show the
modules holding the refs after logical deletion. Also, assert in
case any objs are in logically deleted state for longer than 10 secs.

Change-Id: I8fa55693c89f146d859cc9ec3355f5eb1e2c3853
CRs-Fixed: 2419733
2019-04-18 00:28:36 -07:00
Naga
9dad9767b1 qcacmn: Cleanup duplicate fields in vdev_mlme
Add change to cleanup duplicate fields of
of vdev_mlme, which are also in mlme_channel_param
and their dependencies while updating
vdev_start_param. Cleanup unused mlme_cfg_ids.

Change-Id: Ie32971283a337f04692c0c0bc7f41fff75c090c3
CRs-Fixed: 2407953
2019-04-11 01:14:21 -07:00
Akshay Kosigi
48debcb1f6 qcacmn: Move get macaddr API at proper place
Move get macaddr from peer API at appropriate place instead of fetching
it everytime and not using it.

Change-Id: I01349a672215395795cd08cd65d98ad8a08b95b0
CRs-Fixed: 2431163
2019-04-09 11:56:50 -07:00
Akshay Kosigi
09b50e625d qcacmn: Add psoc id value to debug prints vdev mlme timer APIs
Add psoc id value for the debug prints of, error handling vdev mlme timer
APIs

Change-Id: I7d225114e91ff4b6f898450ca3ef7d2e21be631a
CRs-Fixed: 2427905
2019-04-05 18:45:44 -07:00
Bala Venkatesh
f96d9cf159 qcacmn: Replace duplicate api's of vdev_connected
Currently, the vdev connection status is checked by getting
the bss peer of that vdev, and if the bss peer is in associated
state then vdev connected status is sent as true. It can happen
vdev is present and bss peer is deleted after getting the bss peer
from vdev pointer. Then bss peer can not be dereferenced to get the
its status.

Instead remove all the duplicate api's tdls_is_vdev_connected,
pmo_core_is_vdev_connected, and wlan_vdev_is_connected with
wlan_vdev_is_up. wlan_vdev_is_up gives success status
if associated.

Change-Id: I863c3c0689f329870bd08c813813c16956135209
CRs-Fixed: 2426092
2019-04-05 08:37:35 -07:00
Akshay Kosigi
2f7256aa8b qcacmn: Move vdev mlme related code to right file
Move vdev mlme related code from vdev objmgr to vdev mlme files

Change-Id: I4aafdd09376f5cf2ae5c2ad7f0276c9a67ef1d19
CRs-Fixed: 2423319
2019-04-04 08:51:34 -07:00
Santosh Anbu
6ca41ef58f qcacmn: Update ref cnt debug id doc
Add change to update the reference count module id doc.

Change-Id: I4636a4b87f04b8ae608b18c77f9bd18e7fb3ee71
CRs-Fixed: 2426772
2019-04-04 01:52:36 -07:00
Srinivas Pitla
d9ad48d3ff qcacmn: Handle RADAR detect in RESTART state
If MLME gets RADAR detected event while waiting for RESTART response from
FW(RESTART_PROGRESS substate), it sets PDEV RADAR detect deferred flag.

Once VDEV SM moves from START to other state, it invokes MLME SM callback,
which checks whether “RADAR detect defer” is set.

If it is set, SM callback posts message to scheduler to notify all VDEVs on
RADAR detection.(from here, flow goes as regular radar detected event)

Change-Id: Icaa2aee900be60c12c5b38b1d199bb01ba31f722
CRs-Fixed: 2390019
2019-03-28 01:25:24 -07:00
Jeff Johnson
dcb2769793 qcacmn: obj_mgr: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within umac obj_mgr replace any such comparisons with
logical operations performed on the pointer itself.

Change-Id: I0f556e8baa9126511420a8d4c1b1a5e4ee220bab
CRs-Fixed: 2420149
2019-03-24 19:27:05 -07:00
Santosh Anbu
e0f17e57bb qcacmn: Add object manager API to iterate psoc list
Add object manager to iterate through all the psoc in
the system and call the provided callback with relevant
arguments

Change-Id: I92f4c1248447ce14413b666076e515c0569385a0
CRs-Fixed: 2413775
2019-03-24 14:55:04 -07:00