Currently host sends many pdev/vdev set param
commands separately to firmware from hdd.
Combine multiple pdev/vdev set params and
send to WMI to reduce number of transactions.
Also replace target wmi pdev/vdev params with host wmi
pdev/vdev params to fix existing broken layering
violation.
Change-Id: Ib76f5bd5f582a2c67486f6773ff6fd486b3d84cf
CRs-Fixed: 3333732
Currently host sends tx chain mask and rx chain mask
pdev set params separately to firmware.
Combine these tx_rx chain mask pdev set params,send to WMI
to reduce number of transactions.
Also replace target wmi pdev/vdev params with host wmi
pdev/vdev params to fix existing broken layering
violation.
Change-Id: I6bd27b4bc99cbe44e6bdca2a8d55050a49719673
CRs-Fixed: 3333635
The kernel-doc script identified a multitude of documentation issues
in components/nan, so fix them.
Change-Id: Ibec4c381da3088f704264d04f756d82d20613c46
CRs-Fixed: 3359549
As part of Spatial Reuse, host has to send SR Suspend and resume
events based on concurrency which is not sent in case of NAN
concurrency.
Fix is to send SR Suspend in case NAN comes up and any STA that
supports SR is already present because SR is not supported in
case of NAN concurrency. Similarly during NAN disable check
if any other vdev apart from NAN is sharing mac with STA that
supports SR and SR support on same mac is disabled then don't
send SR resume event as there is already a concurrent vdev that
will take care of SR Suspend event otherwise send SR Resume event.
Change-Id: I56a9b455dd0166bc3997f8306992e46da759e992
CRs-Fixed: 3339713
When same NAN commands are issued back to back, serialization
module rejects the commands when there is a command present
in the pending queue. But the memory allocated for the NAN buffer
is not freed in such failure cases.
Free the NAN buffer in such failure cases to avoid memleaks.
Change-Id: I1d1f9c077d4b6239f4400d9b3ed185e63e471b56
CRs-Fixed: 3341229
While SAP doing CSA, NAN enabled, SAP tries to do CSA to force SCC with
NAN in scheduler thread, since last CSA in progress, scheduler thread is
blocked to wait last CSA finished, CSA timer can't be handled in scheduler
thread any more, last CSA can't finish, deadlock happens until timeout.
To fix it, let SAP force scc with NAN logic run in work thread instead of
scheduler thread.
Change-Id: Icb774ffcfc70f279ba3b18b3c5cd4a169180e99b
CRs-Fixed: 3344905
Firmware handles all NAN concurrencies in the platforms which
don't advertise the WMI service cabability
WMI_SERVICE_NAN_DISABLE_SUPPORT. Host takes care of the NAN
concurrency if the capability is advertised by firmware.
But there can be some legacy targets where firmware wants to
offload NAN+TDLS concurrency alone to the host and it takes care
of rest of the concurrencies. This is to make NAN of higher
priority and disable TDLS when NAN is active. Currently, TDLS is
of more priority than NAN and it can't change the order as it
can't disable TDLS to change the priority.
Currently, driver doesn't parse the NAN messages(even NAN enable
request) in such platforms. Parse the NAN messages and disable
TDLS upon NAN enable request. Rely on NAN state machine to
allow/disallow new TDLS requests. This needs NAN enable status.
Change-Id: Ie9c7c1cc2f1ed6328a31b93077c2928940fc3450
CRs-Fixed: 3263730
Currently, host driver sends NAN enable and disable request to
firmware and wait for its response to change the NAN state in
driver. But, when firmware is down (during SSR), driver is in
recovery state and so, timeout occurs while waiting for response.
To fix this, driver does not need to wait for NAN enable/disable
response from firmware in recovery state. It can directly take the
action and change the NAN state machine. Hence, add flag to check
the driver recovery state. If recovery is in progress, then driver
does not wait for firmware NAN enable/ disable responses.
Change-Id: I0325240cc082d8ef91d48793d3da2eea552d59cd
CRs-Fixed: 3307543
Currently in driver, for non-DBS hw mode, null peer is released in the
function ndi_remove_and_update_primary_connection. This causes null
pointer deferencing.
To fix this, add null peer check before releasing the peer.
CRs-Fixed: 3184390
Change-Id: Ia895c8487082e0fac6e7df63d3694fa3e152b355
Currently in driver, NAN Data Interface can be created with
only name "aware_data" which creates dependency on interface name.
To remove the dependency, the interface is created now by name
provided by Wifi-HAL.
For this, interface is created in STA mode with name provided by
WiFi-HAl. While processing vendor cmd QCA_NL80211_VENDOR_SUBCMD_NDP,
given ifname is searched in adapter list and mode is changed to NDI.
CRs-Fixed: 3196179
Change-Id: I62dd512f8a7de4c69a53babf3112942d348bf3b6
Currently driver code has data type as char* for NAN related code.
With this change update this data type as const char*.
Also, move NAN related functions under WLAN_FEATURE_NAN feature flag.
Change-ID: I61ad10304be4399a68f32778d01d9a951d7d14bb
CRs-Fixed: 3169168
Currently host driver creates/deletes NDI interfaces using
vendor command. With the kernel 5.12 version onwards,
interface creation/deletion is not allowed using vendor
commands as it leads to deadlock when driver tries to acquire
the RTNL_LOCK at the time of netdev register/unregister.
With this change, add support to Create and delete NDI interface
using NL80211_CMD_NEW_INTERFACE and NL80211_CMD_DEL_INTERFACE
commands respectively if driver advertises
QCA_WLAN_VENDOR_FEATURE_USE_ADD_DEL_VIRTUAL_INTF_FOR_NDI capability.
Since NL80211_CMD_NEW_INTERFACE and NL80211_CMD_DEL_INTERFACE
already comes with the rtnl lock and driver does not need to
take the rtnl lock again which will help to avoid the above issue.
Change-Id: I6d5441a5e883de1222f105f26d73cb0506d16ddf
CRs-Fixed: 3167125
Current NAN is allowed on passive channels which is not
expected as passive channels does not allow initial
trnsmission.
To address above issue, do not allow NAN on passive
channels.
Change-Id: Ied7ba8eb38feb528209cafa6793aed93456989d6
CRs-Fixed: 3157369
Send service from wmi_ndp_indication_event_id to the userspace
via the new vendor attribute QCA_WLAN_VENDOR_ATTR_NDP_SERVICE_ID
as part of ndp indication.
Change-Id: I90b4540d5f3c72bbb7e8b542406561daf2a7a869
CRs-fixed: 3128874
Enabling ndi_max_support=2 is consuming 4 vdevs + 11 peers
in firmware when STA and NAN(+2 NDIs) are active. Max peers
allowed in firmware are 11 only and this ini configuration is
consuming all of them.
There is no provision/memory for new peer allocation even for
simple use cases like roaming(roaming needs a temporary peer).
Revert this change and set the ini ndi_max_support=2 in target
specific ini files if required to avoid the peer exhaust issue.
This reverts change: Id45147541dba057c2f3420adee43c7a56e3ee72b.
Change-Id: If655b63071b07e96b4e343b8e1bb65acd33be625
CRs-Fixed: 3120555
Check MLO STA + NAN + NDP concurrency support. Allow this
combination only If service cap and mlo sta presents.
Change-Id: I6fd0cae227eb8c4096444160b2450ad65dc51c30
CRs-Fixed: 3120645
NDP peer gets created as part of NDP indication in case of NDP
initiator. But NDP may fail to form due to various reasons and
firmware may send NDP confirm with reject status in such cases
instead of NDP indication event.
Below is the detailed scenario,
1. On initiator side, it has sent an NDP request and is waiting
for NDP response.
2. On responder side, application/framework is preparing to send
NDP response with reject due to some config mismatch. At the
same time, NDP termination is also issued. So NDP termination
frame is sent successfully.
3. Initiator firmware receives this NDP end and it sends an NDP
confirm with REJECT to the host and it shall clean-up the
session.
Currrently, there is a check for the peer existence while
indicating this NDP confirm status to framework. There is no need
of this check in such failure cases as peer is not yet created.
Change-Id: Ibe94a5b67df1ce3d65eaf2ef37b11b08155752c9
CRs-Fixed: 3086975
Currently, the ini param "ndi_max_support" is set to 1 in the
ini definition though DUT can support maximum 2 NDIs.
Customers need to set the ini param to 2 in ini file
in order to support two NDIs. This ini param value needs
to be maintained across chipsets and android versions,
which is difficult.
Change the default value to 2 to avoid these. If any customer
needs the value to be 1, the same can be set in customer/target
specific ini files.
Change-Id: Id45147541dba057c2f3420adee43c7a56e3ee72b
CRs-Fixed: 3097045
Currently for 6GHz, nan is allowed on LPI channels as well,
nan should be allowed only on VLP channels.
With this change allow nan only on VLP channels.
CRs-Fixed: 3072585
Change-Id: Ic8cd8a5ca5c096530762cc0f9d199cef30155838
Currently, NDP peer multicast address is derived from peer MAC address
and cached in the host. While removing the NDP peer, peer MAC address
is used to search the cached multicast address list. Because of this,
peer multicast address list is not getting freed.
To resolve this, derive peer multicast address from the peer MAC address
while clearing the cached multicast address list.
Since MAX NDP sessions are 8, allocate memory for peer multicast address
list during the NAN vdev private object allocation. This avoids the
special handling for peer multicast list in multiple error scenarios.
Change-Id: Ifbf890a4b9c8be54d84a5b57ed8f6c237ecd51ca
CRs-Fixed: 3085069
Currently, driver is depending on NS frame to be received to configure
peer multicast address for an NDP session. If there is a delay in NS
frame reception, peer multicast address list will be configured to the
FW without actual peer multicast address. Because of this, FW will drop
the NS frame from NDP peer.
To address this, derive peer multicast address from peer MAC address
and include it in multicast address list that is configured to the FW.
Change-Id: I92a575352d592b4001dc4f061e31eb7f592f8445
CRs-Fixed: 3066990
Update the concurrency policy for STA mode.
For an upcoming STA connection:
1. Disallow the 2nd STA connection if multiple STA connections are
not allowed.
2. Allow the secondary MLO link when primary link is connected.
3. Disallow ML STA when ML STA/SAP is present.
4. Disallow the 3rd STA.
5. Allow for the other cases.
Change-Id: I70c41177b7a3a9aa9cbac0aaced08c6eafca2b6d
CRs-Fixed: 3012577
Firmware might send NDP peer indication/NDP responder response
while NDI deletion is in progress. Currently, NDP peer entry
gets added though vdev is moved to DOWN state and cleanup is
in progress. This leads to stale peer entry on that NDI vdev
and doesn't allow vdev delete when IFF_DOWN comes, as a peer
is present.
Check the vdev state before creating peer for NDP and skip
peer creation if NDI vdev is not in UP state(which indicates
that the vdev down is happening).
Also, don't process the NDP confirm if NDP peer is not created.
Change-Id: I73e79cc33b1a294e3f4a4a6e2f371033862c5709
CRs-Fixed: 3061756
pdev is declared in nan_enable_req after a variable-size array.
Place the pdev declaration before the array to avoid corruption
while copying contents to the buffer.
Change-Id: I92766c40909bcecaed5f1eb6e2f015447f3c8221
CRs-Fixed: 3060146
Framework disables p2p before enabling NAN as P2P+NAN concurrency
is not supported. NAN operations happens through wifihal and p2p
operations happen through wpa_supplicant which are two different
userspace components. Wifihal call to enable NAN may come to host
driver before disabling p2p through wpa_supplicant. There are high
chances for p2p scan to be in running state while NAN enable is
received. Firmware NAN state machine goes to inconsistent state
and disables NAN as p2p scan is running in such cases.
So, stop the ongoing p2p scan before enabling NAN as P2P+NAN
concurrency is not supported currently.
Also, forward the pdev to NAN component inorder to iterate through
all P2P vdevs.
Change-Id: Ibe30a5ebe90514aee4f6721cdc5476570524cad8
CRs-Fixed: 3054576
Currently, host driver expects NDP_END indication from firmware
within 2 seconds after sending request to firmware. Driver shall
timeout and cleanup the corresponding NDP entry if no response is
received within 2 seconds. But firmware may take upto 2.5 seconds
to exhaust the NDP_END frame retries.
So, increase the timeout to 4 seconds to accommodate these retries
and to be inline with current NAN_DISABLE timeout.
Change-Id: Ida1abc25b4ff64aea810c88dbf36f9577b23ffd8
CRs-Fixed: 3002176
TWT is supported in STA/SAP vdevs and it's allowed only in
DBS/Standalone case and not in SCC/MCC. Disable SAP TWT if
1. Concurrency occurs in SAP + NAN/NDI vdev
2. SCC/MCC occurs after CSA
Change-Id: Id1400bd5555d2f48590d7d3ad7c70162d1dd92fb
CRs-Fixed: 2942959
Currently, osif_request_alloc is done and waiting for response
after posting the message NDP_END_REQ. But this may lead to
invalid memory access if message gets processed in scheduler
thread and response also comes before the request is allocated.
Allocate the request before sending message to avoid this.
Change-Id: I88b0a8be229e779526f0f3cf184b191e00872ee8
CRs-Fixed: 2782045
Currently there is no support to enable NAN on indoor channels,
as per the new requirement add an ini support to enable NAN on
indoor channels.
Change-Id: Ia3acbc133cab4865d8ad69992e893be91439f50f
CRs-Fixed: 2943668
Only send the VHT TX beamforming capability if firmware has set the
support bit. This helps ensure backward compatibility for older
products.
Change-Id: Ia5830c9f378e3f0ddc83c8019d5168a270ad6f69
CRs-fixed: 2933687
Currently single request context is used for NAN discovery and NDP.
If NAN disable request is sent to the FW and FW sends NDP end
indication and didn't send NAN disable indication. In this case,
wait event for NAN disable indication will be completed as part of
NDP end indication. This is because same request context is used for
both NAN discovery and NDP.
To resolve this, use separate request for NAN discovery and NDP.
Change-Id: Ic42e32c5cfd818188ca96d6cba3cbec1ed85a3ec
CRs-Fixed: 2921287
Store the NAN NDI beamform service bit in the NAN capability struct and
add API to access that value.
Change-Id: I429fc870b5287bd40855b9277d14b19574974a46
CRs-fixed: 2876730
Currently, there is no INI parameter to control NAN feature in 6GHz
frequency band. Because of this, there is no provision to disable the
NAN in 6GHz when there is no requirement.
To address this, add INI parameter to configure NAN feature in 6GHz.
Change-Id: I6b4faa8e8aa1a3df72539fed1d7ff3cc8287debd
CRs-Fixed: 2817920
Add new ini "monitor_mode_concurrency" to support this feature
and introduce policy manager api's for concurrency checks.
Change-Id: I35ee1fece0a6f9ae8fe340b0598c4a3e20b17e82
CRs-Fixed: 2814523
NDP connection will be active for keep alive period even after receiving
NDP end request. The default value for this keep alive period if 20ms.
update the default value as 14ms to reduce the wait time for connection
termination.
Change-Id: I3d09ce764846d7e535a7369d32a730907b621735
CRs-Fixed: 2802723
Set nan_feature_config default as 0 from 1 in INI to have DW interval for
NMNS mode when device goes to suspend mode.
Change-Id: Ib0044ca36cba570f51edcc0006f8e54c55d673d3
CRs-Fixed: 2776238
After sending disable request to FW, it needs some time to
communicate the frame to all NDP connected peers. Increase
the wait time from 1 second to 4 seconds.
Change-Id: Iae36fe007704600a9f29ac7b943ef22fba91b651
CRs-fixed: 2787069
qdf_mem_malloc() function already takes care of logging the
caller function name and line number in case of any allocation error.
Hence there is no need to add the error log again.
Getting rid of these unnecessary logs reduces driver memory footprint.
Change-Id: If0b9425f82f9ed793c7639c0ed09eb1f868b6d5c
CRs-Fixed: 2781932
NDPs can exist on an NDI only when the NAN discovery is active.
Currently, firmware sends NDP_END indication for all NDPs when NAN
is disabled. Host driver removes the NDI entry from the policy mgr
based on these NDP_END indications. But firmware might miss to send
the NDP_END indication in some cases though the NDPs are deleted
in firmware. This leads to stale NDI entries in the policy mgr and
it prevents STA connections as NDI+STA without NAN discovery is not
a valid concurrency.
Host driver can remove all NDPs before sending NAN disable request
to firmware to avoid this. This is a blocking call in driver and
wait for the NDP_HOST_UPDATE event from firmware. Cleanup the policy
mgr entries in timeout case as well to avoid further failures due
to unsupported concurrency.
Change-Id: I8df905b7ae4cfe5dfb5affe5b6a3fd478851a453
CRs-Fixed: 2774329
Check if NAN SRD operation is enabled in the ini
"etsi13_srd_chan_in_master_mode" and send the same to firmware
for all SRD channels.
Change-Id: I2aa8fd34c67b2061963b62a34d29c73740af3a76
CRs-Fixed: 2748455
Currently, host driver sends NAN disable request to firmware and
firmware sends NAN disable indication as a response. Host driver
forwards this indication to framework. But when SSR happens,
driver needs to send this NAN disable indication to framework
as firmware lost the NAN context. This allows framework to
initiate NAN again. Send the NAN disable indication with success
status code to framework after recovery.
Change-Id: Ic2139e159f0c1d9c1fb5c39597ce18e0787e809b
CRs-Fixed: 2735047
The NAN configs gEnableNanSupport and genable_nan_datapath
are being removed from ini config file. So, enable them by
default in .h file.
Change-Id: Ibc1e91e6d010994b5e1419b2241f846e0fde8969
CRs-Fixed: 2710133
Currently, policy mgr table entries correspond to NAN/NDI are
updated only if nan_dbs is supported. Update/access the
policy mgr table even when nan_conc_control is supported by host.
This allows the host to take care of NAN cuncurrencies through
policy mgr on the non-DBS platforms.
Process NAN enable request in host if nan_conc_control is
supported, which updates the NAN entry to policy mgr table.
Change-Id: Id6e58a9bfde6ceb66a8a0b33136880f75e36090f
CRs-Fixed: 2729995
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
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
NAN protocol runs in firmware and controlled by framework.
Framework configures multiple NAN discovery params while enabling
NAN. Framework configurations would be based on the framework
constraints or realtime scenarios like resource(memory/power/..)
consumption. But some of these params might need to be controlled
explicitly based on the usage.
NAN DW is one such parameter, which is configured as 4 seconds
when the device is in sync role and the screen is off. But
for some usecases, this param might have to be 512ms always
irrespective of screen off/on for some targets. Add an ini param
"nan_feature_config" to set a bit to indicate firmware whether to
honor framework configured DW value or the firmware default value.
Send the vdev param on NAN supported vdev by setting the "bit 0"
to indicate firmware to allow framework configured DW value.
If this bit is not set, firmware shall consider its default value.
Change-Id: I0476bca2bbe676beccfff207f5b4ea31e89031e2
CRs-Fixed: 2721970
Currently, driver sends NAN enable/disable request to firmware
and waits for the response. NAN state is cleaned up when NAN
disable indication is received. But if firmware doesn't respond to
NAN enable or disable request, a timeout happens and NAN state is
not cleaned up.
Cleanup the NAN state upon timeout for NAN enable/disable request.
Change-Id: Iadfff2b4d010407f04b529ff81b1ce1f11064695
CRs-Fixed: 2723094