qcacld-3.0: cleanup NAN state upon NAN enable/disable timeout

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
This commit is contained in:
Srinivas Dasari
2020-07-01 19:41:34 +05:30
committed by nshrivas
parent 834ea0b828
commit 2586d8f598
5 changed files with 48 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -200,6 +200,13 @@ uint32_t wlan_nan_get_disc_5g_ch_freq(struct wlan_objmgr_psoc *psoc);
*/
bool wlan_nan_get_sap_conc_support(struct wlan_objmgr_psoc *psoc);
/**
* nan_disable_cleanup: Cleanup NAN state upon NAN disable
* @psoc: pointer to psoc object
*
* Return: Cleanup NAN state upon NAN disable
*/
QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc);
#else /* WLAN_FEATURE_NAN */
static inline QDF_STATUS nan_init(void)
{
@@ -239,5 +246,11 @@ bool wlan_nan_get_sap_conc_support(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline
QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc)
{
return QDF_STATUS_E_FAILURE;
}
#endif /* WLAN_FEATURE_NAN */
#endif /* _WLAN_NAN_API_H_ */

View File

@@ -888,14 +888,17 @@ done:
return QDF_STATUS_SUCCESS;
}
static QDF_STATUS nan_handle_disable_ind(struct nan_event_params *nan_event)
QDF_STATUS nan_disable_cleanup(struct wlan_objmgr_psoc *psoc)
{
struct nan_psoc_priv_obj *psoc_nan_obj;
struct wlan_objmgr_psoc *psoc;
QDF_STATUS status;
uint8_t vdev_id;
psoc = nan_event->psoc;
if (!psoc) {
nan_err("psoc is NULL");
return QDF_STATUS_E_NULL_VALUE;
}
psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
if (!psoc_nan_obj) {
nan_err("psoc_nan_obj is NULL");
@@ -925,6 +928,11 @@ static QDF_STATUS nan_handle_disable_ind(struct nan_event_params *nan_event)
return status;
}
static QDF_STATUS nan_handle_disable_ind(struct nan_event_params *nan_event)
{
return nan_disable_cleanup(nan_event->psoc);
}
static QDF_STATUS nan_handle_schedule_update(
struct nan_datapath_sch_update_event *ind)
{

View File

@@ -505,5 +505,11 @@ ucfg_nan_disable_ndi(struct wlan_objmgr_psoc *psoc, uint32_t ndi_vdev_id)
{
return QDF_STATUS_E_INVAL;
}
static inline
bool ucfg_is_nan_disable_supported(struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif /* WLAN_FEATURE_NAN */
#endif /* _NAN_UCFG_API_H_ */

View File

@@ -758,13 +758,21 @@ post_msg:
if (req_type != NAN_GENERIC_REQ) {
err = osif_request_wait_for_response(request);
if (err)
if (err) {
nan_debug("NAN request: %u timed out: %d",
req_type, err);
if (req_type == NAN_ENABLE_REQ) {
nan_set_discovery_state(psoc,
NAN_DISC_DISABLED);
policy_mgr_check_n_start_opportunistic_timer(
psoc);
} else if (req_type == NAN_DISABLE_REQ) {
nan_disable_cleanup(psoc);
}
}
if (req_type == NAN_DISABLE_REQ)
psoc_priv->is_explicit_disable = false;
osif_request_put(request);
}