|
@@ -108,18 +108,23 @@ void ucfg_nan_psoc_close(struct wlan_objmgr_psoc *psoc)
|
|
|
/* No cleanup required on psoc close for NAN */
|
|
|
}
|
|
|
|
|
|
-inline QDF_STATUS ucfg_nan_set_ndi_state(struct wlan_objmgr_vdev *vdev,
|
|
|
- uint32_t state)
|
|
|
+inline QDF_STATUS __ucfg_nan_set_ndi_state(struct wlan_objmgr_vdev *vdev,
|
|
|
+ enum nan_datapath_state state,
|
|
|
+ const char *func)
|
|
|
{
|
|
|
struct nan_vdev_priv_obj *priv_obj = nan_get_vdev_priv_obj(vdev);
|
|
|
+ enum nan_datapath_state current_state;
|
|
|
|
|
|
if (!priv_obj) {
|
|
|
nan_err("priv_obj is null");
|
|
|
return QDF_STATUS_E_NULL_VALUE;
|
|
|
}
|
|
|
qdf_spin_lock_bh(&priv_obj->lock);
|
|
|
+ current_state = priv_obj->state;
|
|
|
priv_obj->state = state;
|
|
|
qdf_spin_unlock_bh(&priv_obj->lock);
|
|
|
+ nan_nofl_debug("%s: ndi state: current: %u, new: %u", func,
|
|
|
+ current_state, state);
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
@@ -839,21 +844,18 @@ ucfg_nan_disable_ndi(struct wlan_objmgr_psoc *psoc, uint32_t ndi_vdev_id)
|
|
|
wlan_objmgr_vdev_release_ref(ndi_vdev, WLAN_NAN_ID);
|
|
|
return QDF_STATUS_E_INVAL;
|
|
|
}
|
|
|
+ curr_ndi_state = ucfg_nan_get_ndi_state(ndi_vdev);
|
|
|
|
|
|
- qdf_spin_lock_bh(&ndi_vdev_priv->lock);
|
|
|
- curr_ndi_state = ndi_vdev_priv->state;
|
|
|
/*
|
|
|
* Nothing to do if NDI is in DATA_END state.
|
|
|
* Continue cleanup in NAN_DATA_NDI_DELETING_STATE as this API
|
|
|
* can be called from hdd_ndi_delete.
|
|
|
*/
|
|
|
if (curr_ndi_state == NAN_DATA_END_STATE) {
|
|
|
- qdf_spin_unlock_bh(&ndi_vdev_priv->lock);
|
|
|
wlan_objmgr_vdev_release_ref(ndi_vdev, WLAN_NAN_ID);
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
- ndi_vdev_priv->state = NAN_DATA_END_STATE;
|
|
|
- qdf_spin_unlock_bh(&ndi_vdev_priv->lock);
|
|
|
+ ucfg_nan_set_ndi_state(ndi_vdev, NAN_DATA_END_STATE);
|
|
|
|
|
|
request = osif_request_alloc(¶ms);
|
|
|
if (!request) {
|
|
@@ -896,12 +898,10 @@ ucfg_nan_disable_ndi(struct wlan_objmgr_psoc *psoc, uint32_t ndi_vdev_id)
|
|
|
|
|
|
cleanup:
|
|
|
/* Restore original NDI state in case of failure */
|
|
|
- qdf_spin_lock_bh(&ndi_vdev_priv->lock);
|
|
|
if (QDF_IS_STATUS_SUCCESS(status))
|
|
|
- ndi_vdev_priv->state = NAN_DATA_DISCONNECTED_STATE;
|
|
|
+ ucfg_nan_set_ndi_state(ndi_vdev, NAN_DATA_DISCONNECTED_STATE);
|
|
|
else
|
|
|
- ndi_vdev_priv->state = curr_ndi_state;
|
|
|
- qdf_spin_unlock_bh(&ndi_vdev_priv->lock);
|
|
|
+ ucfg_nan_set_ndi_state(ndi_vdev, curr_ndi_state);
|
|
|
|
|
|
if (request)
|
|
|
osif_request_put(request);
|