Commit Graph

6161 Commits

Author SHA1 Message Date
Ashish Kumar Dhanotiya
b64f4c342a qcacld-3.0: Prevent stainfo against double detach
Currently there is no way to know if an stainfo is
already detached and driver can detach stainfo
again which may lead to put sta ref count twice in
some race condition.

In current scenario SAP receives the deauth from station,
disconnects the station and puts the sta reference taken
against station attach.
In parallel to the deauth from station if SAP gets the
disconnect from user space, it gets the sta reference
and moves ahead with the disconnect process, in this
process again does detach and does the put sta ref
taken as part of the sta attach, in this way it puts the
sta info twice.

To address above issue add logic to check if stainfo is
already detached or not, if sta info is not already
detached, detach the sta info and do the put ref.

Change-Id: I00c75c4d850931fb2a347d740002c21fae50785a
CRs-Fixed: 2735151
2020-07-22 03:21:27 -07:00
Surabhi Vishnoi
fbbe6aa86d qcacld-3.0: Add condition to check LLM mode while updating pm_qos
Currently, the pm_qos request and cpu mask is updated in bus bandwidth
work handler. In low-latency mode also, cpu mask and pm qos request is
updated. In cases when low latency mode is enabled and cpu mask is set
to all, the bus bandwidth work handler may overwrite the settings done
in LLM mode.

To resolve this issue, add a condition to check if llm_enabled is set
while updating the pm qos request.

Change-Id: I42c131c943128702de95f545c99e35978586d417
CRs-Fixed: 2733979
2020-07-21 04:00:54 -07:00
Abhishek Ambure
d6ac4613c9 qcacld-3.0: Add support to send MSCS ie in assoc req
MSCS enables the establishment of classification using layer 2 and/or
layer 3 signaling to classify incoming individually addressed MSDUs
into streams. The MSCS Descriptor element defines information about
the parameters used to classify streams.
Host gets MSCS IE in set IE user request. Host adds the support to set
MSCS ie in assoc req.

Change-Id: I9c458326ffba3bad58ba27a611f5753afcf0531a
CRs-Fixed: 2732722
2020-07-21 00:00:25 -07:00
Rakesh Pillai
9f72aa9c82 qcacld-3.0: Fix use-after-free when skb is copied
When we receive a packet from the network stack for
transmission, we make a copy of this skb and free the
shared skb before trying to trasnmit it.

Currently the mac address used for tdls operations is
taken as a pointer to the original skb, which gets freed
after the skb_unshare.

Copy the mac address into a local stack memory instead
of using a pointer to the skb data to avoid the
use-after-free condition.

Change-Id: I9f0e6260476d5a41b7209a6a599f50a548b953b5
CRs-Fixed: 2733445
2020-07-20 07:52:22 -07:00
Pragaspathi Thilagaraj
ef4302f003 qcacld-3.0: Don't allow roam invoke if roaming offload is not initialized
Roam invoke is done by driver if reconnect to same bssid is
received or driver FASTREASSOC command is received from the
supplicant. If roaming module is not initialized at firmware,
then still we send roam invoke to firmware and firmware sends
roam invoke failure as part of which disconnection occurs.

Check if roaming module is initialized at firmware, else return
failure for the reassociation request from userspace.
Send failure only if the kernel version is greater than 4.9,
since the fix to handle reassociation failure is available from
this version.

Change-Id: I0feae326be751e50f7327c91739cd7dddab500e9
CRs-Fixed: 2724686
2020-07-19 06:22:36 -07:00
Srinivas Girigowda
1445904715 qcacld-3.0: Rename file name and function name for sysfs 'dp_trace'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'dp_trace'

Change-Id: Id4e366bea50d1bda95ee02cd7edd02691d0f70c6
CRs-Fixed: 2731064
2020-07-17 23:59:42 -07:00
Srinivas Girigowda
987834feb7 qcacld-3.0: Rename file name and function name for sysfs 'stats'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'stats'

Change-Id: Iffc390d4865977f9eff72a6a4bcf708c014f482e
CRs-Fixed: 2731064
2020-07-17 23:59:38 -07:00
Srinivas Girigowda
d3255f634e qcacld-3.0: Rename file name and function name for sysfs 'range_ext'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'range_ext'

Change-Id: Icf7ebbbcf1b8b219e64d1c9b98f1946069f91322
CRs-Fixed: 2731064
2020-07-17 23:59:34 -07:00
Srinivas Girigowda
d39a796a98 qcacld-3.0: Rename file name and function name for sysfs 'wlan_dbg'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'wlan_dbg'

Change-Id: I7d0e7b67afa701abd64efb62012c218ee4ab158d
CRs-Fixed: 2731064
2020-07-17 23:59:30 -07:00
Srinivas Girigowda
64d1d78340 qcacld-3.0: Rename file name and function name for sysfs 'fw_mode_config'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'fw_mode_config'

Change-Id: Ia389fa8807bbd0e58de58c503d9f3bbbef9ec707
CRs-Fixed: 2731064
2020-07-17 23:59:26 -07:00
Srinivas Girigowda
837ca7fad6 qcacld-3.0: Rename file name and function name for sysfs 'scan_config'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'scan_config'

Change-Id: I6621cbe5571541d073072ef9e0348d771fd3bc4a
CRs-Fixed: 2731064
2020-07-17 23:59:22 -07:00
Srinivas Girigowda
36b00847fc qcacld-3.0: Rename file name and function name for sysfs 'radar'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'radar'

Change-Id: If13effc45323f5a286d8aeb7a8e27848cb3e618b
CRs-Fixed: 2731064
2020-07-17 23:59:18 -07:00
Srinivas Girigowda
c9933da318 qcacld-3.0: Rename file name and function name for sysfs 'tx_stbc'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'tx_stbc'

Change-Id: I274c1405fab7385202431b48d65603c38783222b
CRs-Fixed: 2731064
2020-07-17 23:59:14 -07:00
Srinivas Girigowda
fe1406f727 qcacld-3.0: Rename file name and function name for sysfs 'tdls_peers'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'tdls_peers'

Change-Id: If6aa504dccd22ce0ccff11f3d73ffb1eedb5895c
CRs-Fixed: 2731064
2020-07-17 23:59:11 -07:00
Srinivas Girigowda
82f61cee0f qcacld-3.0: Rename file name and function name for sysfs 'sta_info'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'sta_info'

Change-Id: Ibb13c1496ea1dd5bc3b024b99414ac8d72db3be6
CRs-Fixed: 2731064
2020-07-17 23:59:07 -07:00
Srinivas Girigowda
0770581b30 qcacld-3.0: Rename file name and function name for sysfs 'temperature'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'temperature'

Change-Id: I8f31d59be9954d3ffe1ff7c11d16dd24b9e2644d
CRs-Fixed: 2731064
2020-07-17 23:59:03 -07:00
Srinivas Girigowda
57d6d48573 qcacld-3.0: Rename file name and function name for sysfs 'monitor_mode_channel'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'monitor_mode_channel'

Change-Id: Ic207d6e29c14a0b33ed4982d533a78729d32a4ba
CRs-Fixed: 2731064
2020-07-17 23:59:00 -07:00
Srinivas Girigowda
5883ffbcba qcacld-3.0: Rename file name and function name for sysfs 'channel'
Rename file name and modify function names to keep it inline
with sysfs attribute name 'channel'

Change-Id: I9c73e572bdb80edc3431180448dffd9843d6a720
CRs-Fixed: 2731064
2020-07-17 23:58:56 -07:00
Sachin Ahuja
a69ab56aa6 qcacld-3.0: Check for fw down before reinit complete
Currently reinit resets the recovery in progress flag when
reinit is successul. It may happen that after initial handshake
with FW during reinit, FW crashes and send the FW down indication
to the driver. Driver sets the recovery flag in FW down but it gets
reset on the successul reinit.
Now on subsequent shutdown, driver crashes as recovery flag is
reset by last reinit.

Check for fw down to reset the recovery flag on reinit completion

CRs-Fixed: 2727205
Change-Id: I88effc1211de138351ef9b232645d0c616a9d5dc
2020-07-17 04:03:45 -07:00
Abhinav Kumar
c871ecddbd qcacld-3.0: Send roam triggers from vendor cmd to firmware
Userspace can configure different roam control params as
defined in qca_vendor_attr_roam_control through the roam subcmd
QCA_NL80211_VENDOR_SUBCMD_ROAM and the below attributes:
QCA_ATTR_ROAM_CONTROL_SCAN_FREQ_SCHEME
QCA_ATTR_ROAM_CONTROL_CONNECTED_RSSI_THRESHOLD
QCA_ATTR_ROAM_CONTROL_CANDIDATE_RSSI_THRESHOLD
QCA_ATTR_ROAM_CONTROL_USER_REASON

Send value of above attribute to fw through command
WMI_ROAM_ENABLE_DISABLE_TRIGGER_REASON_CMDID for trigger
reason WMI_ROAM_TRIGGER_REASON_BTM_WTC.

Change-Id: I17502eebab56652192164144b7ebdadb32033117
CRs-Fixed: 2729119
2020-07-16 20:05:12 -07:00
Tushnim Bhattacharyya
23590472f2 qcacld-3.0: Unicast deauth from SAP isn't going OTA
SAP sends unicast disassoc to associated stations
as part of the del station request from userspace.
But host is flushing the tids as well at the same
time causing a race in FW which is failing to send
out the unicast deauth/disassoc. Fix is to add the
delay between sending the unicast frame & flush tid.

Change-Id: If52da8766f72b8f5a1ed97ca5e1d9f87d82840d8
CRs-Fixed: 2731483
2020-07-16 12:02:45 -07:00
Pragaspathi Thilagaraj
f16ee17015 qcacld-3.0: Validate FILS ERP key lengths in connect request
If ERP key lengths are greater than maximum valid lengths,
currently the connect request is allowed to go through.
Allow fils connection to go through only if erp keys are
not sent in connect. If erp information is present, validate
the rrk, realm, username length.

Add changes to lookup pmkid based on bssid also in addition to
the existing logic to lookup based on fils cache_id and ssid.

Change-Id: Iebde1f382b7db13553b848a459cb4a783744c2a6
CRs-Fixed: 2732050
2020-07-16 12:02:38 -07:00
Ashish Kumar Dhanotiya
cb959bd757 qcacld-3.0: Retain the stainfo ref count in case of re-connect
Currently in SAP case if a station disconnects and re-connects
to the SAP, in the process of register sta, SAP clears
previous reference of the station and re-initializes the sta
info. Because of this when the thread which actually took the
reference, tries to release the reference, is not able to release
the reference as the ref count is already set to zero as part
of the reconnect which results in undefined behaviour.

To address this issue, retain the ref count of the sta info
in case of re-connect from the same station.

Change-id: Ie9558ca8e59601b48f9be7fff37cc530874ab5ad
CRs-Fixed: 2730782
2020-07-15 05:52:05 -07:00
Lincoln Tran
1de7a9a643 qcacld-3.0: Update band_capability INI to use bitmap
The band_capability field is used in other places to be
a bitmap over reg_wifi_band. Update the field in wma_tgt_cfg and
wlan_mlme_generic to take the same bitmap for consistency.
Update all references to these fields to expect a bitmap as well.

Change-Id: I8abd697e2fbe02b4eadd32f3027bef7408bac2a0
CRs-fixed: 2726710
2020-07-15 01:46:30 -07:00
Lincoln Tran
d5e1f78aa8 qcacld-3.0: Introduce getband vendor command
Update calls from reg_get_curr_band to reg_get_band since
they provide the same functionality.
Update calls to reg_get_band to expect a bitmap since the API
has been updated.
Update getband driver command to convert the bitmap to the
old values. Also add the new vendor command getband.

Change-Id: I069489ebf4826f8f4bfcb974b74e4d0591d5b33f
CRs-fixed: 2726361
2020-07-14 22:45:22 -07:00
Lincoln Tran
d189dc8105 qcacld-3.0: Update setband commands to support 6G
Update both the driver and vendor setband command to support the
new 6G band. Specific changes include:
	1. Update driver setband command to convert userspace
	   input into a setband bitmap.
	2. Update vendor setband command to accept a bitmask
	   or a value
	3. Add support API to convert between vendor mask and reg
	   bitmap.

Change-Id: Ic968261ce5c3712f1e73cac0cb5a5f030118753a
CRs-fixed: 2726314
2020-07-14 22:45:17 -07:00
Paul Zhang
a426dc45c3 qcacld-3.0: Use get/put to refer vdev [4/4]
Any direct reference to adapter->vdev outside the initial
assignment should use get/put to properly refer the vdev.
        core/hdd/src/wlan_hdd_nan_datapath.c
        core/hdd/src/wlan_hdd_p2p.c
        core/hdd/src/wlan_hdd_softap_tx_rx.c

Change-Id: I2e98ca517c63ad0a03d3539fc9f97f8e466ba2ab
CRs-Fixed: 2714025
2020-07-14 04:26:25 -07:00
Paul Zhang
9ba5a2bc01 qcacld-3.0: Use get/put to refer vdev [2/4]
Any direct reference to adapter->vdev outside the initial
assignment should use get/put to properly refer the vdev.
      core/hdd/src/wlan_hdd_power.c

Change-Id: I68a093c92e57b7076cf4f41e9f69f747f0c7e6ec
CRs-Fixed: 2714025
2020-07-14 04:26:22 -07:00
Paul Zhang
baac594a3f qcacld-3.0: Use get/put to refer vdev [1/4]
Any direct reference to adapter->vdev outside the initial
assignment should use get/put to properly refer the vdev.
        core/hdd/src/wlan_hdd_ioctl.c
        core/hdd/src/wlan_hdd_station_info.c
        os_if/interop_issues_ap/src/wlan_cfg80211_interop_issues_ap.c

Change-Id: I897ee8ac2a4816b91ed48e2c32e97540430c5520
CRs-Fixed: 2714025
2020-07-14 04:26:19 -07:00
Wu Gao
4e5a1591c5 qcacld-3.0: Add ini to configure max tdls peer count
Add ini "gTDLSMaxPeerCount" to configure max tdls peer count.

Change-Id: I45c287c6c9a2fa1dcebcea54fdd0fc0d8a14b064
CRs-Fixed: 2718971
2020-07-13 23:39:20 -07:00
Mohit Khanna
114f32b925 qcacld-3.0: Add P2P UDP/TCP checksum offload INI entry
Add support to enable disable TCP/UDP checksum offload for P2p modes.

CRs-Fixed: 2725394
Change-Id: Ib09ef7a0f118d181f4d358857eb960ee41af9e54
2020-07-12 01:49:28 -07:00
Srinivas Dasari
8e493f081d qcacld-3.0: Handle SAP+NAN concurrency when NAN_DBS isn't supported
When nan_sap and nan_disable are supported but nan_dbs is not
supported,
1. Allow SAP+NAN concurrency if force SCC is supported
2. Disable NAN if SAP comes up on a different band and force SCC is
   not supported
3. Reject NAN enable if SAP is already on a different band and force SCC is
   not supported

Change-Id: Ic53eedcda2e5b314f9be2a4bd913d5e63f6613a2
CRs-Fixed: 2729986
2020-07-11 22:39:29 -07:00
Srinivas Dasari
d296457502 qcacld-3.0: Rename nan_disable_support to nan_conc_controlled_by_host
nan_disable_support is the firmware capability to allow host to
disable NAN. So that host can disable NAN in any unsupported
concurrencies. This was actually introduced to handle
NAN concurrencies. Rename the capability flag and corresponding
APIs across host driver to resemble the functionality.

Change-Id: I24805194fdb855040bcc518acc96459ee7cb5128
CRs-Fixed: 2729984
2020-07-11 20:32:22 -07:00
Abhishek Ambure
9ef1764a24 qcacld-3.0: Add support to get roam scan frequencies
For user request of get roam scan frequencies using vendor sub command
QCA_WLAN_VENDOR_ROAMING_SUBCMD_CONTROL_GET and vendor sub attribute
QCA_WLAN_VENDOR_ATTR_ROAMING_PARAM_CONTROL, host replies with list
of roam scan frequencies.

Change-Id: Ia63a5181e13541629a380dec9a032743d15add0c
CRs-Fixed: 2725834
2020-07-11 11:37:19 -07:00
Aditya Kodukula
09d99afb7e qcacld-3.0: Fix a code comment in hdd_fill_rate_info
Fix a code comment in the function hdd_fill_rate_info

Change-Id: Ia906bc063cd2dfdd5a43a436b6fdb5a155bbc68a
CRs-Fixed: 2728716
2020-07-10 21:55:44 -07:00
Pragaspathi Thilagaraj
eb128b5dfe qcacld-3.0: Add roam offload state machine changes
Add changes to handle transition to the 2 new states:
1. Roaming in progress: Switch to this state when roam
start notification is received from firmware.
2. Roam Synch in progress: Switch to this from RSO
STARTED state if roam synch indication event is received
from firmware. Change to this state is also allowed in
RSO STOPPED state if supplicant disabled roaming on that
vdev - to allow roam invoke to be processed.

Also query the state machine to get the roaming status instead
of using discrete flags at various layers. Clean the redundant
roaming in progress, roam synch related flags.

Change-Id: Ide20a30d9d8c20a96d8bba70367b51b8643cae09
CRs-Fixed: 2725443
2020-07-10 13:42:21 -07:00
Min Liu
6296d6d783 qcacld-3.0: Fix type mismatch in set wifi config PHY_MODE
Fix the type mismatch issue in set wifi config PHY_MODE and
refactor related APIs.

Change-Id: I2d84f144766126c54e2ed449d367316b65fc769c
CRs-Fixed: 2706050
2020-07-10 07:45:37 -07:00
sheenam monga
99b51da592 qcacld-3.0: Advertise dpp akm suite in sta mode
Currently, kernel and driver both support dpp akm suite.
but driver doesn't advertise WLAN_AKM_SUITE_DPP_RSN which may
cause issue for WLAN_AKM_SUITE_DPP_RSN supported connection.

Fix: Advertise WLAN_AKM_SUITE_DPP_RSN as supported akm suite
in sta mode.

Change-Id: I5882b310a742c06ad57e97fc24735a9e5021f352
CRs-Fixed: 2726197
2020-07-09 15:54:18 -07:00
Surabhi Vishnoi
1ce2688f28 qcacld-3.0: Add handler for WMI_VDEV_BCN_LATENCY_EVENTID
WMI_VDEV_BCN_LATENCY_EVENTID is sent by firmware when it receives
the latency IE from connected AP in beacon.

Add handler for this event and when latency_level received is ultra
low in latency IE, update request pm qos type PM_QOS_CPU_DMA_LATENCY
to level DISABLE_KRAIT_IDLE_PS_VAL to speed up CPU efficiency and
irq response. This is needed for Voice and Music products where extreme
low latency is needed while playing music and high power consumption is
accepted.

Change-Id: I3c63ef247f4f4a1add68111ef1bcee6daafd148a
CRs-Fixed: 2723205
2020-07-09 15:54:14 -07:00
Yeshwanth Sriram Guntuka
59e699aa03 qcacld-3.0: Fix possible NULL hdd context dereference
On dp_aggregation sysfs store or show, wiphy is fetched
from hdd context without validation. This could result
in possible NULL hdd context dereference.

Fix is to validate the hdd context before dereference
to get wiphy.

Change-Id: I0d01f64e95c9aa3f09ccc940a64d5a25148c302e
CRs-Fixed: 2726433
2020-07-09 11:32:55 -07:00
Sandeep Puligilla
69a2d503d5 qcacld-3.0: SAP sends broadcast disassoc to STA
SAP sends broadcast disassoc to associated stations
as part of the del station request from userspace.

hdd_softap_deauth_current_sta is sending broadcast
address to SME to send the disassoc frame instead
of associated STA address. Modified API to pass
the STA address.

Change-Id: I1645441804abef3c76f7deeff44ef929684c0bf1
CRs-Fixed: 2726960
2020-07-09 11:32:51 -07:00
Sachin Ahuja
9687cd8708 qcacld-3.0: Add psoc op start for state ctrl param write ops
Race conditon is seen between the mode change and Wifi Off.
When mode change happens, modules are stopped and wmi handle
becomes NULL. As a part of state ctrl param write, BLM module
uses this wmi handle to send the reject ap list to FW.

Add the psoc op start protection for the ops required during
wifi off.

CRs-Fixed: 2722283
Change-Id: I8e8d9ca789dcacf201934105725e677ce9e0a031
2020-07-09 09:23:54 -07:00
Jingxiang Ge
da272dd932 qcacld-3.0: Move wmm dscp init to hdd_wmm_adapter_init
Currently wmm dscp will be called when open adapter,
as wmm dscp will send wmi cmd to fw, it is not right
place as adapter not yet started.

Move wmm dscp init to hdd_wmm_adapter_init, which
adapter vdev has been created.

Change-Id: I41b5e79d0b28ead9c449612ca2d2ed7529b3495f
CRs-Fixed: 2725883
2020-07-09 01:03:03 -07:00
Jingxiang Ge
ea468c6c52 qcacld-3.0: cleanup dfs cac timer for p2pgo in SSR
There is possible dfs cac timer start on p2pgo,
then ssr happens, which cause timer leak.

Clean up dfs cac timer when stop adapter.

Change-Id: I8fe67420196ac752941476312caa7a80f2b3e264
CRs-Fixed: 2720896
2020-07-08 23:02:34 -07:00
Li Feng
0e6dc924e5 qcacld-3.0: Add ini entry for wow pulse configuration
qcacld-2.0 to qcacld-3.0 propagation

Add ini entry to configure wow pulse repetition count
and wow pulse init level.

Change-Id: Ic23d2ae80f6f0adef9f35bfef5a59eb0220c70ae
CRs-Fixed: 2722997
2020-07-08 06:51:42 -07:00
Sourav Mohapatra
95ea7c675f qcacld-3.0: Limit the number of times get_tx_power can come
Currently in the driver, there is no limit on how many number of times
get_tx_power can be requested by the userspace. This can lead to
potential issues where the firmware crashes due to excessive stats
request.

Add a time based rate limiting logic wherein the function call only
sends request to the firmware once in three seconds. In other cases, it
returns the cached value present in the adapter.

Change-Id: I65f23135d88c66e6438484715dafce3def14ddb3
CRs-Fixed: 2717633
2020-07-08 06:51:38 -07:00
Pragaspathi Thilagaraj
df22e92942 qcacld-3.0: Add support for FILS pmksa caching without ERP keys
For FILS pmksa caching, the STA can use the PMKSA cached as
part of the full 802.1x connection. When FILS PMKSA caching
is used, the supplicant might not send the ERP keys in the
connect request. So add support to allow connection when
ERP keys are not received in connect request but FILS
PMK is present in the cache.
If the PMK cache lookup is successful for the bssid,
use pmksa caching to associate, else fallback to full 802.1x
to associate to the BSS.

Change-Id: I9fa67ee5978b7199da1cb638f7f321baed6e5913
CRs-Fixed: 2710402
2020-07-08 02:14:03 -07:00
Alan Chen
df0f3aff28 qcacld-3.0: Complete qdf wait events during fw down
Complete qdf wait events during fw down to avoid higher layer timeouts.

Change-Id: Ibb6bb8a3acd9edc488975952c015d6221f737923
CRs-Fixed: 2726398
2020-07-08 00:09:37 -07:00
Abhishek Singh
4b9273d712 qcacld-3.0: use crypto from vdev to fill the scan filter
use crypto from vdev to fill the scan filter.

Change-Id: I2c4bd9b85d9dac14c4d331a84cc7f3307d06818d
CRs-Fixed: 2718080
2020-07-08 00:09:34 -07:00
Srinivas Girigowda
942799962e qcacld-3.0: Check for NULL pointer before de-referencing it
Pointer 'hif_ctx' returned from call to function 'cds_get_context'
may be NULL. Check for NULL pointer before de-referencing it.

Change-Id: I9d34d877783b35829faf2049c3c8c43519e12914
CRs-Fixed: 2726468
2020-07-07 21:38:33 -07:00