qcacld-3.0: Ini bitmap to enable/disable a particular NAN feature
NAN protocol runs in firmware and controlled by framework. Framework configures multiple NAN discovery params while enabling NAN. Framework configurations would be based on the framework constraints or realtime scenarios like resource(memory/power/..) consumption. But some of these params might need to be controlled explicitly based on the usage. NAN DW is one such parameter, which is configured as 4 seconds when the device is in sync role and the screen is off. But for some usecases, this param might have to be 512ms always irrespective of screen off/on for some targets. Add an ini param "nan_feature_config" to set a bit to indicate firmware whether to honor framework configured DW value or the firmware default value. Send the vdev param on NAN supported vdev by setting the "bit 0" to indicate firmware to allow framework configured DW value. If this bit is not set, firmware shall consider its default value. Change-Id: I0476bca2bbe676beccfff207f5b4ea31e89031e2 CRs-Fixed: 2721970
This commit is contained in:

committed by
nshrivas

parent
d001e72975
commit
c2b4e154f3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-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
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "wlan_objmgr_psoc_obj.h"
|
||||
#include "wlan_objmgr_pdev_obj.h"
|
||||
#include "wlan_objmgr_vdev_obj.h"
|
||||
#include "nan_ucfg_api.h"
|
||||
|
||||
static QDF_STATUS nan_psoc_obj_created_notification(
|
||||
struct wlan_objmgr_psoc *psoc, void *arg_list)
|
||||
@@ -94,8 +95,18 @@ static QDF_STATUS nan_vdev_obj_created_notification(
|
||||
{
|
||||
struct nan_vdev_priv_obj *nan_obj;
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
|
||||
nan_debug("nan_vdev_create_notif called");
|
||||
if (ucfg_is_nan_vdev(vdev)) {
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
nan_err("psoc is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
target_if_nan_set_vdev_feature_config(psoc,
|
||||
wlan_vdev_get_id(vdev));
|
||||
}
|
||||
if (wlan_vdev_mlme_get_opmode(vdev) != QDF_NDI_MODE) {
|
||||
nan_debug("not a ndi vdev. do nothing");
|
||||
return QDF_STATUS_SUCCESS;
|
||||
|
@@ -85,6 +85,9 @@ enum nan_disc_state {
|
||||
* Preference (MP) as 0 when a new device is enabling NAN
|
||||
* @max_ndp_sessions: max ndp sessions host supports
|
||||
* @max_ndi: max number of ndi host supports
|
||||
* @nan_feature_config: Bitmap to enable/disable a particular NAN feature
|
||||
* configuration in firmware. It's sent to firmware through
|
||||
* WMI_VDEV_PARAM_ENABLE_DISABLE_NAN_CONFIG_FEATURES
|
||||
*/
|
||||
struct nan_cfg_params {
|
||||
bool enable;
|
||||
@@ -96,6 +99,7 @@ struct nan_cfg_params {
|
||||
bool support_mp0_discovery;
|
||||
uint32_t max_ndp_sessions;
|
||||
uint32_t max_ndi;
|
||||
uint32_t nan_feature_config;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -239,6 +239,38 @@
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"Max number of NDI host supports")
|
||||
|
||||
/*
|
||||
* <ini>
|
||||
* nan_feature_config - Bitmap to enable/disable a particular NAN/NDP feature
|
||||
*
|
||||
* @Min: 0
|
||||
* @Max: 0xFFFF
|
||||
* @Default: 0x1
|
||||
*
|
||||
* This parameter helps to enable/disable a particular feature config by setting
|
||||
* corresponding bit and send to firmware through the VDEV param
|
||||
* WMI_VDEV_PARAM_ENABLE_DISABLE_NAN_CONFIG_FEATURES
|
||||
* Acceptable values for this:
|
||||
* BIT(0): Allow DW configuration from framework in sync role.
|
||||
* If this is not set, firmware shall follow the spec/default behavior.
|
||||
* BIT(1) to BIT(31): Reserved
|
||||
*
|
||||
* Related: None
|
||||
*
|
||||
* Supported Feature: NAN
|
||||
*
|
||||
* Usage: External
|
||||
*
|
||||
* </ini>
|
||||
*/
|
||||
#define CFG_NAN_FEATURE_CONFIG CFG_INI_UINT( \
|
||||
"nan_feature_config", \
|
||||
0, \
|
||||
0xFFFF, \
|
||||
1, \
|
||||
CFG_VALUE_OR_DEFAULT, \
|
||||
"Enable the specified NAN features in firmware")
|
||||
|
||||
#ifdef WLAN_FEATURE_NAN
|
||||
#define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) \
|
||||
CFG(CFG_NDP_KEEP_ALIVE_PERIOD) \
|
||||
@@ -255,6 +287,7 @@
|
||||
#define CFG_NAN_ALL CFG_NAN_DISC \
|
||||
CFG_NAN_DP \
|
||||
CFG(CFG_NDP_MAX_SESSIONS) \
|
||||
CFG(CFG_NDI_MAX_SUPPORT)
|
||||
CFG(CFG_NDI_MAX_SUPPORT) \
|
||||
CFG(CFG_NAN_FEATURE_CONFIG)
|
||||
|
||||
#endif
|
||||
|
@@ -423,6 +423,28 @@ QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc,
|
||||
*/
|
||||
QDF_STATUS
|
||||
ucfg_nan_disable_ndi(struct wlan_objmgr_psoc *psoc, uint32_t ndi_vdev_id);
|
||||
|
||||
/**
|
||||
* ucfg_get_nan_feature_config() - Get NAN feature bitmap
|
||||
* @psoc: pointer to psoc object
|
||||
* @nan_feature_config: NAN feature config bitmap to be enabled in firmware
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS ucfg_get_nan_feature_config(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *nan_feature_config);
|
||||
|
||||
/**
|
||||
* ucfg_is_nan_vdev() - Check if the current vdev supports NAN or not
|
||||
* @vdev: pointer to vdev object
|
||||
*
|
||||
* Return true
|
||||
* 1. If the VDEV type is NAN_DISC or
|
||||
* 2. If the VDEV type is STA and nan_separate_iface feature is not supported
|
||||
*
|
||||
* Return: Bool
|
||||
*/
|
||||
bool ucfg_is_nan_vdev(struct wlan_objmgr_vdev *vdev);
|
||||
#else /* WLAN_FEATURE_NAN */
|
||||
|
||||
static inline
|
||||
@@ -511,5 +533,18 @@ bool ucfg_is_nan_disable_supported(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline
|
||||
QDF_STATUS ucfg_get_nan_feature_config(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *nan_feature_config)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline
|
||||
bool ucfg_is_nan_vdev(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* WLAN_FEATURE_NAN */
|
||||
#endif /* _NAN_UCFG_API_H_ */
|
||||
|
@@ -57,6 +57,8 @@ static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
|
||||
nan_obj->cfg_param.max_ndp_sessions = cfg_get(psoc,
|
||||
CFG_NDP_MAX_SESSIONS);
|
||||
nan_obj->cfg_param.max_ndi = cfg_get(psoc, CFG_NDI_MAX_SUPPORT);
|
||||
nan_obj->cfg_param.nan_feature_config =
|
||||
cfg_get(psoc, CFG_NAN_FEATURE_CONFIG);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1196,3 +1198,29 @@ ucfg_nan_set_vdev_creation_supp_by_fw(struct wlan_objmgr_psoc *psoc, bool set)
|
||||
|
||||
psoc_nan_obj->nan_caps.nan_vdev_allowed = set;
|
||||
}
|
||||
|
||||
QDF_STATUS ucfg_get_nan_feature_config(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t *nan_feature_config)
|
||||
{
|
||||
struct nan_psoc_priv_obj *psoc_nan_obj;
|
||||
|
||||
psoc_nan_obj = nan_get_psoc_priv_obj(psoc);
|
||||
if (!psoc_nan_obj) {
|
||||
nan_err("psoc_nan_obj is null");
|
||||
*nan_feature_config = cfg_default(CFG_NAN_FEATURE_CONFIG);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
*nan_feature_config = psoc_nan_obj->cfg_param.nan_feature_config;
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool ucfg_is_nan_vdev(struct wlan_objmgr_vdev *vdev)
|
||||
{
|
||||
if (wlan_vdev_mlme_get_opmode(vdev) == QDF_NAN_DISC_MODE ||
|
||||
(!ucfg_nan_is_vdev_creation_allowed(wlan_vdev_get_psoc(vdev)) &&
|
||||
wlan_vdev_mlme_get_opmode(vdev) == QDF_STA_MODE))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user