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
This commit is contained in:

committed by
nshrivas

parent
c04d699a6d
commit
b24bdd3f73
@@ -340,6 +340,13 @@ ucfg_nan_check_and_disable_unsupported_ndi(struct wlan_objmgr_psoc *psoc,
|
||||
*/
|
||||
QDF_STATUS ucfg_ndi_remove_entry_from_policy_mgr(struct wlan_objmgr_vdev *vdev);
|
||||
|
||||
/**
|
||||
* ucfg_nan_is_enable_disable_in_progress() - Is NAN enable/disable in progress
|
||||
* @psoc: Pointer to PSOC object
|
||||
*
|
||||
* Return: True if NAN discovery enable/disable is in progress, false otherwise
|
||||
*/
|
||||
bool ucfg_nan_is_enable_disable_in_progress(struct wlan_objmgr_psoc *psoc);
|
||||
#else /* WLAN_FEATURE_NAN */
|
||||
|
||||
static inline
|
||||
@@ -379,5 +386,11 @@ enum nan_datapath_state ucfg_nan_get_ndi_state(struct wlan_objmgr_vdev *vdev)
|
||||
return NAN_DATA_INVALID_STATE;
|
||||
}
|
||||
|
||||
static inline
|
||||
bool ucfg_nan_is_enable_disable_in_progress(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif /* WLAN_FEATURE_NAN */
|
||||
#endif /* _NAN_UCFG_API_H_ */
|
||||
|
@@ -951,3 +951,18 @@ QDF_STATUS ucfg_ndi_remove_entry_from_policy_mgr(struct wlan_objmgr_vdev *vdev)
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool ucfg_nan_is_enable_disable_in_progress(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
enum nan_disc_state nan_state;
|
||||
|
||||
nan_state = nan_get_discovery_state(psoc);
|
||||
if (nan_state == NAN_DISC_ENABLE_IN_PROGRESS ||
|
||||
nan_state == NAN_DISC_DISABLE_IN_PROGRESS) {
|
||||
nan_info("NAN enable/disable is in progress, state: %u",
|
||||
nan_state);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user