When DFS CAC is going on for SAP, if 5 GHz mac is occupied by the
SAP and it's not available for 5 GHz NAN discovery. Enabling NAN
on 5 GHz in such cases cause inconsistency in firmware state machine
and firmware may assert as DFS MAC is not supposed to be disturbed
while CAC is going on.
So, check if NAN enable request has 5 GHz NAN channel also and reject
the request. Allow NAN enable command if it's 2 GHz only NAN enable
request, while CAC is going on.
Change-Id: If3f2b2b40cc2b70bc7a872970bc088204440d519
CRs-Fixed: 3458462
eMLSR + NAN concurrency is not supported currently, so handle it
as mentioned below
1. eMLSR+NAN: If NAN is coming up when eMLSR is active, disable
one ML link so that eMLSR gets disabled.
2. NAN+eMLSR: If eMLSR is coming up when NAN is already enabled,
disable one link so that eMLSR doesn't get enabled.
Also, cleanup the APIs to carry a generic flag to indicate that
a concurrent connection is coming up instead of mode specific flag
as there is no dependency on modes to handle concurrency.
Change-Id: I625f8b18f9d7e991922d22af53f3e8743a3727bd
CRs-Fixed: 3443900
TWT concurrency update is called before ndp connection is added to
policy_mgr count. TWT concurrency_handler reads incorrect count which
causes wrong mode to be checked. Fix is to call TWT concurrency
update after NDP entry is made in the policy manager.
Change-Id: I7f259885f7402ab018ff7c7cd020bb3f9298dba1
CRs-Fixed: 3454000
Currently, driver finds PASN peer from BSSID in mgmt auth frame
and with help of this peer, it extracts the vdev_id. It uses this
vdev_id to retrieve the adapter in hdd.
But for NAN iface, there is no PASN peer and driver drops the
auth mgmt frame as no valid vdev_id available.
The NAN Cluster ID is a MAC address that takes a value from
50-6F-9A-01-00-00 to 50-6F-9A-01-FF-FF and is carried in the A3
field of some of the NAN frames.
So, to fix this, compare the first four bytes BSSID with
"50-6F-9A-01" and extract the vdev from vdev_list for NAN opmode.
Change-Id: Ie4f15549e3bd8378e362538da4d7ec49e84ad138
CRs-Fixed: 3382962
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 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
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 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 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
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
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
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
Introduce INI "ndi_max_support" to configure max number of ndi
interfaces host supports. Host configures max number of ndi
interfaces support in firmware using WMI_INIT_CMD.
Change-Id: I287b9f96b98103e67cf35d0c02488a28af731044
CRs-Fixed: 2701557
Add connect id in the policy manager for the newly designed
connection manager infrastructure.
Change-Id: Ib7bd08e5326ead04da88175636777bf5dd4e255b
CRs-FIxed: 2705700
Introduce INI "ndp_max_sessions" to configure max number of ndp
sessions host supports. Firmware advertises max number of ndp
sessions supported in wmi_service_ready_ext2 event. If the firmware
advertises non-zero value of max ndp sessions then host configures
max ndp sessions support in firmware using WMI_INIT_CMD.
Host uses a minimum of "ndp_max_sessions" value and firmware
advertised max ndp session value to configure max number of ndp
sessions in firmware.
Change-Id: I613815f384f9b0a61711324c85ecfa095d133360
CRs-Fixed: 2673120
Update return type of nan_discovery_flush_callback to return
QDF_STATUS to match scheduler_msg_process_fn_t.
Change-Id: I3a2c32beaff471ed3a2e8e3956292257e074cd50
CRs-fixed: 2698305
Currently, host allows maximum MAX_NDP_INSTANCES_PER_PEER(2) NDPs
per peer. Framework may need more NDPs with the same peer when
multiple NDP applications are running. Firmware shall allow/reject
an NDP based on the max number of NDP connections allowed per peer.
It's platform specific and firmware shall take care of it.
Remove the check in host which limits this.
Change-Id: Ic43f6e2588a8ed8ffd7c8bb87d9b5656352e5cf7
CRs-Fixed: 2684987
Currently NDP_END_ALL request is posted to serialization queue but
not removed even after getting response from firmware. The timer
expires after 4 seconds and the message is gets dequeued as part
of timer handler. Dequeue the request from queue after getting
NDP_HOST_UPDATE from firmware to avoid blocking the northbound
APIs for this 4 seconds.
Change-Id: Ie8045f2460f7ac27732d4070ed79e5a61aab0bd2
CRs-Fixed: 2662869
To allow multiple instances of NDP on single peer, limit of max ndp
instances per peer set to 2.
Thus termination of first NDP instance will not affect second NDP
connection.
Change-Id: I421b185bd344688630dbe02e97f0b047d8823abe
CRs-Fixed: 2654713