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
这个提交包含在:
Ashish Kumar Dhanotiya
2020-02-06 14:41:21 +05:30
提交者 nshrivas
父节点 e5b9856f61
当前提交 b3ae646bf2
修改 7 个文件,包含 141 行新增3 行删除

查看文件

@@ -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);
}
/**