qcacld-3.0: Disable NAN in stop_adapter
Framework might not disable NAN discovery explicitly in some cases like driver unload. So disable NAN from stop_adapter to terminate NDPs and NAN discovery properly. Cleanup the API os_if_process_nan_disable_req() by using the new API ucfg_disable_nan_discovery(). Change-Id: Ic2c834db44c42a44db902c93f67a887de1b6c2fb CRs-Fixed: 2594318
This commit is contained in:
@@ -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
|
||||
@@ -368,6 +368,21 @@ bool ucfg_nan_is_sta_ndp_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
* Return: True if NAN vdev creation is allowed else false
|
||||
*/
|
||||
bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_disable_nan_discovery() - Disable NAN discovery
|
||||
* @psoc: pointer to psoc object
|
||||
* @data: Data to be sent to NAN discovery engine, which runs in firmware
|
||||
* @data_len: Length of the data
|
||||
*
|
||||
* Send NAN disable request to firmware by setting the mandatory
|
||||
* params(disable_2g_discovery, disable_5g_discovery) along
|
||||
* with the data, if provided.
|
||||
*
|
||||
* Return: status of operation
|
||||
*/
|
||||
QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *data, uint32_t data_len);
|
||||
#else /* WLAN_FEATURE_NAN */
|
||||
|
||||
static inline
|
||||
@@ -425,5 +440,12 @@ bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline
|
||||
QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *data, uint32_t data_len)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* WLAN_FEATURE_NAN */
|
||||
#endif /* _NAN_UCFG_API_H_ */
|
||||
|
@@ -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
|
||||
@@ -1045,3 +1045,33 @@ bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc)
|
||||
|
||||
return psoc_nan_obj->nan_caps.nan_vdev_allowed;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t *data, uint32_t data_len)
|
||||
{
|
||||
struct nan_disable_req *nan_req;
|
||||
QDF_STATUS status;
|
||||
|
||||
nan_req = qdf_mem_malloc(sizeof(*nan_req) + data_len);
|
||||
if (!nan_req)
|
||||
return -ENOMEM;
|
||||
|
||||
nan_req->psoc = psoc;
|
||||
nan_req->disable_2g_discovery = true;
|
||||
nan_req->disable_5g_discovery = true;
|
||||
if (data_len && data) {
|
||||
nan_req->params.request_data_len = data_len;
|
||||
qdf_mem_copy(nan_req->params.request_data, data, data_len);
|
||||
}
|
||||
|
||||
nan_debug("sending NAN Disable Req");
|
||||
status = ucfg_nan_discovery_req(nan_req, NAN_DISABLE_REQ);
|
||||
|
||||
if (QDF_IS_STATUS_SUCCESS(status))
|
||||
nan_debug("Successfully sent NAN Disable request");
|
||||
else
|
||||
nan_err("Unable to send NAN Disable request: %u", status);
|
||||
|
||||
qdf_mem_free(nan_req);
|
||||
return status;
|
||||
}
|
||||
|
مرجع در شماره جدید
Block a user