qcacld-3.0: Add support for the NAN config items
Currently there is no inis for NAN component: 1. To configure the keep alive period for the NDI interface. 2. To enable/disable discovery of NAN cluster with Master Preference (MP) as 0 when a new device is enabling NAN. Add ini support to configure above mentioned values. Change-Id: I47b67eb89fb8849960a9f492d2909e45b96308f3 CRs-Fixed: 2617839
这个提交包含在:
@@ -82,6 +82,10 @@ enum nan_disc_state {
|
||||
* @ndi_mac_randomize: Randomize NAN datapath interface MAC
|
||||
* @ndp_inactivity_timeout: NDP inactivity timeout
|
||||
* @nan_separate_iface_support: To supports separate iface creation for NAN
|
||||
* @ndp_keep_alive_period: To configure duration of how many seconds to
|
||||
* wait to kickout peer if peer is not reachable
|
||||
* @support_mp0_discovery: To support discovery of NAN cluster with Master
|
||||
* Preference (MP) as 0 when a new device is enabling NAN
|
||||
*/
|
||||
struct nan_cfg_params {
|
||||
bool enable;
|
||||
@@ -89,6 +93,8 @@ struct nan_cfg_params {
|
||||
bool ndi_mac_randomize;
|
||||
uint16_t ndp_inactivity_timeout;
|
||||
bool nan_separate_iface_support;
|
||||
uint16_t ndp_keep_alive_period;
|
||||
bool support_mp0_discovery;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -142,8 +142,58 @@
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"NDP Auto Terminate time")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gNdpKeepAlivePeriod - To configure duration of how many seconds
|
||||
* to wait to kickout peer if peer is not reachable.
|
||||
*
|
||||
* @Min: 10
|
||||
* @Max: 30
|
||||
* @Default: 20
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: NAN
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
|
||||
#define CFG_NDP_KEEP_ALIVE_PERIOD CFG_INI_UINT( \
|
||||
"gNdpKeepAlivePeriod", \
|
||||
10, \
|
||||
30, \
|
||||
20, \
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"Keep alive timeout of a peer")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* gSupportMp0Discovery - To support discovery of NAN cluster with
|
||||
* Master Preference (MP) as 0 when a new device is enabling NAN.
|
||||
*
|
||||
* @Min: 0
|
||||
* @Max: 1
|
||||
* @Default: 0
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: NAN
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_SUPPORT_MP0_DISCOVERY CFG_INI_BOOL( \
|
||||
"gSupportMp0Discovery", \
|
||||
1, \
|
||||
"Enable/Disable discovery of NAN cluster with Master Preference (MP) as 0")
|
||||
|
||||
#ifdef WLAN_FEATURE_NAN
|
||||
#define CFG_NAN_DISC CFG(CFG_NAN_ENABLE)
|
||||
#define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) \
|
||||
CFG(CFG_NDP_KEEP_ALIVE_PERIOD) \
|
||||
CFG(CFG_SUPPORT_MP0_DISCOVERY)
|
||||
#define CFG_NAN_DP CFG(CFG_NAN_DATAPATH_ENABLE) \
|
||||
CFG(CFG_NAN_RANDOMIZE_NDI_MAC) \
|
||||
CFG(CFG_NAN_NDP_INACTIVITY_TIMEOUT) \
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-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
|
||||
@@ -64,6 +64,25 @@ bool cfg_nan_get_ndi_mac_randomize(struct wlan_objmgr_psoc *psoc);
|
||||
QDF_STATUS cfg_nan_get_ndp_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
|
||||
uint16_t *val);
|
||||
|
||||
/**
|
||||
* cfg_nan_get_ndp_keepalive_period() - get NDP keepalive period
|
||||
* @psoc: pointer to psoc object
|
||||
* @val: pointer to the value where keepalive period has to be copied to
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS cfg_nan_get_ndp_keepalive_period(struct wlan_objmgr_psoc *psoc,
|
||||
uint16_t *val);
|
||||
|
||||
/**
|
||||
* cfg_nan_get_support_mp0_discovery() - get value of config support mp0
|
||||
* discovery
|
||||
* @psoc: pointer to psoc object
|
||||
*
|
||||
* Return: Value of config join clustur with mp
|
||||
*/
|
||||
bool cfg_nan_get_support_mp0_discovery(struct wlan_objmgr_psoc *psoc);
|
||||
|
||||
#else
|
||||
static inline bool cfg_nan_get_enable(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
@@ -86,6 +105,20 @@ QDF_STATUS cfg_nan_get_ndp_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline
|
||||
QDF_STATUS cfg_nan_get_ndp_keepalive_period(struct wlan_objmgr_psoc *psoc,
|
||||
uint16_t *val)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline bool cfg_nan_get_support_mp0_discovery(
|
||||
struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2018-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
|
||||
@@ -81,3 +81,29 @@ QDF_STATUS cfg_nan_get_ndp_inactivity_timeout(struct wlan_objmgr_psoc *psoc,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS cfg_nan_get_ndp_keepalive_period(struct wlan_objmgr_psoc *psoc,
|
||||
uint16_t *val)
|
||||
{
|
||||
struct nan_psoc_priv_obj *nan_obj = cfg_nan_get_priv_obj(psoc);
|
||||
|
||||
if (!nan_obj) {
|
||||
nan_err("NAN obj null");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
*val = nan_obj->cfg_param.ndp_keep_alive_period;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool cfg_nan_get_support_mp0_discovery(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
struct nan_psoc_priv_obj *nan_obj = cfg_nan_get_priv_obj(psoc);
|
||||
|
||||
if (!nan_obj) {
|
||||
nan_err("NAN obj null");
|
||||
return false;
|
||||
}
|
||||
|
||||
return nan_obj->cfg_param.support_mp0_discovery;
|
||||
}
|
||||
|
||||
|
@@ -48,6 +48,12 @@ static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
|
||||
struct nan_psoc_priv_obj *nan_obj)
|
||||
{
|
||||
nan_obj->cfg_param.enable = cfg_get(psoc, CFG_NAN_ENABLE);
|
||||
nan_obj->cfg_param.support_mp0_discovery =
|
||||
cfg_get(psoc,
|
||||
CFG_SUPPORT_MP0_DISCOVERY);
|
||||
nan_obj->cfg_param.ndp_keep_alive_period =
|
||||
cfg_get(psoc,
|
||||
CFG_NDP_KEEP_ALIVE_PERIOD);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -178,6 +178,7 @@
|
||||
#include "mac_init_api.h"
|
||||
#include "wlan_pkt_capture_ucfg_api.h"
|
||||
#include <wlan_hdd_sar_limits.h>
|
||||
#include "cfg_nan_api.h"
|
||||
|
||||
#ifdef MODULE
|
||||
#define WLAN_MODULE_NAME module_name(THIS_MODULE)
|
||||
@@ -4808,6 +4809,13 @@ int hdd_vdev_create(struct hdd_adapter *adapter)
|
||||
hdd_objmgr_put_vdev(vdev);
|
||||
}
|
||||
|
||||
if (QDF_NAN_DISC_MODE == adapter->device_mode) {
|
||||
sme_cli_set_command(
|
||||
adapter->vdev_id,
|
||||
WMI_VDEV_PARAM_ALLOW_NAN_INITIAL_DISCOVERY_OF_MP0_CLUSTER,
|
||||
cfg_nan_get_support_mp0_discovery(hdd_ctx->psoc),
|
||||
VDEV_CMD);
|
||||
}
|
||||
hdd_store_nss_chains_cfg_in_vdev(adapter);
|
||||
|
||||
hdd_nofl_debug("vdev %d created successfully", adapter->vdev_id);
|
||||
|
@@ -693,6 +693,7 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
|
||||
struct csr_roam_info *roam_info;
|
||||
struct bss_description tmp_bss_descp = {0};
|
||||
uint16_t ndp_inactivity_timeout = 0;
|
||||
uint16_t ndp_keep_alive_period;
|
||||
struct qdf_mac_addr bc_mac_addr = QDF_MAC_ADDR_BCAST_INIT;
|
||||
|
||||
hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
|
||||
@@ -733,6 +734,14 @@ void hdd_ndi_drv_ndi_create_rsp_handler(uint8_t vdev_id,
|
||||
sme_cli_set_command(adapter->vdev_id,
|
||||
WMI_VDEV_PARAM_NDP_INACTIVITY_TIMEOUT,
|
||||
ndp_inactivity_timeout, VDEV_CMD);
|
||||
|
||||
if (QDF_IS_STATUS_SUCCESS(cfg_nan_get_ndp_keepalive_period(
|
||||
hdd_ctx->psoc,
|
||||
&ndp_keep_alive_period)))
|
||||
sme_cli_set_command(
|
||||
adapter->vdev_id,
|
||||
WMI_VDEV_PARAM_NDP_KEEPALIVE_TIMEOUT,
|
||||
ndp_keep_alive_period, VDEV_CMD);
|
||||
} else {
|
||||
hdd_alert("NDI interface creation failed with reason %d",
|
||||
ndi_rsp->reason /* create_reason */);
|
||||
|
在新工单中引用
屏蔽一个用户