qcacld-3.0: Handle concurrencies with NAN Discovery
Use policy manager to set and update the NAN Discovery related connection info. Disable NAN Discovery explicitly for unsupported concurrencies. Handle concurrencies with NAN Discovery interface. Change-Id: I8c9450b034983ef0402fdc878d8b525bedac9f0b CRs-Fixed: 2358180
This commit is contained in:
parent
80734c0a31
commit
089b98361e
@ -690,6 +690,8 @@ struct nan_datapath_sch_update_event {
|
||||
* struct nan_callbacks - struct containing callback to non-converged driver
|
||||
* @os_if_nan_event_handler: OS IF Callback for handling NAN Discovery events
|
||||
* @os_if_ndp_event_handler: OS IF Callback for handling NAN Datapath events
|
||||
* @ucfg_explicit_disable_cb: UCFG Callback to indicate NAN explicit disable is
|
||||
* complete
|
||||
* @ndi_open: HDD callback for creating the NAN Datapath Interface
|
||||
* @ndi_start: HDD callback for starting the NAN Datapath Interface
|
||||
* @ndi_close: HDD callback for closing the NAN Datapath Interface
|
||||
@ -709,6 +711,7 @@ struct nan_callbacks {
|
||||
void (*os_if_ndp_event_handler)(struct wlan_objmgr_psoc *psoc,
|
||||
struct wlan_objmgr_vdev *vdev,
|
||||
uint32_t type, void *msg);
|
||||
void (*ucfg_explicit_disable_cb)(void *cookie);
|
||||
int (*ndi_open)(char *iface_name);
|
||||
int (*ndi_start)(char *iface_name, uint16_t);
|
||||
void (*ndi_close)(uint8_t);
|
||||
|
@ -25,12 +25,16 @@
|
||||
#include "wlan_nan_api.h"
|
||||
#include "target_if_nan.h"
|
||||
#include "scheduler_api.h"
|
||||
#include "wlan_policy_mgr_api.h"
|
||||
#include "wlan_osif_request_manager.h"
|
||||
#include "wlan_serialization_api.h"
|
||||
#include "wlan_objmgr_cmn.h"
|
||||
#include "wlan_tdls_ucfg_api.h"
|
||||
#include "wlan_objmgr_global_obj.h"
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "qdf_platform.h"
|
||||
|
||||
QDF_STATUS nan_set_discovery_state(struct wlan_objmgr_psoc *psoc,
|
||||
enum nan_disc_state new_state)
|
||||
@ -485,26 +489,82 @@ static QDF_STATUS nan_handle_end_ind(
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static QDF_STATUS nan_handle_enable_rsp(struct nan_event_params *evt_params)
|
||||
static QDF_STATUS nan_handle_enable_rsp(struct nan_event_params *nan_event)
|
||||
{
|
||||
struct nan_psoc_priv_obj *psoc_nan_obj;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
|
||||
psoc = evt_params->psoc;
|
||||
psoc = nan_event->psoc;
|
||||
psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
|
||||
if (!psoc_nan_obj) {
|
||||
nan_err("psoc_nan_obj is NULL");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (evt_params->is_nan_enable_success)
|
||||
nan_set_discovery_state(evt_params->psoc, NAN_DISC_ENABLED);
|
||||
else
|
||||
nan_set_discovery_state(evt_params->psoc, NAN_DISC_DISABLED);
|
||||
if (nan_event->is_nan_enable_success) {
|
||||
status = nan_set_discovery_state(nan_event->psoc,
|
||||
NAN_DISC_ENABLED);
|
||||
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
psoc_nan_obj->nan_disc_mac_id = nan_event->mac_id;
|
||||
policy_mgr_update_nan_vdev_mac_info(nan_event->psoc,
|
||||
NAN_PSEUDO_VDEV_ID,
|
||||
nan_event->mac_id);
|
||||
|
||||
policy_mgr_incr_active_session(psoc, QDF_NAN_DISC_MODE,
|
||||
NAN_PSEUDO_VDEV_ID);
|
||||
|
||||
} else {
|
||||
/*
|
||||
* State set to DISABLED OR DISABLE_IN_PROGRESS, try to
|
||||
* restore the single MAC mode.
|
||||
*/
|
||||
psoc_nan_obj->nan_social_channel = 0;
|
||||
policy_mgr_check_n_start_opportunistic_timer(psoc);
|
||||
}
|
||||
} else {
|
||||
/* NAN Enable has failed, restore changes */
|
||||
psoc_nan_obj->nan_social_channel = 0;
|
||||
nan_set_discovery_state(nan_event->psoc, NAN_DISC_DISABLED);
|
||||
policy_mgr_check_n_start_opportunistic_timer(psoc);
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static QDF_STATUS nan_handle_disable_ind(struct nan_event_params *nan_event)
|
||||
{
|
||||
struct nan_psoc_priv_obj *psoc_nan_obj;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
QDF_STATUS status;
|
||||
|
||||
psoc = nan_event->psoc;
|
||||
psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
|
||||
if (!psoc_nan_obj) {
|
||||
nan_err("psoc_nan_obj is NULL");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
status = nan_set_discovery_state(nan_event->psoc,
|
||||
NAN_DISC_DISABLED);
|
||||
if (QDF_IS_STATUS_SUCCESS(status)) {
|
||||
policy_mgr_decr_session_set_pcl(psoc, QDF_NAN_DISC_MODE,
|
||||
NAN_PSEUDO_VDEV_ID);
|
||||
|
||||
if (psoc_nan_obj->is_explicit_disable &&
|
||||
psoc_nan_obj->cb_obj.ucfg_explicit_disable_cb)
|
||||
psoc_nan_obj->cb_obj.ucfg_explicit_disable_cb(
|
||||
psoc_nan_obj->disable_context);
|
||||
} else {
|
||||
/* Should not happen, NAN state can always be disabled */
|
||||
nan_err("Cannot set NAN state to disabled!");
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static QDF_STATUS nan_handle_schedule_update(
|
||||
struct nan_datapath_sch_update_event *ind)
|
||||
{
|
||||
@ -556,8 +616,7 @@ QDF_STATUS nan_discovery_event_handler(struct scheduler_msg *msg)
|
||||
nan_handle_enable_rsp(nan_event);
|
||||
break;
|
||||
case nan_event_id_disable_ind:
|
||||
nan_set_discovery_state(nan_event->psoc,
|
||||
NAN_DISC_DISABLED);
|
||||
nan_handle_disable_ind(nan_event);
|
||||
break;
|
||||
case nan_event_id_generic_rsp:
|
||||
case nan_event_id_error_rsp:
|
||||
@ -626,10 +685,82 @@ QDF_STATUS nan_datapath_event_handler(struct scheduler_msg *pe_msg)
|
||||
return status;
|
||||
}
|
||||
|
||||
bool nan_is_enable_allowed(struct wlan_objmgr_psoc *psoc, uint8_t nan_chan)
|
||||
{
|
||||
if (!psoc) {
|
||||
nan_err("psoc object object is NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
return (NAN_DISC_DISABLED == nan_get_discovery_state(psoc) &&
|
||||
policy_mgr_allow_concurrency(psoc, PM_NAN_DISC_MODE, nan_chan,
|
||||
HW_MODE_20_MHZ));
|
||||
}
|
||||
|
||||
QDF_STATUS nan_discovery_pre_enable(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t nan_social_channel)
|
||||
{
|
||||
return nan_set_discovery_state(psoc, NAN_DISC_ENABLE_IN_PROGRESS);
|
||||
QDF_STATUS status = QDF_STATUS_E_INVAL;
|
||||
struct wlan_objmgr_pdev *pdev = NULL;
|
||||
struct wlan_objmgr_vdev *vdev = NULL;
|
||||
uint8_t vdev_id;
|
||||
|
||||
status = nan_set_discovery_state(psoc, NAN_DISC_ENABLE_IN_PROGRESS);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
nan_err("Unable to set NAN Disc State to ENABLE_IN_PROGRESS");
|
||||
goto pre_enable_failure;
|
||||
}
|
||||
|
||||
policy_mgr_stop_opportunistic_timer(psoc);
|
||||
|
||||
if (policy_mgr_is_hw_mode_change_in_progress(psoc)) {
|
||||
status = policy_mgr_wait_for_connection_update(psoc);
|
||||
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
||||
nan_err("Failed to wait for connection update");
|
||||
goto pre_enable_failure;
|
||||
}
|
||||
}
|
||||
|
||||
pdev = wlan_objmgr_get_pdev_by_id(psoc, 0, WLAN_NAN_ID);
|
||||
if (!pdev) {
|
||||
nan_err("null pdev");
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto pre_enable_failure;
|
||||
}
|
||||
|
||||
/* Piggyback on any available vdev for policy manager update */
|
||||
vdev = wlan_objmgr_pdev_get_first_vdev(pdev, WLAN_NAN_ID);
|
||||
if (!vdev) {
|
||||
nan_err("No vdev is up yet, unable to proceed!");
|
||||
status = QDF_STATUS_E_INVAL;
|
||||
goto pre_enable_failure;
|
||||
}
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
|
||||
status = policy_mgr_update_and_wait_for_connection_update(psoc, vdev_id,
|
||||
nan_social_channel,
|
||||
POLICY_MGR_UPDATE_REASON_NAN_DISCOVERY);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
nan_err("Failed to set or wait for HW mode change");
|
||||
goto pre_enable_failure;
|
||||
}
|
||||
|
||||
/* Try to teardown TDLS links, but do not wait */
|
||||
status = ucfg_tdls_teardown_links(vdev);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
nan_err("Failed to teardown TDLS links");
|
||||
|
||||
pre_enable_failure:
|
||||
if (vdev)
|
||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_NAN_ID);
|
||||
if (pdev)
|
||||
wlan_objmgr_pdev_release_ref(pdev, WLAN_NAN_ID);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
nan_set_discovery_state(psoc, NAN_DISC_DISABLED);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
static QDF_STATUS nan_discovery_disable_req(struct nan_disable_req *req)
|
||||
@ -666,12 +797,15 @@ static QDF_STATUS nan_discovery_enable_req(struct nan_enable_req *req)
|
||||
struct wlan_nan_tx_ops *tx_ops;
|
||||
|
||||
/*
|
||||
* State was already set to Disable in progress by a
|
||||
* disable request, drop the Enable request and move
|
||||
* back to Disabled state.
|
||||
* State was already set to Disable in progress by a disable request,
|
||||
* drop the Enable request, start opportunistic timer and move back to
|
||||
* the Disabled state.
|
||||
*/
|
||||
if (NAN_DISC_DISABLE_IN_PROGRESS == nan_get_discovery_state(req->psoc))
|
||||
if (NAN_DISC_DISABLE_IN_PROGRESS ==
|
||||
nan_get_discovery_state(req->psoc)) {
|
||||
policy_mgr_check_n_start_opportunistic_timer(req->psoc);
|
||||
return nan_set_discovery_state(req->psoc, NAN_DISC_DISABLED);
|
||||
}
|
||||
|
||||
psoc_nan_obj = nan_get_psoc_priv_obj(req->psoc);
|
||||
if (!psoc_nan_obj) {
|
||||
@ -679,6 +813,11 @@ static QDF_STATUS nan_discovery_enable_req(struct nan_enable_req *req)
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (req->social_chan_2g)
|
||||
psoc_nan_obj->nan_social_channel = req->social_chan_2g;
|
||||
else
|
||||
psoc_nan_obj->nan_social_channel = req->social_chan_5g;
|
||||
|
||||
tx_ops = &psoc_nan_obj->tx_ops;
|
||||
if (!tx_ops->nan_discovery_req_tx) {
|
||||
nan_err("NAN Discovery tx op is NULL");
|
||||
@ -770,5 +909,28 @@ QDF_STATUS
|
||||
wlan_nan_get_connection_info(struct wlan_objmgr_psoc *psoc,
|
||||
struct policy_mgr_vdev_entry_info *conn_info)
|
||||
{
|
||||
struct nan_psoc_priv_obj *psoc_nan_obj;
|
||||
|
||||
if (!psoc) {
|
||||
nan_err("psoc obj is NULL");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
if (nan_get_discovery_state(psoc) != NAN_DISC_ENABLED) {
|
||||
nan_err("NAN State needs to be Enabled");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
|
||||
if (!psoc_nan_obj) {
|
||||
nan_err("psoc_nan_obj is null");
|
||||
return QDF_STATUS_E_NULL_VALUE;
|
||||
}
|
||||
|
||||
conn_info->mhz = wlan_chan_to_freq(psoc_nan_obj->nan_social_channel);
|
||||
conn_info->mac_id = psoc_nan_obj->nan_disc_mac_id;
|
||||
conn_info->chan_width = CH_WIDTH_20MHZ;
|
||||
conn_info->type = WMI_VDEV_TYPE_NAN;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -103,6 +103,11 @@ struct nan_cfg_params {
|
||||
* @tx_ops: Tx ops registered with Target IF interface
|
||||
* @rx_ops: Rx ops registered with Target IF interface
|
||||
* @disc_state: Present NAN Discovery state
|
||||
* @nan_social_channel: NAN Social channel for discovery
|
||||
* @nan_disc_mac_id: MAC id used for NAN Discovery
|
||||
* @is_explicit_disable: Flag to indicate that NAN is being explicitly
|
||||
* disabled by driver
|
||||
* @disable_context: Explicit disable context
|
||||
*/
|
||||
struct nan_psoc_priv_obj {
|
||||
qdf_spinlock_t lock;
|
||||
@ -112,6 +117,10 @@ struct nan_psoc_priv_obj {
|
||||
struct wlan_nan_tx_ops tx_ops;
|
||||
struct wlan_nan_rx_ops rx_ops;
|
||||
enum nan_disc_state disc_state;
|
||||
uint8_t nan_social_channel;
|
||||
uint8_t nan_disc_mac_id;
|
||||
bool is_explicit_disable;
|
||||
void *disable_context;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -216,5 +225,26 @@ QDF_STATUS nan_discovery_pre_enable(struct wlan_objmgr_psoc *psoc,
|
||||
*/
|
||||
enum nan_disc_state nan_get_discovery_state(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/*
|
||||
* nan_is_enable_allowed: Queries whether NAN Discovery is allowed
|
||||
* @psoc: PSOC object
|
||||
* @nan_chan: Possible primary social channel for NAN Discovery
|
||||
*
|
||||
* Return: True if NAN Enable is allowed on given channel, False otherwise
|
||||
*/
|
||||
bool nan_is_enable_allowed(struct wlan_objmgr_psoc *psoc, uint8_t nan_chan);
|
||||
|
||||
/*
|
||||
* nan_get_connection_info: Gets connection info of the NAN Discovery interface
|
||||
* @psoc: PSOC object
|
||||
* @chan: NAN Social channel to be returned
|
||||
* @mac_if: MAC ID associated with NAN Discovery
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
nan_get_connection_info(struct wlan_objmgr_psoc *psoc, uint8_t *chan,
|
||||
uint8_t *mac_id);
|
||||
|
||||
#endif /* _WLAN_NAN_MAIN_I_H_ */
|
||||
#endif /* WLAN_FEATURE_NAN_CONVERGENCE */
|
||||
|
@ -234,6 +234,16 @@ QDF_STATUS ucfg_nan_get_callbacks(struct wlan_objmgr_psoc *psoc,
|
||||
*/
|
||||
QDF_STATUS ucfg_nan_discovery_req(void *in_req, uint32_t req_type);
|
||||
|
||||
/**
|
||||
* ucfg_is_nan_disable_supported() - ucfg API to query NAN Disable support
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* This function returns NAN Disable support status
|
||||
*
|
||||
* Return: True if NAN Disable is supported, False otherwise
|
||||
*/
|
||||
bool ucfg_is_nan_disable_supported(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
/**
|
||||
* ucfg_is_nan_dbs_supported() - ucfg API to query NAN DBS support
|
||||
* @psoc: pointer to psoc object
|
||||
@ -248,13 +258,12 @@ bool ucfg_is_nan_dbs_supported(struct wlan_objmgr_psoc *psoc);
|
||||
* ucfg_is_nan_enable_allowed() - ucfg API to query if NAN Discovery is
|
||||
* allowed
|
||||
* @psoc: pointer to psoc object
|
||||
* @nan_chan: NAN Discovery primary social channel
|
||||
*
|
||||
* Return: True if NAN Discovery enable is allowed, False otherwise
|
||||
*/
|
||||
static inline bool ucfg_is_nan_enable_allowed(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool ucfg_is_nan_enable_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t nan_chan);
|
||||
|
||||
/**
|
||||
* ucfg_nan_set_tgt_caps: ucfg API to set the NAN capabilities of the Target
|
||||
@ -266,6 +275,14 @@ static inline bool ucfg_is_nan_enable_allowed(struct wlan_objmgr_psoc *psoc)
|
||||
void ucfg_nan_set_tgt_caps(struct wlan_objmgr_psoc *psoc,
|
||||
struct nan_tgt_caps *nan_caps);
|
||||
|
||||
/**
|
||||
* ucfg_nan_disable_concurrency: ucfg API to explicitly disable NAN Discovery
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: None
|
||||
*/
|
||||
void ucfg_nan_disable_concurrency(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
#else /* WLAN_FEATURE_NAN */
|
||||
|
||||
static inline
|
||||
@ -273,5 +290,9 @@ void ucfg_nan_set_tgt_caps(struct wlan_objmgr_psoc *psoc,
|
||||
struct nan_tgt_caps *nan_caps)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void ucfg_nan_disable_concurrency(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
}
|
||||
#endif /* WLAN_FEATURE_NAN */
|
||||
#endif /* _NAN_UCFG_API_H_ */
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "wlan_osif_request_manager.h"
|
||||
|
||||
struct wlan_objmgr_psoc;
|
||||
struct wlan_objmgr_vdev;
|
||||
@ -397,6 +398,20 @@ void ucfg_nan_datapath_event_handler(struct wlan_objmgr_psoc *psoc,
|
||||
psoc_obj->cb_obj.os_if_ndp_event_handler(psoc, vdev, type, msg);
|
||||
}
|
||||
|
||||
static void ucfg_concurrency_nan_disable_callback(void *cookie)
|
||||
{
|
||||
struct osif_request *request;
|
||||
|
||||
request = osif_request_get(cookie);
|
||||
|
||||
if (request) {
|
||||
osif_request_complete(request);
|
||||
osif_request_put(request);
|
||||
} else {
|
||||
nan_err("Obsolete request (cookie:0x%pK), do nothing", cookie);
|
||||
}
|
||||
}
|
||||
|
||||
int ucfg_nan_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
|
||||
struct nan_callbacks *cb_obj)
|
||||
{
|
||||
@ -423,6 +438,8 @@ int ucfg_nan_register_hdd_callbacks(struct wlan_objmgr_psoc *psoc,
|
||||
cb_obj->os_if_ndp_event_handler;
|
||||
psoc_obj->cb_obj.os_if_nan_event_handler =
|
||||
cb_obj->os_if_nan_event_handler;
|
||||
psoc_obj->cb_obj.ucfg_explicit_disable_cb =
|
||||
ucfg_concurrency_nan_disable_callback;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -457,6 +474,19 @@ void ucfg_nan_set_tgt_caps(struct wlan_objmgr_psoc *psoc,
|
||||
psoc_priv->nan_caps = *nan_caps;
|
||||
}
|
||||
|
||||
bool ucfg_is_nan_disable_supported(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct nan_psoc_priv_obj *psoc_priv;
|
||||
|
||||
psoc_priv = nan_get_psoc_priv_obj(psoc);
|
||||
if (!psoc_priv) {
|
||||
nan_err("nan psoc priv object is NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
return (psoc_priv->nan_caps.nan_disable_supported == 1);
|
||||
}
|
||||
|
||||
bool ucfg_is_nan_dbs_supported(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct nan_psoc_priv_obj *psoc_priv;
|
||||
@ -470,6 +500,11 @@ bool ucfg_is_nan_dbs_supported(struct wlan_objmgr_psoc *psoc)
|
||||
return (psoc_priv->nan_caps.nan_dbs_supported == 1);
|
||||
}
|
||||
|
||||
bool ucfg_is_nan_enable_allowed(struct wlan_objmgr_psoc *psoc, uint8_t nan_chan)
|
||||
{
|
||||
return nan_is_enable_allowed(psoc, nan_chan);
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_nan_discovery_req(void *in_req, uint32_t req_type)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
@ -574,3 +609,72 @@ QDF_STATUS ucfg_nan_discovery_req(void *in_req, uint32_t req_type)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void ucfg_nan_disable_concurrency(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct nan_disable_req nan_req = {0};
|
||||
enum nan_disc_state curr_nan_state;
|
||||
struct nan_psoc_priv_obj *psoc_priv;
|
||||
struct osif_request *request;
|
||||
static const struct osif_request_params params = {
|
||||
.priv_size = 0,
|
||||
.timeout_ms = 1000,
|
||||
};
|
||||
QDF_STATUS status;
|
||||
int err;
|
||||
|
||||
if (!psoc) {
|
||||
nan_err("psoc object is NULL, no action will be taken");
|
||||
return;
|
||||
}
|
||||
|
||||
psoc_priv = nan_get_psoc_priv_obj(psoc);
|
||||
if (!psoc_priv) {
|
||||
nan_err("nan psoc priv object is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ucfg_is_nan_disable_supported(psoc))
|
||||
return;
|
||||
|
||||
qdf_spin_lock_bh(&psoc_priv->lock);
|
||||
curr_nan_state = nan_get_discovery_state(psoc);
|
||||
|
||||
if (curr_nan_state == NAN_DISC_DISABLED ||
|
||||
curr_nan_state == NAN_DISC_DISABLE_IN_PROGRESS) {
|
||||
qdf_spin_unlock_bh(&psoc_priv->lock);
|
||||
return;
|
||||
}
|
||||
qdf_spin_unlock_bh(&psoc_priv->lock);
|
||||
|
||||
request = osif_request_alloc(¶ms);
|
||||
if (!request) {
|
||||
nan_err("Request allocation failure");
|
||||
return;
|
||||
}
|
||||
|
||||
nan_req.psoc = psoc;
|
||||
nan_req.disable_2g_discovery = true;
|
||||
nan_req.disable_5g_discovery = true;
|
||||
|
||||
status = ucfg_nan_discovery_req(&nan_req, NAN_DISABLE_REQ);
|
||||
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
nan_err("Unable to disable NAN Discovery");
|
||||
osif_request_put(request);
|
||||
return;
|
||||
}
|
||||
|
||||
psoc_priv->disable_context = osif_request_cookie(request);
|
||||
psoc_priv->is_explicit_disable = true;
|
||||
nan_debug("Successfully sent NAN Disable request");
|
||||
|
||||
err = osif_request_wait_for_response(request);
|
||||
if (err)
|
||||
nan_err("NAN Disable timed out waiting for disable ind-%d",
|
||||
err);
|
||||
else
|
||||
nan_debug("NAN Disabled successfully");
|
||||
psoc_priv->is_explicit_disable = false;
|
||||
osif_request_put(request);
|
||||
}
|
||||
|
@ -131,6 +131,7 @@
|
||||
#include "wlan_crypto_global_def.h"
|
||||
#include "cdp_txrx_cfg.h"
|
||||
#include "wlan_hdd_object_manager.h"
|
||||
#include "nan_ucfg_api.h"
|
||||
|
||||
#define g_mode_rates_size (12)
|
||||
#define a_mode_rates_size (8)
|
||||
@ -17064,6 +17065,10 @@ static int __wlan_hdd_cfg80211_connect(struct wiphy *wiphy,
|
||||
if (0 != status)
|
||||
return status;
|
||||
|
||||
/* Disable NAN Discovery if enabled */
|
||||
if (adapter->device_mode == QDF_P2P_CLIENT_MODE)
|
||||
ucfg_nan_disable_concurrency(hdd_ctx->psoc);
|
||||
|
||||
if (req->bssid)
|
||||
bssid = req->bssid;
|
||||
else if (bssid_hint)
|
||||
@ -17723,6 +17728,9 @@ static int __wlan_hdd_cfg80211_join_ibss(struct wiphy *wiphy,
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable NAN Discovery if enabled */
|
||||
ucfg_nan_disable_concurrency(hdd_ctx->psoc);
|
||||
|
||||
if (!policy_mgr_allow_concurrency(hdd_ctx->psoc,
|
||||
PM_IBSS_MODE, channelNum, HW_MODE_20_MHZ)) {
|
||||
hdd_err("This concurrency combination is not allowed");
|
||||
|
@ -86,6 +86,7 @@
|
||||
#include "cfg_ucfg_api.h"
|
||||
#include "wlan_crypto_global_api.h"
|
||||
#include "wlan_action_oui_ucfg_api.h"
|
||||
#include "nan_ucfg_api.h"
|
||||
|
||||
#define ACS_SCAN_EXPIRY_TIMEOUT_S 4
|
||||
|
||||
@ -5941,6 +5942,10 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
|
||||
sap_cfg->SapHw_mode = eCSR_DOT11_MODE_abg;
|
||||
}
|
||||
|
||||
/* Disable NAN Discovery before starting P2P GO */
|
||||
if (adapter->device_mode == QDF_P2P_GO_MODE)
|
||||
ucfg_nan_disable_concurrency(hdd_ctx->psoc);
|
||||
|
||||
/* check if concurrency is allowed */
|
||||
if (!policy_mgr_allow_concurrency(hdd_ctx->psoc,
|
||||
policy_mgr_convert_device_mode_to_qdf_type(
|
||||
|
@ -325,6 +325,7 @@ static const struct category_info cinfo[MAX_SUPPORTED_CATEGORY] = {
|
||||
[QDF_MODULE_ID_FWOL] = {QDF_TRACE_LEVEL_ALL},
|
||||
[QDF_MODULE_ID_SM_ENGINE] = {QDF_TRACE_LEVEL_ALL},
|
||||
[QDF_MODULE_ID_CMN_MLME] = {QDF_TRACE_LEVEL_ALL},
|
||||
[QDF_MODULE_ID_NAN] = {QDF_TRACE_LEVEL_ALL},
|
||||
};
|
||||
|
||||
struct notifier_block hdd_netdev_notifier;
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "wlan_cfg80211_p2p.h"
|
||||
#include "wlan_p2p_cfg_api.h"
|
||||
#include "wlan_policy_mgr_ucfg.h"
|
||||
#include "nan_ucfg_api.h"
|
||||
|
||||
/* Ms to Time Unit Micro Sec */
|
||||
#define MS_TO_TU_MUS(x) ((x) * 1024)
|
||||
@ -146,6 +147,9 @@ static int __wlan_hdd_cfg80211_remain_on_channel(struct wiphy *wiphy,
|
||||
if (wlan_hdd_validate_session_id(adapter->session_id))
|
||||
return -EINVAL;
|
||||
|
||||
/* Disable NAN Discovery if enabled */
|
||||
ucfg_nan_disable_concurrency(hdd_ctx->psoc);
|
||||
|
||||
status = wlan_cfg80211_roc(adapter->vdev, chan, duration, cookie);
|
||||
hdd_debug("remain on channel request, status:%d, cookie:0x%llx",
|
||||
status, *cookie);
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include <wlan_cfg80211_scan.h>
|
||||
#include "wlan_utility.h"
|
||||
#include "wlan_hdd_object_manager.h"
|
||||
#include "nan_ucfg_api.h"
|
||||
|
||||
#define MAX_RATES 12
|
||||
#define HDD_WAKE_LOCK_SCAN_DURATION (5 * 1000) /* in msec */
|
||||
@ -671,6 +672,12 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
|
||||
scan_info->scan_add_ie.length;
|
||||
}
|
||||
|
||||
if (QDF_P2P_CLIENT_MODE == adapter->device_mode ||
|
||||
QDF_P2P_DEVICE_MODE == adapter->device_mode) {
|
||||
/* Disable NAN Discovery if enabled */
|
||||
ucfg_nan_disable_concurrency(hdd_ctx->psoc);
|
||||
}
|
||||
|
||||
vdev = hdd_objmgr_get_vdev(adapter);
|
||||
if (!vdev) {
|
||||
status = -EINVAL;
|
||||
|
@ -2323,6 +2323,8 @@ static int os_if_process_nan_disable_req(struct wlan_objmgr_psoc *psoc,
|
||||
}
|
||||
|
||||
nan_req->psoc = psoc;
|
||||
nan_req->disable_2g_discovery = true;
|
||||
nan_req->disable_5g_discovery = true;
|
||||
nan_req->params.request_data_len = buf_len;
|
||||
nla_memcpy(nan_req->params.request_data,
|
||||
tb[QCA_WLAN_VENDOR_ATTR_NAN_CMD_DATA], buf_len);
|
||||
@ -2343,15 +2345,11 @@ static int os_if_process_nan_enable_req(struct wlan_objmgr_psoc *psoc,
|
||||
struct nlattr **tb)
|
||||
{
|
||||
uint32_t chan_freq_2g, chan_freq_5g = 0;
|
||||
uint8_t nan_chan_2g;
|
||||
uint32_t buf_len;
|
||||
QDF_STATUS status;
|
||||
struct nan_enable_req *nan_req;
|
||||
|
||||
if (!ucfg_is_nan_enable_allowed(psoc)) {
|
||||
cfg80211_err("NAN Enable not allowed at this moment");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!tb[QCA_WLAN_VENDOR_ATTR_NAN_DISC_24GHZ_BAND_FREQ]) {
|
||||
cfg80211_err("NAN Social channel for 2.4Gz is unavailable!");
|
||||
return -EINVAL;
|
||||
@ -2364,6 +2362,13 @@ static int os_if_process_nan_enable_req(struct wlan_objmgr_psoc *psoc,
|
||||
nla_get_u32(tb[
|
||||
QCA_WLAN_VENDOR_ATTR_NAN_DISC_5GHZ_BAND_FREQ]);
|
||||
|
||||
nan_chan_2g = wlan_freq_to_chan(chan_freq_2g);
|
||||
if (!ucfg_is_nan_enable_allowed(psoc, nan_chan_2g)) {
|
||||
cfg80211_err("NAN Enable not allowed at this moment for channel %d",
|
||||
nan_chan_2g);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
buf_len = nla_len(tb[QCA_WLAN_VENDOR_ATTR_NAN_CMD_DATA]);
|
||||
|
||||
nan_req = qdf_mem_malloc(sizeof(*nan_req) + buf_len);
|
||||
|
Loading…
Reference in New Issue
Block a user