Commit Graph

1007 Commits

Author SHA1 Message Date
Amruta Kulkarni
f63bcbe4e3 qcacld-3.0: Reduce mlme logging level from err to debug
In wlan_mlme_configure_chain_mask(),mlme_legacy_err is
updated to mlme_legacy_debug,as its not an error condition.

Change-Id: Ibdf33124ee970bcfcc9d57df9f3b3fc6990072fe
CRs-Fixed: 2599510
2020-01-15 08:19:06 -08:00
Liangwei Dong
f9a0512cae qcacld-3.0: Check SBS supported or not before set hw mode
If the request is SBS action and the HW doesn't support SBS,
return QDF_STATUS_E_NOSUPPORT. The caller will continue to
connect/start_ap instead of failure when
policy_mgr_current_connections_update return
QDF_STATUS_E_NOSUPPORT.

Change-Id: I158f90c13e2685697b82c874a247883f21f013cb
CRs-Fixed: 2602194
2020-01-14 19:42:12 -08:00
Vevek Venkatesan
451f996d6b qcacld-3.0: check if non-zero list count before deleting node
Add a check if list count is non-zero before deleting the node
from IPA tx descriptor list.

Change-Id: I9913c636107686755ffc5da2b585028a4be7a1e9
CRs-Fixed: 2601601
2020-01-14 13:02:04 -08:00
Sravan Goud
dd78eef93a qcacld-3.0: Reset ipa pending tx timer at pipes enable
In case of STA + SAP ipa pending tx timer is started when last
SAP client disconnects. Again if client connects back timer is not
stopped at pipes enable. Later some time if suspend kicks in and
during bus suspend if there are no ipa tx pending ipa pipes are
disabled. This leads to issues such as data stall, invalid IPA
doorbell register access. So reset the timer during ipa enable pipes.

Change-Id: Id6034596f52f98c793674c9d9e5f7918c5c3d455
CRs-Fixed: 2598559
2020-01-12 06:23:53 -08:00
sheenam monga
1fa0514eb7 qcacld-3.0: Fix sta_ds use after free
lim_is_pkt_candidate_for_drop() uses sta_ds to update last assoc
and deauth/disasocc received time without taking any lock for
sta_ds. deletion of sta_ds in pe_delete_session before accessing
sta_ds in dph_lookup_hash_entry can lead lead to Assert.
Similar is the case with sta_ds->last_assoc_received_time and
sta_ds->last_disassoc_deauth_received_time.

Fix is to use peer_priv instead of sta_ds and update
last_assoc_received_time and last_disassoc_deauth_received_time of
peer_mlme_priv_obj. In this case refcount gets increased for valid
peer and peer won't be deleted until lim_is_pkt_candidate_for_drop
releases the ref count of the peer.

Change-Id: I9daf31f9dd7b509eaf38a93078bb7418605b1c74
CRs-Fixed: 2598841
2020-01-11 17:53:06 -08:00
bings
b188056965 qcacld-3.0: Don't disable dfs phyerr offload when no sap/go in DFS ch
According to FW, DFS phyerr offload should be enabled before vdev start,
otherwise FW can't start DFS phyerr offload function.

Do not send DFS phyerr offload disable wmi command before vdev stop, and
FW will handle all the necessary cleanup in vdev stop wmi command.

Without DFS phyerr offload disable wmi command, DFS phyerr offload is
enabled before vdev start.

Change-Id: Id6275e9716afb34316cf46b69dd0b4f82b73ac5d
CRs-Fixed: 2598263
2020-01-11 11:12:29 -08:00
Kiran Kumar Lokere
4dd5c4f06b qcacld-3.0: Set the default SW retry limit value to 16
Set the default software retry limit value to 16 and fix the typo
in configuring the non aggregation software retry limit.

Change-Id: Ia6ef7cc39f47ef91c2c338e48561e0275445750f
CRs-Fixed: 2599467
2020-01-11 01:50:08 -08:00
bings
059c4a06c2 qcacld-3.0: Configure TDLS off channel mode when band switches
Disable TDLS off channel if 2g or 5g is disabled, restore TDLS off
channel configure when all bands are enabled.

Change-Id: Iabfdcdbf84e4a6313ad04e381b70e21c871d66c2
CRs-Fixed: 2595303
2020-01-10 04:07:57 -08:00
Yue Ma
e5a28495ab qcacld-3.0: Cleanup CRYPTO_SET_KEY_CONVERGED for MAC layer
CRYPTO_SET_KEY_CONVERGED is a temporary flag which is used for
converged crypto component transition. The transition has already
been done, so cleanup legacy code related to the flag in MAC layer.

Change-Id: I34fb7a6a67dd6dba3fa69c98ef10a1bd51383e36
CRs-fixed: 2593525
2020-01-09 20:21:42 -08:00
Amruta Kulkarni
e673511908 qcacld-3.0: Change info/err prints to debug in roaming path
In roaming path, while processing roam synch indication info/err
prints at the driver adds up latency to the total roaming
transition time and the KPI for maximum transition time exceeds
the expected 100ms. 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.

Change the redundant/less significant info, error, warn level
prints in roaming path to debug level.

Change-Id: I8e2a03ddef8f3cd680263939f6e0275b8703e681
CRs-Fixed: 2597624
2020-01-08 20:10:31 -08:00
gaurank kathpalia
570f0aff4f qcacld-3.0: Fix issue for SMM before vdev start on 2.4ghz
Scenario:-
1. Turn on SAP and STA on 2.4ghz and 5ghz
2. Turn off SAP
3. Turn off STA
4. Turn on SAP on 2.4ghz

Issue:-
In the start ap function, the driver calls
the stop opportunistic timer and calls the handler
to goto SMM mode.
After this, the SAP checks whether it requires the
DBS or not and then requests for DBS also, but since
the driver is already in DBS mode this command gets
rejected, so there would be 2 commands in the serialization
queue which would be SMM and start AP, which would lead to
a crash as SMM is sent before a connection on 2.4ghz as
Hastings is not capable to start a vdev in 2.4ghz without
DBS mode.

Fix:-
1.Not allow SMM if the current connection requires DBS
2. Check the HW capabilty in the active command only and
not before that to protect the reliability of hw mode.

Change-Id: I1c0c05ea05ba14d1556af2612daa3de2ffcba367
CRs-Fixed: 2587508
2020-01-08 02:03:40 -08:00
Jianmin Zhu
e6b80253bc qcacld-3.0: Permit 3 SAP channel switch
During mdm SAP+SAP+SAP case, if 5G band is disabled for modem
N79 band, need all 5G SAP switch to 2G to force scc.
when 5G band is re-enabled, all 5G SAP can switch back to 5G.

Change-Id: Ief7d7c85a7881885bd95c8af6be8d4e428d07041
CRs-Fixed: 2597602
2020-01-07 19:20:58 -08:00
Sandeep Puligilla
511c6e2402 qcacld-3.0: Add ini support to control 6G SAP fils disc
6Ghz SAP needs to send either a probe response or fils
discovery at every 20ms.

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

enable_6g_sap_fils_discovery=1 sends fils discovery frame
at every 20ms.
enable_6g_sap_fils_discovery=0 sends probe response frame
at every 20ms

Change-Id: I6c5fb339135cf11be071d73970ea3704441380eb
CRs-Fixed: 2586524
2020-01-07 00:41:09 -08:00
Pragaspathi Thilagaraj
71a1fa4ca0 qcacld-3.0: Add diag log support to print roaming related stats
When roaming is complete, firmware sends WMI_ROAM_STATS_EVENTID
to host driver. This event has details regarding the roam
trigger reason, roam scan and candidate details, roaming result
and 11kv info sent after roaming to AP. Parse this event and
fill the below diag log report to print this in logcat:
LOG_WLAN_AUTH_ASSOC_TX_RX_INFO
LOG_WLAN_ROAM_TRIGGER_INFO
LOG_WLAN_ROAM_SCAN_INFO
LOG_WLAN_ROAM_RESULT_INFO
LOG_WLAN_RRM_TX_RX_INFO

Change-Id: Ie09dc8ad5b236d0925327dba73a3f2e73a80109a
CRs-Fixed: 2597057
2020-01-06 20:35:43 -08:00
Jianmin Zhu
b01384b43d qcacld-3.0: P2P Go failed to switch to 2G band when 5G disabled
If g_enable_go_force_scc isn't enabled, P2P Go failed to switch
to 2G band when 5G disabled.

Fix: Check whether need switch channel for band restriction
first, check go force scc later.

Change-Id: Icf8de51321debea2806585d47d2bd4fc6486075e
CRs-Fixed: 2594279
2020-01-03 01:26:38 -08:00
gaurank kathpalia
628d3ef690 qcacld-3.0: Check for zero/broadcast BSSID in BLM
Currently the BLM does not check the BSSID of
the entry for 0 or broadcast BSSID, and thus
can lead to addition of many entries with such
property.
This would also result in removal of old valid BSSID
entry data, which is essentially required.

Fix is to check the BSSID of the entry for 0
or broadcast, and reject them if not valid.

Change-Id: I2939673a1c4efb1a22e03ffe82121513c071fa4b
CRs-Fixed: 2595331
2020-01-02 08:15:55 -08:00
Srinivas Dasari
c9e048e52f qcacld-3.0: Add NAN vdev_id entry to policy mgr
Firmware sends vdev id allocated for NAN discovery in NAN enable
response. Validate the same and add corresponding entry to
policy manager.

Change-Id: I5e7426c6739620e05480fb90cecdb8ff156fd4cd
CRs-Fixed: 2592021
2020-01-01 20:03:44 -08:00
Srinivas Dasari
ee454da9db qcacld-3.0: Disable NAN in stop_adapter
Framework might not disable NAN discovery explicitly in some
cases like driver unload. So disable NAN from stop_adapter to
terminate NDPs and NAN discovery properly.
Cleanup the API os_if_process_nan_disable_req() by using the
new API ucfg_disable_nan_discovery().

Change-Id: Ic2c834db44c42a44db902c93f67a887de1b6c2fb
CRs-Fixed: 2594318
2020-01-01 18:24:15 -08:00
Srinivas Dasari
baff7dc092 qcacld-3.0: Create an iface for NAN discovery in driver init
Currently, framework issues NAN commands on station interface.
But when connection happens, framework does interface down and
up on the station interface due to MAC randomization. This
terminates all of the NAN operations.
So NAN discovery needs a separate interface to avoid dependency
on the station interface. Create an interface "wifi-aware0"
of type NL80211_IFTYPE_NAN based on the firmware capability
and register to kernel.
Framework issues "IF UP" on the new NAN discovery interface when
it enables NAN. Driver shall create vdev and send VDEV_CREATE
command to firmware for the same. Framework shall issue all
NAN discovery commands on this new interface. Driver shall use
NAN vdev for these NAN operations.
Framework shall do "IF DOWN" once the NAN operations
are done(Ex: up on NAN disable).

Change-Id: Ifd1e1ab5ed64cd97edb00e793214edd2a2365274
CRs-Fixed: 2592020
2020-01-01 18:23:50 -08:00
Srinivas Dasari
4c50119c27 qcacld-3.0: Get the firmware capability NAN_VDEV_SUPPORT
Firmware advertises service capability bit NAN_VDEV_SUPPORT for
separate NAN vdev creation. This capability can be used to create
separate interface for NAN discovery and process corresponding
commands from userspace.

Change-Id: I45573c94ee2d966afc1e207c9eefc146ff43320f
CRs-Fixed: 2592019
2020-01-01 15:42:33 -08:00
bings
00c391fa56 qcacld-3.0: Add g_prefer_5g_scc_to_dbs to give 5g scc higher priority
Add g_prefer_5g_scc_to_dbs to give higher priority for 5g scc than dbs.
It is bitmap per enum policy_mgr_con_mode.
For example in GO+STA(5G) mode, when TPUT is onfigured as wlan system
preference option, If 5G SCC needs higher priority than dbs, set it as
0x8.

This can make GO have higher TPUT given that STA and ref AP mostly have
low speed at this time. This can improve user experience.

Change-Id: Ib8b4bfeef55d97277843df92d3b82aa7f3b9835d
CRs-Fixed: 2587068
2019-12-30 20:47:06 -08:00
Yu Ouyang
e2ed521f0c qcacld-3.0: Fix DSRC compile error
DSRC feature is enabled by SDIO card profile. But when debug SDIO
interface feautre, there are many DSRC module compile issue.

Change-Id: I4429f2a6e68b67140a72ad9634031f459ccda397
CRs-Fixed: 2590115
2019-12-30 04:08:17 -08:00
Liangwei Dong
0527617342 qcacld-3.0: STA+SAP 6Ghz concurrency
When SAP is on 5G and STA connects to 6Ghz AP, the "force
SCC" logic will move SAP to STA home channel if SAP is 6Ghz capable.
If SAP is not 6Ghz capable, SAP will be moved to 2G (DBS) to
avoid MCC(5G+6G) for DBS HW and SAP will stay on 5G for non-DBS HW.
SAP is 6Ghz capable only when all of below statements are true:
a. SAP config includes WPA3 security - SAE,OWE,SuiteB.
b. SAP is configured by ACS range which includes any 6G channel or
   configured by 6G Fixed channel.
c. SAP has no legacy clients (client doesn't support 6G band).
   legacy client (non 6ghz capable): association request frame has no
   6G band global operating Class.

Change-Id: I7e9723fd1b679326a3df61932850589e6e503f3d
CRs-Fixed: 2593569
2019-12-27 11:22:38 -08:00
Vevek Venkatesan
0ac759fc1c qcacld-3.0: cdp: Converge cdp_cmn_ops
Currently cdp ops are given pdev/vdev/peer
handle as its arguments which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.

- txrx_data_tx_cb_set
- txrx_mgmt_tx_cb_set
- txrx_mgmt_send_ext
- txrx_pdev_attach_target
- txrx_pdev_detach
- txrx_vdev_attach
- txrx_vdev_register
- txrx_vdev_detach
- txrx_peer_create
- txrx_peer_delete
- txrx_peer_delete_sync
- txrx_fw_stats_get
- txrx_get_vdev_from_vdev_id
- txrx_pdev_set_ctrl_pdev
- txrx_pdev_attach
- txrx_get_vdev_mac_addr
- txrx_pdev_post_attach
- txrx_pdev_pre_detach
- txrx_get_ctrl_pdev_from_vdev
- txrx_get_mon_vdev_from_pdev

Change-Id: Ib8b0b1edd63e7c3f8813b11ca26b50ec121fe255
CRs-Fixed: 2541459
2019-12-27 03:24:09 -08:00
Liangwei Dong
825d2fc8f3 qcacld-3.0: Acquire sap context before access
Fix potential race condition issue when the sap_context
of adapter is null and it is accessed in work queue -
 __policy_mgr_check_sta_ap_concurrent_ch_intf.
To acquire/release the "sap_context" by get/put API.

Change-Id: I91dacc6d45c377840f7d30f2f9ff902f53ccd8e8
CRs-Fixed: 2592524
2019-12-26 20:42:30 -08:00
sheenam monga
63736f6880 qcacld-3.0: Add ini support to enable/disable ring buffer
Currently, There is no support to disable ring buffer. Each Ring
buffers is using 2MB and overall 10MB is consumed by 5 ring buffers.

Fix is to add ini support to enable/disable ring buffer.
Boolean ini CFG_ENABLE_RING_BUFFER is added. Default value of
gEnableRingBuffer is 1 which indicates that ring buffers are enabled
by default.

CRs-Fixed: 2592476
Change-Id: I30f95668de6df96e5c388e92e202f8c236132dc2
2019-12-26 06:06:53 -08:00
Liangwei Dong
adbb5df9b7 qcacld-3.0: Add g_pcl_band_priority - Set 5G/6G Channel order
g_pcl_band_priority - Set 5G/6G Channel order
This ini is used to set preference between 5G and 6G channels
during population of PCL.
0 - Prefer 5G channels, 5G channels will be placed before
    the 6G channels in PCL.
1 - Prefer 6G channels, 6G channels will be placed before
    the 5G chennels in PCL.

The change will only add 6Ghz channel to PCL for SAP or STA
mode.

Change-Id: I51b3073d6f4fb01af72ccb0a50d10822ac115bca
CRs-Fixed: 2590007
2019-12-24 02:20:34 -08:00
Jianmin Zhu
e75eb51af1 qcacld-3.0: 5G SAP failed to channel switch for sta connecting
When 5G band is disabled by set band,  need SAP switch channel
to 2G. When 5G band is enabled again, need SAP switch back to
original 5G channel. When sta connecting, SAP can't switch
channel.

Merge logic of SAP channel switch for band change and for force
scc with sta, both are implemented in:
policy_mgr_check_concurrent_intf_and_restart_sap now.

After sta associate succeed or fail,
policy_mgr_check_concurrent_intf_and_restart_sap is called again
to check and try SAP CSA for band capability change.

Change-Id: I8574209aac3cabb748a8ec05050244f480e1a0e9
CRs-Fixed: 2589021
2019-12-20 03:51:51 -08:00
Manikandan Mohan
14d2bf80b3 qcacld-3.0: Fix get channel list with existing connections
Reinitialize pcl_weight index in policy_mgr_get_channel_list
for correct connection count.

Change-Id: I96d38f1cb29014517f2c22e360db5d942eb66519
CRs-Fixed: 2589478
2019-12-19 16:54:10 -08:00
Abhinav Kumar
444a5ebc80 qcacld-3.0: Add ini support to skip full scan after bmiss
Currently, after FINAL_BMISS detection, FW does channel map
based partial scan followed by one full scan if no candidate
found in partial scan to ROAM to another available AP without
disconnection. This results in additional delay by HOST in
issuing disconnection after a heartbeat failure.

Add INI support (bmiss_skip_full_scan) to allow FW to decide
whether firmware does channel map based partial scan or partial
scan followed by full scan in case no candidate is found in
partial scan after final BMISS.

Change-Id: I48f9bb43bb7933e9ff173f618586ea5986530dcd
CRs-Fixed: 2578848
2019-12-17 00:12:04 -08:00
Gururaj Pandurangi
1e8f221be0 qcacld-3.0: Change config type of tx_bf_cap to uint
Change max value of tx_bf_cap to 4294967295 from -1
which is misconfigured. 4294967295 corresponds to
0xFFFFFFFF which is max value for 32 bit unsigned
int since this CFG item is getting used as part of
4 byte dot11f HT capability population.

Change-Id: Ifd0fea080dd9eb1f6995af0df20c68e3f73b891a
CRs-Fixed: 2581060
2019-12-16 21:15:23 -08:00
Jingxiang Ge
8fdd274a24 qcacld-3.0: Vdev trans return directly if psoc/driver is in transition
Issue happen when:
thread1:
       rmmod driver, wlan_hdd_pld_remove which will get psoc trans.
       then try to get rntl_lock in hdd_unregister_wext;

thread2:
       trigger iw del interface, cfgops in kernel will get get rtnl_lock,
       in wlan_hdd_del_virtual_intf, vdev trans will be blocked by psoc
       trans in thread1. as thread1 it is also waiting for rtnl_lock, so
       both thread will be stuck.

Fix is:
       In psoc trans, vdev trans and vdev ops is not allowed, which should
       return directly.

Change-Id: I9cbd04bac438bb9483b4e89e73801fe71859e139
CRs-Fixed: 2583675
2019-12-16 14:19:12 -08:00
Pankaj Singh
f84a5dd718 qcacld-3.0: Fix connection latency situation in driver
In 11D scan procedure if WMI_11D_NEW_COUNTRY_EVENTID event is
received, host processes 11d new country code event.
Host driver as a response sends WMI_SCAN_CHAN_LIST_CMDID
new channel list cmd to firmware.

As a result the ongoing scan procedure is aborted by firmware,
and if the scan was a first scan for connection, then it would
lead to connection latency as the supplicant then have to
scan again.

Fix is to check if any scan is in progress, then delay
WMI_SCAN_CHAN_LIST_CMDID channel list command to FW till
the current scan is complete.

Change-Id: I4e747bb747c32430b5d8024823aa0df4928a8c71
CRs-Fixed: 2569741
2019-12-14 04:04:25 -08:00
sheenam monga
451c68c41a qcacld-3.0: Add ini support to configure MGMT retry limit
Currently, default MGMT retry limit is 4 which means 4
transmissions are supported for any management frame.
In noisy environment, Chances to get connection failure
are higher with 4 retransmissions.

Fix is to add INI support mgmt_retry_max to make
CFG_MGMT_RETRY_MAX configurable. Default value for
CFG_MGMT_RETRY_MAX is 15 to reduce the chances of connection
failure in noisy environment.

Change-Id: Id50cb68813fba517a8a1580a3d6662c73b0a381e
CRs-Fixed: 2575385
2019-12-13 11:51:36 +05:30
Srinivas Dasari
4a32ec5220 qcacld-3.0: Allow/Disallow NDP creation in different concurrencies
Currently in case of STA+NDI+NDI concurrency, the below scenario
can occur,
1) If NDI(NDP) + NDI(NDP) exists and sta tries to connect,
   then all NDPs on 1st NDI is tear down.
2) If STA+NDI(NDPs) exist and then another NDI tries to establish
   the NDP, then it is allowed in the current driver.

Fix is to reject the 2nd NDI(NDP) if STA+NDI(NDPs) concurrency
already exist.

Change-Id: Iadf6c9e10b9cdd59ca7beaace578a52b5e5dbb0f
CRs-Fixed: 2568552
2019-12-11 17:44:33 -08:00
Pragaspathi Thilagaraj
5292e0ab83 qcacld-3.0: Handle WMI_ROAM_STATS_EVENTID from firmware
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 roam trigger reason,
values associated with the trigger, roam scan candidate info,
roam status, roam failure reason.

This helps in debugging/understanding the scenario when roam
failure happens.

WMI_ROAM_STATS_EVENTID Format:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
roam_stats_event_fixed_param |-> Contains vdev id and number of
                             |   roams detail.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
roam_trigger data TLV        |-> Has details on the roam trigger
                             |   reason. Number of roam triggers
                             |   TLV detail is present in the
                             |   fixed param. Maximum 5 roam
                             |   per event is supported
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wmi_roam_scan_info TLV       |-> Has details on the roam scan -
                             |   scan type, rssi threshold,
                             |   reason.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wmi_roam_scan_channel_info   |-> Has details on the roam scan
TLV                          |   channels. Number of channels
                             |   per trigger is found on the
                             |   wmi_roam_scan_info TLV.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wmi_roam_ap_info TLV         |-> Has details on Roam candidate
                             |   APs found during scan. Number
                             |   of roam candidate APs per
                             |   trigger is found on the
                             |   on the wmi_roam_scan_info tlv.
                             |   Max 8 candidates are allowed
                             |   per roam scan.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wmi_roam_result TLV          |-> Info on roam success or failure.
                             |   Fail reason, if roaming failed.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wmi_roam_neighbor_report_info|->After roaming, firmware sends
TLV                          |  neighbor/btm report to roamed AP
                             |  to get list of roam candidates.
                             |  This tlv provides info on this.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wmi_roam_neighbor_channel_info|-> This has the info on the
                              |   channel list received as part
                              |   of BTM/Neighbor report.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Print the info received as part of this event into kmsg.
Featurize all the function defines for this roam logging under
WLAN_FEATURE_ROAM_OFFLOAD flag.

Change-Id: Iddc70b572f2e3dc47f08fd1c3c3597cb44981a17
CRs-Fixed: 2576222
2019-12-11 08:52:14 -08:00
Jia Ding
db2e940123 qcacld-3.0: Initialize IPA metering feature and perf level
In IPA uC ready handler, metering feature and perf level are not
initialized. Therefore properly initialize them after IPA pipes
are connected.

Change-Id: I99621bb2c2831d66e11b0ca903ecb324ef898836
CRs-Fixed: 2582409
2019-12-11 05:01:34 -08:00
gaurank kathpalia
0cecbd4d4e qcacld-3.0: Change the default value of normalize acs ini weight
Change the default value of normalize weight ini to
disable all non-PSC 6ghz channels for the SAP ACS
operation, and give weightage only to the PSC
frequencies.

Change-Id: I4c8f349a396ffe4a2f378a59f5a67036b9d573eb
CRs-Fixed: 2578824
2019-12-09 18:56:58 -08:00
Manikandan Mohan
a8a0a0d00e qcacld-3.0: Decouple NDI policy mgr update from active peer count
In multiple NDP peer case NDP indication might come for these
peers before first NDI confirm is sent for first peer. This
results in not updating policy manager session for NDI and
not creating datapath TX pool. Fix this issue by using one
time init flag for NDI instead of relying on peer count.

Change-Id: I812ff9be46580f3fb2da03ae7e1c1a36d205c38f
CRs-fixed: 2573935
2019-12-09 13:55:55 -08:00
Jianmin Zhu
327317eea2 qcacld-3.0: Allow STA+SAP SCC on LTE-coex channel
If STA is on LTE-coex channel,  start SAP on same band, to force
scc, it need select the LTE-coex channel too, or SAP failed to
start.

CRs-Fixed: 2580240
Change-Id: Ib05524711cb2475c3ca5ec7cf61a2b29c05658b6
2019-12-09 13:55:41 -08:00
Jianmin Zhu
61d502d966 qcacld-3.0: SAP CSA from 5G to 2G for modem N79
For SAP/P2P GO on 5G, when receive cmd to disable 5G band when
modem n79 band used, will move to 2G band via CSA.
1. If no active connection on 2G, select ch by safe list, or
channel 6.
2. If there is STA on 2G, force scc with it.
3. If there is SAP/GO on 2G, force scc with it.
4. Handle one race condition that if candidate is already
selected & FW has gone ahead with roaming or about to go ahead
when set_band comes, it will be complicated for FW to stop the
current roaming. Instead, host will check roam sync to make sure
the new AP is on 2G, or disconnect the AP.
5. If 2 SAP on 5G, move both to 2G and keep scc.

When Set band to enable 5G band again, restored all 5G SAP/Go..

Change-Id: I9b2b1ead3b4502022aeefc08359037457bb051f9
CRs-Fixed: 2580204
2019-12-09 13:54:16 -08:00
Arun Kumar Khandavalli
efe77ff948 qcacld-3.0: Don't use vdev_mlme object in the vdev delete response
As part of the new changes, vdev mlme object will be freed before
the vdev delete response is received from the firmware. Hence do
not use the vdev_mlme object in the vdev delete response handler.

Change-Id: Idec5775f6c7ac767baedd173a7bde0d3a358d0fe
CRs-Fixed: 2563381
2019-12-05 23:53:40 -08:00
Abhishek Singh
fe26a582f9 qcacld-3.0: Handle the error action frames in mgmt tx
For Action frame which are not handled, the resp is sent back to the
source without change, except that MSB of the Category set to 1.
so driver may get action frame with WEP BIT set and category with
MSB set.

Due to the error category, driver is not able to determine if its
a RMF frame and thus doesn't add the MIC header and data length to
the frame.

Now with WEP bit set and MIC header and MIC data length not
added to the frame, the firmware assert due to invalid frame length.

Thus reset the WEP bit in the frames sent by mgmt tx path and add
WEP only if keys are set and frame is RMF. Also ignore MSB to get
the actual action category of the action frame.

Change-Id: I2a2918dbb15979e4184dbf8489e5c3ade15d0e6f
CRs-Fixed: 2580233
2019-12-05 16:39:36 -08:00
Bala Venkatesh
81281077ab qcacld-3.0: Remove the INI force_rsne_override
Currently, RSNE if given from userspace is overrided if the Ini
force_rsne_override is disabled as a security. But there
are sufficient checks already in kernel to validatethe RSNE
given by userspace. Hence this INI is no longer required.

Change-Id: Ifcc9298dcfa035d05e9ee4fb78a4fa2c9f249461
CRs-Fixed: 2573540
2019-12-05 16:38:44 -08:00
Kiran Kumar Lokere
571f0d3e65 qcacld-3.0: Add 80+80 restricted BW support
Add support for restricted 80+80 bandwidth in STA and SAP modes.

Change-Id: Id1a61b853584fa84db3bb8f0f2aaf68eecabeaac
CRs-Fixed: 2570023
2019-12-04 14:40:31 -08:00
Amruta Kulkarni
59f6350e8b qcacld-3.0: Enhance logic for dwell time 2g
With this change,in concurrent mode
(SAP on 5g and peer connected + STA Scan ongoing),
active dwell time 2g is not reset to 0.

Change-Id: I20ace5561137a0dd8def497e3bbbbcbeede80ea5
CRs-Fixed: 2572918
2019-12-04 00:09:47 -08:00
Vevek Venkatesan
959ac03d07 qcacld-3.0: setup IPA sys pipes if wlan_ipa_wdi_init succeeds
At present, IPA sys pipes setup done before wlan_ipa_wdi_init,
so chances for IPA uC is not yet up and running. As wdi init
succeeds only if uC is up and running, setting up IPA sys pipes
after wlan_ipa_wdi_init succeeds.

Change-Id: I7dcae49db0b0a2114908284379096f39e6f16a50
CRs-Fixed: 2573929
2019-12-03 20:56:15 -08:00
Sourav Mohapatra
fab026a99a qcacld-3.0: Send RTT capability for STA mode
Based on the ini gfine_time_meas_cap, send enable/disable value to the
firmware for STA INITIATOR/RESPONDER mode using VDEV set param.

Change-Id: Idd4142e13061cd1af992bda88d0a0b81edc42fef
CRs-Fixed: 2574050
2019-12-03 13:10:29 -08:00
Jia Ding
8d4db30812 qcacld-3.0: Add dual STA support in WLAN IPA component
Currently dual STA is not supported in WLAN IPA component,
where first STA interface info will be overridden by second
STA including iface_ctx and interface registration to IPA
driver.

When second STA is switched to SAP and a ref-client is
connected to SAP, IPA datapath will be enabled for Wifi
sharing feature. But wlan0 interface is not registered
to IPA driver and this will lead to packet drops for
STA on the RX IPA exception path. IPA driver relies
on information such as vdev_id wlan driver registered
to correctly set skb->cb[0] and wlan driver uses
skb->cb[0] to find the correct vdev to pass packets up
to stack. Since STA interface info is not in IPA,
vdev_id for RX exception packets are thus wrong.

Fix is to store multiple STA interfaces in iface_ctx
and all of them are registered to IPA driver.

Change-Id: I745618c22e24b6c56719f8ae5faf653f55b99bca
CRs-Fixed: 2573567
2019-12-02 02:08:35 -08:00
Srinivas Dasari
b24bdd3f73 qcacld-3.0: Consider NAN enabling also as connection in progress
There is a race condition while handling the below scenario,
1. NAN enable request is received from framework.
2. Policy mgr opportunistic timer expired and set hw mode
   initiated to Single MAC mode in scheduler thread at
   the same time

As the opportunistic timer handler doesn't have any info if
NAN enable initiated in DBS mode, it's configuring the hw
mode to Single Mac Mode just before NAN enable request is sent
to firmware. So the NAN enable request is sent to firmware in
Single Mac Mode which is not allowed by firmware.

NAN enable/disable is also similar to connection in progress
status in case of STA. So provide NAN enable/disable status
through hdd_is_connection_in_progress() to the opportunistic
timer handler. Opportunistic timer handler restarts the timer as
connection(NAN enable/disable) is in progress.

Also set hw_mode_change_in_progress before checking the
connection progress status. This is to avoid a possible race in
the below scenario,
1. NAN-enable sets the state but scheduler thread had read the
   state just before that
2. NAN-enable read the hw_mode_change_in_progress just
   before it gets set by scheduler thread.

Change-Id: I1a184c84520deb3f6ad1ec010a0fdefda96a5364
CRs-Fixed: 2566841
2019-12-01 17:39:45 -08:00
Liangwei Dong
b5e89852ab qcacld-3.0: Fix Memory leak sta_ap_intf_check_work_info
At present policy_mgr_check_concurrent_intf_and_restart_sap
will allocate memory for sta_ap_intf_check_work_info for each
work scheduling of sta_ap_intf_check_work. Potential race condition
would be the pm_ctx->sta_ap_intf_check_work_info is overwritten
in other thread context which is calling same function.
It is not necessary to maintain the memory
sta_ap_intf_check_work_info dynamically since only one work
sta_ap_intf_check_work is expected to run at same time.

Move the sta_ap_intf_check_work_info memory allocation to
psoc open handler and free it when psoc close.

Change-Id: I29b2f2528a6d537cb853968153340a75fd5fe88b
CRs-Fixed: 2571624
2019-11-27 04:16:41 -08:00
Liangwei Dong
d4a91a6f12 qcacld-3.0: Refine wma_get_caps_for_phyidx_hwmode
The current function doesn't handle "hw_mode" parameter.
And if band is specified the function needs to find the
correct "phy cap" in mac_phy_cap list.
The "supported_bands" can be a bit mask of
(WLAN_2G_CAPABILITY | WLAN_5G_CAPABILITY), use "&" to find
the phy cap of requested band.
Remove unused API wma_get_phyid_for_given_band.

Change-Id: I4b120d681b820e2a6e2b82f33d67fbcf6136af09
CRs-Fixed: 2571400
2019-11-26 22:00:17 -08:00
gaurank kathpalia
44f1abad87 qcacld-3.0: Block 3 port concurrency for MCC
Currently the 3 port concurrency combinations
which are not PORed should not be allowed to
connect or beacon as it could lead to functional
issues.

Fix is to bloack the 3 port concurrency which are
not PORed.

Change-Id: I792d0484da96fc0ae994fafa2c6b3ac787016815
CRs-Fixed: 2567322
2019-11-22 08:32:25 -08:00
Abhishek Singh
345be418c9 qcacld-3.0: Replace sme_session_id with vdev_id
Replace sme_session_id with vdev_id in SME and LIM.

Change-Id: I7a4a85c440d8d7d7a2a4163bc71776e288da0222
CRs-Fixed: 2569190
2019-11-22 07:12:45 -08:00
Sourav Mohapatra
60c3b2b014 qcacld-3.0: Add checks to NS and ARP offload requests
Currently the offloading of the NS and ARP to firmware is inefficient;
redundant caching is performed even if offload is not sent. This causes
wastage of resources and increases code complexity.

Introduce checks before caching and offload to ensure that the mentioned
inefficiencies are taken care of.

Change-Id: I6013810e1e08adb15c801f4fc21e1b50371bacda
CRs-Fixed: 2569763
2019-11-22 05:35:35 -08:00
Abhinav Kumar
13ebd82e91 qcacld-3.0: Make Stick time value to zero by default
Roaming to new AP is depends on the periodic scan which occurs every
10sec in fw. Due to the default value of sticky time (btm_sticky_time)
to BTM AP is 5 min, periodic roaming scan gets disabled in fw till
sticky timer expiry. So FW won’t trigger a periodic scan for 5 min,
in case of roaming to new AP by BTM.

In case if STA roams to new AP by BTM and Disassociation Timer
expires before Stick time, DUT is not able to roam to a candidate
AP till Stick time expiry.

In order to allow roaming just after disassociation timer expiry,
Make Stick time value to zero by default.

Change-Id: I0de09ec7134d543a9c934a03941bcdb57b983dc9
CRs-Fixed: 2566842
2019-11-22 02:22:31 -08:00
Pragaspathi Thilagaraj
c7229ac591 qcacld-3.0: Fix length of EDCA config strings
Currently the driver uses STR_EDCA_ANI_ACBK_LOCAL as the length
for all the EDCA_LOCAL string cfg items.

Use the corresponding string length for EDCA_LOCAL string.

Change-Id: Ia6fd19b90c3d6c2c6e7a12e9f44389db2bf160f8
CRs-Fixed: 2569514
2019-11-22 02:22:17 -08:00
Sourav Mohapatra
2a03074fae qcacld-3.0: Rectify max values for TSF pin inis
The max values of the ini's CFG_SET_TSF_GPIO_PIN and
CFG_SET_TSF_IRQ_HOST_GPIO_PIN are set wrong. The default value for those
is higher than the max value.

Increase the max value to accommodate the correct range.

Change-Id: I7d5528801c3b0fc2480e00b28ab4eb8f0385930a
CRs-Fixed: 2570044
2019-11-22 02:22:03 -08:00
Arun Kumar Khandavalli
4f6a5bd519 qcacld-3.0: Send vdev create to fw from object create notification
Send vdev create to firmware when the mlme vdev create handler
is invoked as part of the vdev object create.

Change-Id: Ibba02f6b5885d7b3a62529ef51768f520395513e
CRs-Fixed: 2555943
2019-11-21 09:13:20 -08:00
Vevek Venkatesan
29076ec1d8 qcacld-3.0: cdp: Converge cdp_ipa_ops
Currently cdp ops are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev_id or vdev_id or peer mac address,
which will be used to get the respective handles,
and hence avoiding the unwanted access of the
handles if it has been deleted.

- ipa_get_resource
- ipa_set_doorbell_paddr
- ipa_set_active
- ipa_register_op_cb
- ipa_get_stat
- ipa_tx_data_frame
- ipa_uc_get_share_stats
- ipa_uc_set_quota
- ipa_enable_autonomy
- ipa_disable_autonomy
- ipa_setup
- ipa_enable_pipes
- ipa_disable_pipes
- ipa_rx_intrabss_fwd

Change-Id: I678d7a7de7132417ff6051b0fd6da5d14426d21e
CRs-Fixed: 2540861
2019-11-21 06:12:04 -08:00
Rakesh Pillai
6a36b0a26a qcacld-3.0: cdp: Convergence of cdp misc ops
Currently the cdp apis are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev/vdev id or peer mac address, which will be
used to get the respective handles, and hence
avoiding the unwanted access of the handles if
it has been deleted.

Converged misc_ops
- tx_non_std
- get_opmode
- get_tx_ack_stats
- set_ibss_vdev_heart_beat_timer
- hl_tdls_flag_reset
- set_wisa_mode
- txrx_post_data_stall_event
- update_mac_id
- pkt_log_init
- pkt_log_con_service
- get_num_rx_contexts
- set_wmm_param
- flush_rx_frames
- bad_peer_txctl_set_setting
- bad_peer_txctl_update_threshold
- txrx_data_stall_cb_register
- txrx_data_stall_cb_deregister
- vdev_set_driver_del_ack_enable
- get_intra_bss_fwd_pkts_count
- mark_first_wakeup_packet
- register_pktdump_cb
- unregister_pktdump_cb
- pdev_reset_driver_del_ack
- runtime_suspend
- runtime_resume

CRs-Fixed: 2539735
Change-Id: I2baad09fde29d439ae2099e01e4e68ed6b94196d
2019-11-21 06:11:43 -08:00
Liangwei Dong
897b439b3c qcacld-3.0: Add policy_mgr_is_hw_dbs_required_for_band API
policy_mgr_is_hw_dbs_required_for_band is for any HW where
PHYA/MAC0 doesn't support the given band. We need to switch
to DBS mode to support the band. So far we have
overloaded policy_mgr_is_hw_dbs_2x2_capable to achieve above.
Need a cleaner API to work in a generic way
(for 2x2, 1x1 or any chain mask configuration).

Change-Id: I1cb28bece1242fc749a0a6a56fadca0502850c43
CRs-Fixed: 2565939
2019-11-21 00:44:19 -08:00
Wu Gao
480a304199 qcacld-3.0: Cleanup tx context if cancel mgmt tx
It doesn't cleanup tx context immediately, which cause mgmt will be
tx again unexpectly. Then P2P state mismached and form connection
failed.

Change-Id: I9eba9df057221e5dabf5ff42fe0d2fd695aea9df
CRs-Fixed: 2564622
2019-11-19 01:45:36 -08:00
Tiger Yu
564aa84417 qcacld-3.0: Update the IPA interface context if device_mode is different
For wlan_ipa_setup_iface, if found the net_dev is already there,  but the
device_mode is different, will remove this obsolete record and update it
with new interface context for current IPA WLAN event.

Change-Id: Ib9ecd7f7b3b9603c37dc1d69cd0f3a2868c978ec
CRs-Fixed: 2567222
2019-11-18 04:04:56 -08:00
Abhishek Ambure
ee81f8b2eb qcacld-3.0: Set 5G band capability bit in gActionOUIConnect1x1 ini
gActionOUIConnect1x1 is used to specify action OUIs for 1x1
connection.

Some Access Points are unable to handle SMPS and OMN frames and shows
abnormal behaviour when STA is switching between 2x2 to 1x1 and
vice-versa. To avoid this, restrict connection in 1x1 mode with such APs.

Here the scenario is DUT STA1 connects in 2x2 mode to AP1 in 5G mode then
later on DUT another STA2 iface connects to AP2 in 2G mode. DUT sends OMN
frame to AP1 to inform that it is going to switch to 1x1 mode. AP1 ack
this frame but doesn't change its Tx rates and continues to use 2x2 rates
which DUT cannot ACK. This causes low throughput issue where AP1 Tx rate
falls to 6Mbps due to missing acks.

Hence, 5G band capability bit in "gActionOUIConnect1x1" is set to make
connections in 1x1 with such AP.

Presently, 5G band capability bit is not checked if 2G band capability bit
is not set or 2G band is not enabled. Hence, Vendor AP capability check for
2G and 5G Band is refactored.

Change-Id: Ic6b682451405a2373000e4c64656f50c2fab0ee6
CRs-Fixed: 2558293
2019-11-18 02:29:15 -08:00
Wu Gao
6b778803fc qcacld-3.0: PCL update for case about SAP and NAN
Updated PCL table to support 3-port concurrency AP+NAN_DISC+NDI/NDP
and 4-port concurrency scenarios AP+AP+NAN_DISC+NDI/NDP.

Change-Id: Ic8ba4d12651d42b6c07cf86125a17071a57683d2
CRs-Fixed: 2508242
2019-11-15 16:01:07 -08:00
Kiran Kumar Lokere
5414066815 qcacld-3.0: Policy manager support in 160MHz mode
Add policy manager support for 160MHz mode connection.

Change-Id: I697dabbd752e768c128f8663674c91adccd72424
CRs-Fixed: 2558047
2019-11-15 05:43:43 -08:00
gaurank kathpalia
34fe0b641b qcacld-3.0: Enable the DBS ini if DBS is mandatory
The driver does not check the device DBS capability
and the DBS ini compatibility( ch select policy)
If the DBS ini channel_select_logic_conc is disabled
and HW mandates DBS capability then overide the ini
to always keep it enable.

Change-Id: I629fd8661f70b64808a55c4c9bdafa9608787b09
CRs-Fixed: 2551648
2019-11-15 03:57:32 -08:00
gaurank kathpalia
e314029ccf qcacld-3.0: Enable the DBS ini if DBS is mandatory
The driver does not check the device DBS capability
and the DBS ini compatibility.
If the DBS ini gDualMacFeatureDisable is disabled
and HW mandates DBS capability then overide the ini
to always keep it enable.

Change-Id: I2b31453f9c8a04cef7f943b30d3c28f844c276b5
CRs-Fixed: 2551644
2019-11-15 03:57:22 -08:00
Rachit Kankane
8bb26e3ea5 qcacld-3.0: Increase max limit -gEnableDynamicDTIM
Increase max limit to value 10 for INI gEnableDynamicDTIM.

Change-Id: I91cbe24bd37818a65c9678c89c482a059ff1e37e
CRs-Fixed: 2536749
2019-11-13 06:53:05 -08:00
Tushnim Bhattacharyya
76a8e2ae63 qcacld-3.0: Set default value of 2 for g_sta_sap_scc_on_dfs_chan
The value 2 is to enable STA+SAP force SCC on DFS channel if STA
is already on DFS channel & also to allow SAP to come up on DFS
channel stand alone & perform CAC (DFS master mode). Set default
value of 2 for g_sta_sap_scc_on_dfs_chan.

Change-Id: Ic1873e1a5b79086aa3e41d3eecea2049b7fc3adf
CRs-Fixed: 2560614
2019-11-12 02:35:21 -08:00
Rakesh Pillai
f94b162ed0 qcacld-3.0: cdp: Convergence of cdp_l_flowctl_ops
Currently the cdp apis are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev/vdev id or peer mac address, which will be
used to get the respective handles, and hence
avoiding the unwanted access of the handles if
it has been deleted.

Converged l_flowctl_ops
- register_tx_flow_control
- set_vdev_tx_desc_limit
- set_vdev_os_queue_status
- deregister_tx_flow_control_cb
- flow_control_cb
- get_tx_resource
- ll_set_tx_pause_q_depth
- vdev_flush
- vdev_pause
- vdev_unpause

CRs-Fixed: 2539748
Change-Id: I8ad4a20914c654b8e8aaf629dda7f673fdb110e4
2019-11-11 23:08:02 -08:00
Rakesh Pillai
84714471df qcacld-3.0: cdp: Convergence of cdp_ocb_ops
Currently the cdp apis are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev/vdev id or peer mac address, which will be
used to get the respective handles, and hence
avoiding the unwanted access of the handles if
it has been deleted.

Converged ocb_ops
- set_ocb_chan_info
- get_ocb_chan_info

CRs-Fixed: 2539745
Change-Id: I7de53c48ec6b7f0c09be7c9cf642d8cf4f8eae78
2019-11-11 23:07:52 -08:00
Rakesh Pillai
a889ffa967 qcacld-3.0: cdp: Convergence of cdp_flowctl_ops
Currently the cdp apis are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev/vdev id or peer mac address, which will be
used to get the respective handles, and hence
avoiding the unwanted access of the handles if
it has been deleted.

Converged flowctl_ops
- flow_pool_map_handler
- flow_pool_unmap_handler
- dump_flow_pool_info
- tx_desc_thresh_reached

CRs-Fixed: 2539738
Change-Id: I9b11e66d8c2644f16e0f2464c323798a4cba007a
2019-11-11 23:07:35 -08:00
Bala Venkatesh
ff86f89448 qcacld-3.0: Add the ini gTDLSDiscoveryWakeTimeout
Add the support for the ini gTDLSDiscoveryWakeTimeout.
with this ini gTDLSDiscoveryWakeTimeout, FW will be awake
for configured value after sending the discovery request.

Change-Id: I194e5c99972968bbaa46ffb6b8e83604bff15a0a
CRs-Fixed: 2546515
2019-11-11 02:05:27 -08:00
Mohit Khanna
5b42d1b969 qcacld-3.0: Wait for IPA TX Completions on IPA disablement
In DBS scenario(SAP + STA) when all SPA clients disconnect, while STA is
still connected, IPA pipes are disabled on the lithium target. At this
time, its possible that some packets TX from IPA over WLAN are still
pending. If these completions come after IPA pipes are disabled, it can
lead to a NOC error, since the GSI doorbell register for WBM2SW2 ring
may be clock gated (after IPA pipes are disabled).

To avoid this situation, wait for some time before disabling IPA pipes.
IPA pipes are disabled after a timeout, when system suspend call tries
to suspend the bus. A driver unload or a softap tear-down will also
disable the pipes.

Change-Id: I542049fa19d0dcf5c31d9b8a2d836388847dd6c1
CRs-Fixed: 2553670
2019-11-08 15:54:58 -08:00
Arun Kumar Khandavalli
27f443e880 qcacld-3.0: Drive the self peer creation from the sme layer
Presently as part of the vdev creation the self peer for the vdev
is created in the object manager and in the firmware. The self
peer creation in the object manager needs the vdev to be in the
created state. As part of new changes to send the vdev create to
firmware as part of the vdev creation notification there will be
failure in creating in the self peer.

Hence, drive the self peer creation from the SME layer which will
create the vdev.

Change-Id: I0875f4ec5bd96438c0f21056e1d6920d3be2a177
CRs-Fixed: 2555868
2019-11-08 06:54:39 -08:00
Alan Chen
d77099006c qcacld-3.0: Remove arp_ac_category INI item
The mechanism of overriding ARP frames with AC will not work since
firmware always defaults to BE. Since this overriding is not going to
be supported, remove the arp_ac_category INI and all areas that use it.

Change-Id: I8bff251ded5842f3d0c95bb916eb98a051696ae0
CRs-Fixed: 2555459
2019-11-07 09:20:25 -08:00
nakul kachhwaha
e3e92ae6db qcacld-3.0: Fix data stall during TDLS Offchan Operation
In non concurrency scenario with TDLS Offchan link, FW is sending
two pauses namely PAUSE_TYPE_CHOP and PAUSE_TYPE_CHOP_TDLS_OFFCHAN
back to back when DUT dwells between TDLS Off channel and AP channel
respectively. HOST handles these events as vdev based event instead
of peer based event and remove all the tx queues from scheduler for
all the peer irrespective of the pause type. This will lead to data
stall in TDLS offchan scenarios, as at any point of time, host will
be receiving one of the two pauses and keep its peer queues out of
scheduler.

Changes are done to decouple the handling of pause/unpause events
for TDLS peers with Offchan enabled from vdev based pause/unpause.
TDLS peers will be paused/unpaused based on PAUSE_TYPE_CHOP_TDLS_OFFCHAN
pause type. Other pause/unpause events will be handled as usual.

Change-Id: Iccb46fd6d121d5df6d53633c9978ddc8e02f588f
CRs-Fixed: 2558612
2019-11-06 23:50:23 -08:00
bings
a4e27271d9 qcacld-3.0: Disable dfs phyerr offload when no sap/go in DFS channel
As FW required, send WMI_PDEV_DFS_PHYERR_OFFLOAD_DISABLE_CMDID when there
is no beaconing session in DFS channel for FW which supports dfs offload.

Change-Id: Ib3c24758b81d6218d2504729d44cdbfb122933ee
CRs-Fixed: 2544846
2019-11-06 14:05:48 -08:00
Bala Venkatesh
7ce8fb0556 qcacld-3.0: Do not reset the tdls link status to tearing
If the force peer is removed from wpa_cli, then without
checking the current link status link status is set to tearing.
Then if the same peer is again marked as forced then that peer
status is not reset to idle and that can lead to tdls connection
denial of that peer.

Reset the tdls link status to tearing only in connected state.

Change-Id: Idd4128b4599fc2dfbb768984f8f9390fc14ab5f6
CRs-Fixed: 2551180
2019-11-06 14:05:41 -08:00
Jianmin Zhu
67c56bfdbf qcacld-3.0: Enable STA+STA MCC
For helium/Hastings, two port STA+STA MCC is PORed
anyway, DBS is preferred for latency usecases.

Change-Id: I71b52974470a562372b5b1981fec1cde1ebdfcf8
CRs-Fixed: 2557583
2019-11-06 06:30:53 -08:00
Jayachandran Sreekumaran
952d6a2072 qcacld-3.0: Provide same vdev id for nss and hw mode update
While operating in SCC mode for AP+STA, STA receives CSA
and switches to a channel in the other band.
After channel switch trigger the NSS update for AP mode.
HW mode switch to DBS1/DBS2 gets triggered after nss update
completion.

POLICY_MGR_UPDATE_REASON_CHANNEL_SWITCH is set as the
reason for hw mode update. For NSS update AP vdev id
is used but for HW mode switch STA vdev id is getting used.

This leads to assert in vdev SM while handling the event
WLAN_VDEV_SM_EV_CSA_RESTART in vdev up state.

For NSS mode update followed by HW mode switch cases,
Policy manager need to use the same vdev id for both operations.

Change-Id: I986fa971c0c525ecada4805c70dd629ef8a1cac7
CRs-fixed: 2547119
2019-11-06 03:33:11 -08:00
Sourav Mohapatra
ffcaf378c7 qcacld-3.0: Avoid deadlock during suspend and resume
Presently in the driver, we get the MSI interrupt to wake up from
suspend which directs the call to the both kernel and driver. In the
driver, the HIF callback target_initial_wakeup_cb registered, gets
called in interrupt context while that through the kernel get scheduled
in thread context. These two call can potentially get into a deadlock.

The scenario can be described as:
	- MSI interrupt raised
	- callback invoked from kernel -> takes spinlock on psoc->lock
	- hif callback in interrupt context -> spins on the same psoc->lock
	- deadlock

The problem arises due to the fact that both the kernel thread and the
interrupt handler are executing on the same CPU. This causes the
spinlock in the interrupt context to spin forever.

The solution to mitigate this scenario is to not take the reference
inside the hif callback pmo_core_psoc_handle_initial_wake_up. This
reference was put in place to prevent the wake up callback from getting
affected by psoc creation and deletion. But there seems no need for this
as creation and deletion of psoc happens outside the time-scope of the
wake up callback.

Change-Id: I566ab08802ba3f38e154d26599c73d718ec74bfb
CRs-Fixed: 2556497
2019-11-05 09:27:06 -08:00
Abhishek Singh
9fee518fe3 qcacld-3.0: Avoid calling wlan_hdd_set_mon_chan for STA mode
As part of Ie9ffc701d93ed1c050375dd56151b7a0da69cdce the STA mode
channel change was added in disconnected state for spectral scan
test at CV2X platform.

Now with iwpriv wlan0 setMonChan on STA mode, a monitor mode
pe_session is created in PE/LIM which take ref count with
WLAN_LEGACY_MAC_ID. As the interface is STA type this session
is not deleted when vdev is deleted. This lead to vdev ref leak.

This code is broken and is no longer in use and cause vdev
ref leak when executed. Thus revert
Ie9ffc701d93ed1c050375dd56151b7a0da69cdce.

Also move the lim session create to hdd_set_mon_rx_cb during
vdev create, as it is deleted during vdev delete.

Change-Id: Ib60aa2bd2746a8cd17f20efa7506c18784a42630
CRs-Fixed: 2557160
2019-11-02 12:25:34 -07:00
Amruta Kulkarni
5b738c23a3 qcacld-3.0: Remove wma_txrx_node params(tx_power,max_tx_power)
Target_if cleanup done for tx_power,max_tx_power params
 Use vdev_mlme_mgmt_generic params(tx_power,maxregpower) instead

Change-Id: I3dc30bbce0026dc88f83009671851a70c1495b30
CRs-Fixed: 2555402
2019-10-31 22:30:18 -07:00
Tushnim Bhattacharyya
acb23ee6f0 qcacld-3.0: Replace channel with frequency in unsafe_ch_list
Replace channel ID with frequency in struct unsafe_ch_list.

Change-Id: I4db260127b39d8a30d61d4348f70b1a77ddb9d95
CRs-Fixed: 2540581
2019-10-28 18:02:42 -07:00
Liangwei Dong
8c65f23490 qcacld-3.0: Downgrade channel bandwidth for DBS2
In DBS mode 2x2 VHT40 2G and 1x1 VHT 40 5G, the MAC 1 (5G)
doesn't support VHT80. Update the ch_width to max of 40Mhz
in beacon OMN ie when switch to DBS2.

Change-Id: If5cf65bca815d1e8df67a1515b2fb3edcba52a8e
CRs-Fixed: 2520719
2019-10-28 08:38:35 -07:00
Liangwei Dong
c213d8e885 qcacld-3.0: Fix memory corruption of GET_PREFERRED_FREQ_LIST
1. Change pcl_list to uint32_t array.
2. Populate weight freq from pcl_list.
3. Correct the skb allocation size to include attr hdr

Change-Id: Iace73efda1ec55b7f12c2ce3bcc1ea3262ad01f8
CRs-Fixed: 2554031
2019-10-28 07:11:31 -07:00
Sravan Kumar Kairam
761ae63623 qcacld-3.0: Support wlan ipa clk voting for kona
Support wlan ipa clk voting for kona. Host should provide
bandiwdth levels to IPA driver for which IPA uc monitors
the levels. Once the threshold is reached IPA uc interrupts
the IPA driver and IPA driver informs host driver via callback
registered.

Change-Id: I9fd805d69858a413f20b9e55a9c02a82054c646b
CRs-Fixed: 2526300
2019-10-27 13:47:42 -07:00
Arun Kumar Khandavalli
a43590e897 qcacld-3.0: Move psoc object to common component
Move to the common psoc object and retrieve the cfg ini
information from the legacy implementation.

Change-Id: I38147c748796550f2adede44b681559a4f329fbf
CRs-Fixed: 2547536
2019-10-26 11:55:08 -07:00
Manikandan Mohan
dbcd073e6d qcacld-3.0: Update NAN component to use frequency values
Due to channel number ambiguity with introduction of 6GHZ support
update NAN component APIs and data structures to use frequency
values instead of channel number.

Change-Id: I982fe8da0320c878f9473a62c86b80b220e2892e
CRs-fixed: 2551927
2019-10-24 21:41:47 -07:00
Rachit Kankane
914b79a337 qcacld-3.0: SAP in CAC, block concurrency
At the time of starting / stopping 2nd or 3rd connection,
Host sends WMI_PDEV_SET_HW_CMDID command to FW to change
HW mode to DBS / Single-Mac based on concurrency rule.
FW upon receiving this command turns off TXRX chainmask
which means that radar pulses might get missed for
20ms - 50ms during CAC period. To fix this, Host should
block new connection when existing SAP is performing CAC
on DFS channel.

Change-Id: I51eb117afa763a6ef54211808875419026c9075b
CRs-Fixed: 2533717
2019-10-24 17:24:24 -07:00
Rajeev Kumar Sirasanagandla
cbc6c3b8d1 qcacld-3.0: Process NAN enable/disable synchronously
In the current implementation, NAN enable and disable request are
processed asynchronously, because of which some race conditions
are seen.
	Example: If NDI is having multiple NDPs and without terminating
	NDPs if NAN disable and NDI delete are issued back to back then,
	NDP_END sequence is not initiated and causing deviation from
	NAN spec. Root-cause is firmware deleting NDP peer as a part of
	NDI delete before initiating NDP end sequence.

To fix this, process NAN enable and disable requests synchronously.

Change-Id: I467419370187b0dc8d879e1806347c9f21ebb23a
CRs-Fixed: 2528599
2019-10-24 16:03:42 -07:00
Bala Venkatesh
ce98442c2a qcacld-3.0: Fill the pmf info for TDLS peer
Fill the pfm info of the TDLS peer before sending the peer assoc
command to FW.

Change-Id: I4e336c345c0fb8f063157b3e3a780efa777f1a74
CRs-Fixed: 2535832
2019-10-24 14:33:37 -07:00
gaurank kathpalia
389b9e7875 qcacld-3.0: Disable 3 port in DBS 1x1 and No-DBS PCL tables
Disable 3 port in DBS 1x1 and No-DBS PCL tables
as DBS 1x1+1x1 or NON DBS solutions does not
support 3 port as of now.

Change-Id: I16d9d0b6f09ad599e94c776821e68f1e0fcc362e
CRs-Fixed: 2551510
2019-10-24 09:13:11 -07:00
Jia Ding
49780623e4 qcacld-3.0: Properly handle IPA uC ready notification
When doing IPA initialization, WLAN driver registers a
notification callback for IPA uC ready. In the callback,
we directly set uc_loaded to true before scheduling a work
task to connect WLAN IPA pipes. However issue is that in
the work handler, uc_loaded is checked and if it is true,
we return without connecting WLAN IPA pipes.

Therefore properly set uc_loaded to true so that WLAN IPA
pipes can be connected correctly.

Change-Id: I27a14e627a1a75836f08dc5dec8c8b1d09725e10
CRs-Fixed: 2537625
2019-10-23 18:41:10 -07:00
Arun Kumar Khandavalli
bcd5634dae qcacld-3.0: Send the vdev create to firmware in the caller thread
Presently upon interface up a message is posted to the scheduler
to create the vdev, which sends the vdev create to the firmware,
for the vdev create there is no response from the firmware host
internally posts a fake message internally for the vdev create
response.

Dont post the vdev create to the scheduler thread but directly
send the vdev create to the firmware in the caller context.

Change-Id: Iafb186b13d948e421d152c3142cb8614fdbbffa6
CRs-Fixed: 2549530
2019-10-23 03:46:29 -07:00
Manikandan Mohan
19f3609b21 qcacld-3.0: Use policy manager frequency APIs
For 6GHz support and to remove channel number ambiguity use policy
manager APIs updated for frequency in other modules. This change
covers following APIs:
policy_mgr_get_pcl
policy_mgr_update_with_safe_channel_list
policy_mgr_get_valid_chans_from_range
policy_mgr_get_valid_chans
policy_mgr_set_sap_mandatory_channels
policy_mgr_get_pcl_for_existing_conn
policy_mgr_get_mode_specific_conn_info

Change-Id: Ia21829345be2746cd3fc1f2337cfc90abf0c53f4
CRs-fixed: 2550092
2019-10-22 18:09:45 -07:00
Manikandan Mohan
a0bbb518fc qcacld-3.0: Use policy manager frequency APIs
For 6GHz support and to remove channel number ambiguity use policy
manager APIs updated for frequency in other modules. This change
covers following APIs:
policy_mgr_get_chan_by_session_id
policy_mgr_get_mcc_operating_channel
policy_mgr_check_and_set_hw_mode_for_channel_switch
policy_mgr_is_chan_ok_for_dnbs
policy_mgr_is_safe_channel
policy_mgr_valid_sap_conc_channel_check
policy_mgr_disallow_mcc
policy_mgr_add_sap_mandatory_chan
policy_mgr_remove_sap_mandatory_chan
policy_mgr_is_hwmode_set_for_given_chnl
policy_mgr_is_valid_for_channel_switch
policy_mgr_update_user_config_sap_chan
policy_mgr_is_sap_restart_required_after_sta_disconnect
policy_mgr_is_sta_sap_scc
policy_mgr_nan_sap_scc_on_unsafe_ch_chk

Change-Id: I682f8380d9dc41fc015d73f06b6e055d1d04ef97
CRs-fixed: 2545110
2019-10-22 18:09:31 -07:00
Manikandan Mohan
282c4b6f66 qcacld-3.0: Use policy manager frequency APIs
For 6GHz support and to remove channel number ambiguity use policy
manager APIs updated for frequency in other modules. This change
covers following APIs:

policy_mgr_allow_concurrency
policy_mgr_nan_sap_pre_enable_conc_check
policy_mgr_allow_concurrency_csa
policy_mgr_current_connections_update
policy_mgr_incr_connection_count_utfw
policy_mgr_update_connection_info_utfw
policy_mgr_get_channel_from_scan_result
policy_mgr_update_and_wait_for_connection_update
policy_mgr_get_sap_mandatory_channel
policy_mgr_checkn_update_hw_mode_single_mac_mode

Change-Id: I162c2b90a58539194907c5ecd6915eafecc635cc
CRs-fixed: 2545099
2019-10-22 18:09:25 -07:00
Manikandan Mohan
7fdb02592b qcacld-3.0: Use policy manager frequency APIs
For 6GHz support and to remove channel number ambiguity use policy
manager APIs updated for frequency in other modules. This change
covers following APIs:
policy_mgr_is_chnl_in_diff_band
policy_mgr_check_for_session_conc
policy_mgr_handle_conc_multiport
policy_mgr_change_sap_channel_with_csa
policy_mgr_get_channel
policy_mgr_get_nondfs_preferred_channel

Change-Id: I4a6673db3a02b6e8d7fa94ae452338db618e3883
CRs-fixed: 2545099
2019-10-22 18:09:18 -07:00
Yeshwanth Sriram Guntuka
4ac1584527 qcacld-3.0: Cleanup sta_index in TDLS structures and APIs
Remove sta index references in TDLS structures and APIs
and mac address would be used instead to refer the peer.

Change-Id: I861f7ce068f3f545598129b9f3955b84b2a6fbce
CRs-Fixed: 2524512
2019-10-22 09:05:33 -07:00
Yeshwanth Sriram Guntuka
e6b54245d6 qcacld-3.0: Remove sta index in few prints
Remove sta index in few prints and replace it
with MAC address as part of sta_index cleanup.

Change-Id: I689ede9dc345667f1a054f76bf3d08b236131c13
CRs-Fixed: 2524505
2019-10-22 09:05:02 -07:00
Manikandan Mohan
01d71c3f79 qcacld-3.0: Use regulatory module API to get valid channel list
Update policy manager to use regulatory module API to get valid
channel list instead of MLME config item.

Change-Id: I2fa24c73892746de68ece00e50fd55d6135b7753
CRs-fixed: 2545120
2019-10-19 22:11:36 -07:00
Manikandan Mohan
932c11e3b3 qcacld-3.0: Policy manager update for channel to frequency usage
Update policy manager data structures and APIs to use frequency
instead of channels. This is done to address channel number
ambiguity with introduction of 6GHZ band. Fix all references of
channel and add temporary internal functions for frequency
usage as replacement for public APIs using channels. Also modify
the channel list handling to frequency list in associated modules.

Change-Id: I11dff14a5fbe6d49cf411f8fce6863994ffccd75
CRs-fixed: 2540000
2019-10-19 22:11:30 -07:00
Sravan Kumar Kairam
3bc886df40 qcacld-3.0: Support stats quota for sta + sap ipa offload
Implement metering stats quota to support ipa offload sta plus
sap wifi sharing use cases.

Change-Id: Ic9d5ad817ffb4d671a43f3f3aebb2d8cce293873
CRs-Fixed: 2517696
2019-10-19 17:46:02 -07:00
Sourav Mohapatra
4c9b82aaf6 qcacld-3.0: Fix compilation error in case NAN is disabled
Currently the function ucfg_nan_get_ndi_state is not defined for the
case WLAN_FEATURE_NAN is not defined. As this is a public function
defined in dispatcher/inc/ and can be used externally, there would be a
compilation failure on such cases.

Resolve the failure by declaring ucfg_nan_get_ndi_state as static in the
case WLAN_FEATURE_NAN is not enabled.

Change-Id: I30297e8a3781f9a529c40a1423a9d2613c286f4e
CRs-Fixed: 2548223
2019-10-19 06:48:58 -07:00
gaurank kathpalia
fa09a07ff5 qcacld-3.0: Change default value of force 1x1 as 1
Currently the value of force 1x1 exception is 2
which can lead to STA connection to a OUI AP in 1x1.

In a DBS configuration when AS is disabled, STA came
up in Single Mac mode in 2x2, and when a SAP came up
in DBS, then it sent out a SMPS to AP which lead to AP
crash. But very few APs have this behaviour, so it is
better to have a higher throughput than limit the
connection to 1x1.

Change-Id: I0ebd1ed2b764c3280151ca55117545349e474cbb
CRs-Fixed: 2538438
2019-10-19 06:48:45 -07:00
CNSS_WLAN Service
7ff488ca01 Merge "qcacld-3.0: Process rx_mgmt_pkt based on frequency" into wlan-cld3.driver.lnx.2.0 2019-10-18 09:09:14 -07:00
CNSS_WLAN Service
add7b92269 Merge "qcacld-3.0: WPA3 roam make preauth start command as wakable" into wlan-cld3.driver.lnx.2.0 2019-10-18 09:09:11 -07:00
CNSS_WLAN Service
18afc2c7e9 Merge "qcacld-3.0: Check concurrency before STA vdev start" into wlan-cld3.driver.lnx.2.0 2019-10-18 09:09:08 -07:00
CNSS_WLAN Service
350eb0af15 Merge "qcacld-3.0: Add changes to support qca6490" into wlan-cld3.driver.lnx.2.0 2019-10-18 05:15:43 -07:00
Ashish Kumar Dhanotiya
ca5d922263 qcacld-3.0: Process rx_mgmt_pkt based on frequency
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 part of above requirement add logic to process rx mgmt
packets based on the frequencies instead of channel numbers.

Change-Id: Ib063070738ecdb4f83379eafe50629778a490aae
CRs-fixed: 2522693
2019-10-18 02:55:17 -07:00
Pragaspathi Thilagaraj
0c4489f1ad qcacld-3.0: WPA3 roam make preauth start command as wakable
In WPA3 roam hybrid model, the SAE exchange/4-way handshake is
offloaded to the wpa_supplicant. After roam candidate selection,
firmware will send WMI_ROAM_PREAUTH_START_EVENTID to send SAE
authentication frame with the selected candidate. If the host
is in suspended state, then SAE preauthentication could fail.

So wakeup the host when WMI_ROAM_PREAUTH_START_EVENTID event is
received to carry out the SAE authentication with the provided
candidate

Change-Id: I7a89234e90e7fccef58ec3822dc0cda3740bad20
CRs-Fixed: 2512871
2019-10-17 22:47:02 -07:00
Jianmin Zhu
e487f79e22 qcacld-3.0: Check concurrency before STA vdev start
Currently if there are 3 connections in MCC on same
MAC, FW asserts.
If there are several bssid for same ssid and channel id from wpa
supplicant is 0, driver will sort candidate AP and try one by
one, vdev start channel isn't decided until candidate is
selected, need do concurrency allow check at that time, or lead
to 3 connections on the same MAC.

STA+STA MCC on same MAC has no benefit,  total throughput is even
lower than single STA for channel switch frequently on same MAC.
so add check to disallow STA+STA MCC.

Change-Id: Id286096ea156915432807e42983c68cc83a8b42e
CRs-Fixed: 2545411
2019-10-17 22:46:48 -07:00
CNSS_WLAN Service
d164ef878d Merge "qcacld-3.0: Enabling METERING Feature for lito" into wlan-cld3.driver.lnx.2.0 2019-10-17 20:27:07 -07:00
Manjunathappa Prakash
458f6fe460 qcacld-3.0: Add changes to support qca6490
Add changes to support qca6490 chip.

Change-Id: I861d88f6c9aba5285eff17c188bf335d50839d56
CRs-Fixed: 2522129
2019-10-17 15:06:24 -07:00
Vevek Venkatesan
78382d89e7 qcacld-3.0: Enabling METERING Feature for lito
Enable CONFIG_QCACLD_FEATURE_METERING Feature for lito
in default_defconfig

Change-Id: I70e004e34dbea0690503c5990b2bf83089873898
CRs-Fixed: 2545739
2019-10-16 15:39:06 -07:00
Paul Zhang
d34b575fc5 qcacld-3.0: Add ini to disable aggressive EDCA config
Add action_oui ini gActionOUIDisableAggressiveEDCA to identify peers for
which aggressive EDCA configuration causes some IOT issues.

Change-Id: Ifea0c224cef2378727c9f78d8b571ea9c57bb662
CRs-Fixed: 2507191
2019-10-15 23:17:55 -07:00
gaurank kathpalia
c0d0841183 qcacld-3.0: Normalize the channel weights according to ini
Normalize the weights of the frequencies for ACS scan
if the user has changed them in the ini.
This is done as legacy devices wont be able to scan
the newly added 6ghz frequencies, and thus wont
be able to associate with the SAP if it starts
on 6ghz channels.

Change-Id: I2dd2f706c248f5339bde06963540d0874d08b847
CRs-Fixed: 2543007
2019-10-15 06:44:48 -07:00
Sourav Mohapatra
43e6dea453 qcacld-3.0: Move sta_info from array based to hash based
Currently in hdd_adapter, the variable sta_info is an array of
hdd_station_info structured indexed by the sta_id. As sta_id is no
longer used this array based implementation becomes unnecessary.

Move the sta_info implementation to a hash table implementation.

Change-Id: I7d6fe04b7e0ab22615d431de9a10a4ad38ed65ba
CRs-Fixed: 2514280
2019-10-15 00:48:54 -07:00
Manikandan Mohan
cf5048294b qcacld-3.0: Disallow TDLS when NAN is active
Since NAN has higher priority over TDLS, disallow TDLS link
when NAN is active.

Change-Id: I7de34dbb2f808c36358ac5266c26e2729b901941
CRs-fixed: 2537158
2019-10-14 05:47:03 -07:00
Rajeev Kumar Sirasanagandla
1b3a535500 qcacld-3.0: Ignore regulatory offload indication from FW
Based on the ini "ignore_fw_reg_offload_ind" ignore regulatory
offload indicatin from fw.

Change-Id: I6e20f2100eeac8e93baa5c5d3f3d1c8b33356aed
CRs-Fixed: 2532989
2019-10-12 19:03:35 -07:00
Tushnim Bhattacharyya
0263c1e99a qcacld-3.0: Update ini for roam score algorithm selection
Correct vendor_roam_score_algorithm ini description.

Change-Id: Ia958108087a9d480d790a6bcb5e016fa7cb8b654
CRs-Fixed: 2538846
2019-10-03 19:23:02 -07:00
Tushnim Bhattacharyya
731d63660d qcacld-3.0: Replace timer_stop with timer_stop_sync in p2p module
Replace timer_stop with timer_stop_sync & add some debug print to
track the roc cookie.

Change-Id: I9a71d30b31da3de2bf3242e4a310bad4542b10aa
CRs-Fixed: 2537164
2019-10-03 03:33:47 -07:00
Kiran Kumar Lokere
c220a51edb qcacld-3.0: Add VHT extended Nss BW support for 160MHz
Add VHT extended Nss BW support for 160MHz connection.

Change-Id: I8e2833a48ca5de0301634a88eb1a66002b4c9c20
CRs-Fixed: 2531279
2019-10-02 02:48:04 -07:00
sheenam monga
fd39482ecb qcacld-3.0: Add ini for roam score algorithm selection
CFG_VENDOR_ROAM_SCORE_ALGORITHM is added to specify the
preferred roam score algorithm.
With value 1, the new V2 roam score algorithm will be used.
With this roam score Algorithm, AP score will be calculated
based on below equation:
AP Score = (RSSIfactor * rssiweight(0.65)) +
		(CUfactor * cuweight(0.35))

This algorithm value will be sent to firmware over the
WMI_AP_PROFILE command.

Change-Id: I5e7857108a9623fdf3e698cb842dbc22c21f61a1
CRs-Fixed: 2513571
2019-10-01 22:10:22 -07:00
Ashish Kumar Dhanotiya
b035570f53 qcacld-3.0: Fill correct txpower information
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 frequency attribute is added to the
struct sSirMacChanInfo, in driver some APIs directly copies this
structure info considering as every member of the structure as uint8_t,
as frequency is uint32_t this breaks above asumption and results into
corrupt info and gives undefined behaviour.

To address above issue, use the structure members individually and
give the information by member-by-member copy.

Change-Id: Ied6ad30d8a0800211f99371969ddd192ff40545c
CRs-Fixed: 2537975
2019-10-01 11:54:16 -07:00
Chaoli Zhou
fd8d282a75 qcacld-3.0: Fix WDI 1.0 MCC TX SMMU fault
Merge from 2517936 & 2490501.
SMMU fault is observed for WDI 1.0 MCC TX when SMMU is enabled.
Issue is that dma_addr passed from IPA driver is iova of IPA
domain. WLAN driver directly uses the iova to do transmission.
Since iova is not mapped in WLAN domain, SMMU fault occurs.
Fix is to map skb to WLAN domain for TX when SMMU is enabled.
After doing DMA map, an offset of frag_header and ipa_header
is added to the iova and skb->cb is updated with the new iova.
After TX completion, skb DMA unmap is done but with the iova
of the above offset included, which leads to unmapped iova error.
Fix is to recalculate the iova and update skb->cb with new iova,
which has frag_header and ipa_header length removed.

Change-Id: Ib0112d6a3de6dc9af43e5c48a49085c7d4f41a9b
CRs-Fixed: 2534845
2019-09-29 09:48:12 -07:00
Pragaspathi Thilagaraj
b40c260f17 qcacld-3.0: Register action frames for wake up during runtime PM
Currently the bitmap of action frames that can wake up the host
during suspend is sent via the wmi command
WMI_WOW_SET_ACTION_WAKE_UP_CMDID. This bitmap doesn't include
RRM action frames so currently the host doesn't wake up for rrm
action frames when in suspend mode.

Selectively enable wake up for rrm action frames during runtime PM
alone. Don't enable host wake up during normal suspend as it will
consume more power.

Change-Id: I097596118c2888fc9ea24802e4dbe69d02c5c5f7
CRs-Fixed: 2507185
2019-09-28 04:01:10 -07:00
Alan Chen
d5bcd89b04 qcacld-3.0: Disable dsc panic if fw is down
If fw is down, there is no point to dsc panic. Thus, disable dsc panic
if fw is down.

Change-Id: I1128ea3f32b879305e19fdf45a6e3588a570bd4c
CRs-Fixed: 2535312
2019-09-27 14:56:31 -07:00
Alok Kumar
e888e80ef0 qcacld-3.0: During wlan IPA suspend, force the BW voting to high
During wlan IPA suspend, force the bandwidth voting to high
when CFG_DP_IPA_ENABLE_FORCE_VOTING is enabled.

Change-Id: I9b368081f9c0919f5fecfacf318ad1a714cc33cf
CRs-Fixed: 2521815
2019-09-26 22:04:50 -07:00
Min Liu
91de709b1c qcacld-3.0: Fix possible NULL wmi_handle dereference
Add NULL pointer check for wmi_handle

Change-Id: Iea5505379107b036d0cf245e423b6af73963538a
CRs-Fixed: 2531570
2019-09-26 05:52:24 -07:00
Liangwei Dong
f242c78f7b qcacld-3.0: Check 3th connection valid on same mac
For 3th connection bring up, if first two connections
are SCC on same mac (STA+SAP or SAP+SAP), third connection
(STA or SAP) is not supported on same mac. Previous
commit If30cf58d2b16fc3ff4dfff4f75d7eeaa51786cad
lost the same mac check.

Change-Id: I278e94cbb1e368af57327da869bd961237e7b4b6
CRs-Fixed: 2534987
2019-09-25 23:57:30 -07:00
gaurank kathpalia
7633dfcccb qcacld-3.0: Set chainmask for 2x2 dbs capable device
Set chainmask for 2x2 dbs capable device if enable2x2,
AS, and diversity are disabled.

Change-Id: I3ec8da95b868e79af1f44fdba63b2ee57e4365fa
CRs-Fixed: 2528035
2019-09-25 13:22:50 -07:00
Bala Venkatesh
ab30be31ba qcacld-3.0: Do not send enable TDLS in case of DBS
Currently, TDLS set state command is sent to FW after any session
decrement without checking the HW mode is DBS. This can lead to
FW assert.

Check for HW mode before enabling TDLS in FW.

Change-Id: I70d5ba15c9b891f5d9b411960d51d684105061e8
CRs-Fixed: 2530773
2019-09-25 09:20:37 -07:00
Hangtian Zhu
9a28ed0437 qcacld-3.0: Enable configurable dfs_pri_multiplier
Enable configurable dfs_pri_multiplier. The ETSI typ2 type3 radar
detection ratio is lower than expected(>80%) while channel loading is
high(>30%). The host improvement for this are:
	1. Add configurable dfs_pri_multiplier, controlled by
	   DFS_PRI_MULTIPLIER. Default value 2, min 1, max 10.
	2. Lower adrastea ETSI type 2/3/4 radar filter rssi_threshold,
	   controlled by DFS_OVERRIDE_RF_THRESHOLD, dfs log shows that
	   QCS405 target report RSSI range [18, 45] while radar power
	   is 3 dbm. By using default rssi_threshold 24 will reject
	   many radar pulses, which leads to low detection ratio.
	3. Calculate deltapri for each searchpri based on dfs_pri_multiplier
	   in dfs_count_the_other_delay_elements(), check deltapri
	   between [1, dfs_pri_multiplier] * refpri and searchpri, if
	   the primargin is desired, mark it as matched pulse.
	4. Pick lowpri as refpri for the radar filter with
	   rf_ignore_pri_window equals to 0 while DFS_PRI_MULTIPLIER is
	   enabled. Observed original findref logic has some problems
	   which selects refpri is bigger than lowpri, which leads to
	   the lowpri pulses pri_match are set to 0, and in this case,
	   radar was not detected. Example for the issue, assume
	   rf->rf_pulseid 34 (ETSI type 2) has 7 pulses with pri:
	   1489, 2978, 2978, 2978, 1489, 2978, 1489 us in this case,
	   highscore is 4 (2978), scoreindex is 5, refpri is 2978, which
	   leads to: index 0, 4, 6 pulses with pri_match 0 in
	   dfs_count_the_other_delay_elements(). The fix is to select
	   lowpri as refpri(1489 in this case).

Change-Id: I1f3ca3298c9ab1f1e2651ad6b4a0a4810f83f8a1
CRs-Fixed: 2522506
2019-09-25 06:14:10 -07:00
bings
4ec11bbdf2 qcacld-3.0: fix max of gReportMaxLinkSpeed
The max value of gReportMaxLinkSpeed should be
CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED.
Set the max value of gReportMaxLinkSpeed to
CFG_STATS_LINK_SPEED_REPORT_MAX_SCALED, otherwise
gReportMaxLinkSpeed does not work.

Change-Id: I164de224a4f4bfdd2dea55fe0a943fc4884326ff
CRs-Fixed: 2532054
2019-09-25 01:08:49 -07:00
Yu Tian
0cc79c7e5e qcacld-3.0: Fix IPA iface not initilized
There is a race condition of vdev_to_iface, it is referenced in IPA W2I
callback routine, but it's updated after IPA enable operation. If frames
received right after IPA enabled, callback function will return failure
due to vdev_to_iface value is not filled.

Change-Id: Iff831b66771539d1de4af89e395821dc50d13af3
CRs-Fixed: 2517515
2019-09-24 15:24:31 -07:00
Rakshith Suresh Patkar
a4dea9069a qcacld-3.0: Reset vdev_to_iface QDF_IPA_STA_DISCONNECT
In __wlan_ipa_wlan_evt, for QDF_IPA_STA_DISCONNECT event,
ipa_ctx->vdev_to_iface[session_id] is reset back to
WLAN_IPA_MAX_SESSION only when ipa_ctx->sap_num_connected_sta
is greater than 0. So, in STA+SAP concurrency case, when
no client is connected to SAP, if STA is disconnected,
vdev_to_iface is not reset for that particular session id,
making it unusable for further events involving IPA iface
creation.

Fix is to move the code to reset vdev_to_iface outside the check
for ipa_ctx->sap_num_connected_sta in QDF_IPA_STA_DISCONNECT
scenario, so that vdev_to_iface is reset irrespective of SAP.

Change-Id: I06c79b62c540546cf4842f81d235f96b2965661e
CRs-Fixed: 2525709
2019-09-24 11:51:01 -07:00
Srinivas Dasari
1ec7452b18 qcacld-3.0: Restore all control config params upon CLEAR_ALL
User might modify the roam control config params through
multiple commands as part of roam control config enable.
Currently, only the params which are modified as part of
SUBCMD_CONTROL_SET command are restored. Restore all of the roam
control config params from the default ini values when the
control config is disabled i.e when the CLEAR_ALL is received.

Change-Id: I59ebc2e3018b01889ffb2bcd19b72d6d20fd0517
CRs-Fixed: 2517854
2019-09-23 07:28:01 -07:00
Srinivas Dasari
7f48ac026d qcacld-3.0: Update roam delta to neighbor roam info only
Currently, roam delta is updated to global mac ctx when it's
updated through DRIVER command. But the update should
happen only to the neighbor roam info of the corresponding vdev.
Retrieval also should happen based on vdev.

Change-Id: I355b9db2e142d4205088627672c3fb27c32d7fbd
CRs-Fixed: 2530333
2019-09-23 07:27:24 -07:00
Paul Zhang
c9dbaeea18 qcacld-3.0: Add interface to get / set eLNA bypass
Add interface to get / set eLNA bypass from / to firmware

Change-Id: Idf5d6a838d2596767a1fb00040457af721fba69d
CRs-Fixed: 2498525
2019-09-21 02:46:53 -07:00
Sourav Mohapatra
3f02b6a70d qcacld-3.0: Add ini support for NDP inactivity timeout
Add an ini configuration that configures the inactivity timeout for NDP
peer. The value is sent to the firmware via the VDEV param
WMI_VDEV_PARAM_NDP_INACTIVITY_TIMEOUT.

Change-Id: Ifffe6bb40df94761d739463cf7e54a0be7e2a375
CRs-Fixed: 2531756
2019-09-20 23:36:09 -07:00
Ashish Kumar Dhanotiya
645af711aa qcacld-3.0: Validate tdls sta id in del station command
Currently sta id validation is not there in del
station command for tdls. There could be a case where peer
is there but sta id is not valid.

Consider a case where there is tdls connection between 2
p2p clients and one of the client decided to connect to SAE
AP, this brings up concurrency scenario on that client for
p2p client and station, so tdls connection should be tear
down. device tear down the tdls link and inform the supplicant
regarding the same. Now in the driver scheduler, connect
command is there which is queued when device tries to connect
to SAE AP, this command gets a chance to execute.
When SAE connection is executed, driver gets a command from
supplicant to disable tdls links for the previous connection
which is already teardown, this command is queued into
scheduler which blocks the supplicant thread.
For SAE connection to get complete driver waits for auth
request from supplicant.
Here supplicant waits for the tdls disable link command's
response which will never come as driver waits for SAE
authentication which leads to deadlock.

To address above issue, add a check to validate sta id
before queing tdls down link command to scheduler, if the sta
id is invalid, return response to supplicant as tdls peer is
already deleted.

Change-Id: Ie983aa9f217c0d7b4508639bb33ad1a44b3675c7
CRs-Fixed: 2521529
2019-09-19 03:25:47 -07:00
Bala Venkatesh
221790b07e qcacld-3.0: Do not send UAPSD command after TDLS connection
Currently as part of tdls enable link, If the peer is buff
capable or tdls uapsd is enabled in INI. UAPSD is enabled in
FW. Avoid sending this command to FW as it effects the behavior
with AP.

Change-Id: Idc023cb9de3ab63e7643815d473fe0efa98069b9
CRs-Fixed: 2528208
2019-09-19 02:01:45 -07:00
Abhishek Singh
6e5c7a6f42 qcacld-3.0: Use add_bss_resp structure while handling add bss resp
The add_bss_req struct is used while handling add bss resp,
and is stored in vdev priv mlme.

The resp path require the info which can be filled from vdev resp
and thus no need to store the add_bss_req. From response fill and
use the add_bss_resp in add bss response handling path

Change-Id: I7ec1189c7d399e181f451a442a2578964eb4e47d
CRs-Fixed: 2529289
2019-09-18 22:53:52 -07:00
Kiran Kumar Lokere
229212a653 qcacld-3.0: Refactor SAP module to use channel frequency
Update SAP data structures to use channel frequency values instead
of using the channel id values to support 6GHz channels in SAP.

Change-Id: I9ef5857e8dcf3f7d879495d3f3c3ead083fe0bf0
CRs-Fixed: 2513083
2019-09-18 22:53:37 -07:00
Ashish Kumar Dhanotiya
285213c6cb qcacld-3.0: Convert channel to frequency in rx mgmt handler
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: I757f60cef414d206b275b4fbd192d5d22bbc93d7
CRs-Fixed: 2517901
2019-09-18 11:22:51 -07:00