qcacld-3.0: Add an ini for separate iface support for NAN

Add a new INI parameter "nan_separate_iface_support" to
indicate firmware that the host driver supports separate
interface for NAN Discovery.

Change-Id: I6fb313b02c5f3a05638e85494051fb003b2dd867
CRs-Fixed: 2612006
This commit is contained in:
Abhinav Kumar
2020-01-24 19:00:07 +05:30
committed by nshrivas
parent b683a25b33
commit dafd2a637b
6 changed files with 69 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -81,12 +81,14 @@ enum nan_disc_state {
* @dp_enable: NAN Datapath feature enable * @dp_enable: NAN Datapath feature enable
* @ndi_mac_randomize: Randomize NAN datapath interface MAC * @ndi_mac_randomize: Randomize NAN datapath interface MAC
* @ndp_inactivity_timeout: NDP inactivity timeout * @ndp_inactivity_timeout: NDP inactivity timeout
* @nan_separate_iface_support: To supports separate iface creation for NAN
*/ */
struct nan_cfg_params { struct nan_cfg_params {
bool enable; bool enable;
bool dp_enable; bool dp_enable;
bool ndi_mac_randomize; bool ndi_mac_randomize;
uint16_t ndp_inactivity_timeout; uint16_t ndp_inactivity_timeout;
bool nan_separate_iface_support;
}; };
/** /**

View File

@@ -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 * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -49,6 +49,30 @@
#define CFG_NAN_ENABLE CFG_INI_BOOL("gEnableNanSupport", \ #define CFG_NAN_ENABLE CFG_INI_BOOL("gEnableNanSupport", \
0, \ 0, \
"Enable NAN Support") "Enable NAN Support")
/*
* <ini>
* nan_separate_iface_support: Separate iface creation for NAN
* @Min: 0
* @Max: 1
* @Default: 1
*
* Value is 1 when Host HDD supports separate iface creation
* for NAN.
*
* Related: None
*
* Supported Feature: NAN
*
* Usage: External
*
* </ini>
*/
#define CFG_NAN_SEPARATE_IFACE_SUPP CFG_INI_BOOL("nan_separate_iface_support", \
0, \
"Seperate iface for NAN")
/* /*
* <ini> * <ini>
* genable_nan_datapath - Enable NaN data path feature. NaN data path * genable_nan_datapath - Enable NaN data path feature. NaN data path
@@ -122,7 +146,8 @@
#define CFG_NAN_DISC CFG(CFG_NAN_ENABLE) #define CFG_NAN_DISC CFG(CFG_NAN_ENABLE)
#define CFG_NAN_DP CFG(CFG_NAN_DATAPATH_ENABLE) \ #define CFG_NAN_DP CFG(CFG_NAN_DATAPATH_ENABLE) \
CFG(CFG_NAN_RANDOMIZE_NDI_MAC) \ CFG(CFG_NAN_RANDOMIZE_NDI_MAC) \
CFG(CFG_NAN_NDP_INACTIVITY_TIMEOUT) CFG(CFG_NAN_NDP_INACTIVITY_TIMEOUT) \
CFG(CFG_NAN_SEPARATE_IFACE_SUPP)
#else #else
#define CFG_NAN_DISC #define CFG_NAN_DISC
#define CFG_NAN_DP #define CFG_NAN_DP

View File

@@ -369,6 +369,15 @@ bool ucfg_nan_is_sta_ndp_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
*/ */
bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc); bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_nan_get_is_separate_nan_iface() - get is_separate_nan_iface value
* @psoc: pointer to psoc object
*
* Return: True if host supports separate vdev for NAN, false otherwise
*/
bool
ucfg_nan_get_is_separate_nan_iface(struct wlan_objmgr_psoc *psoc);
/** /**
* ucfg_disable_nan_discovery() - Disable NAN discovery * ucfg_disable_nan_discovery() - Disable NAN discovery
* @psoc: pointer to psoc object * @psoc: pointer to psoc object
@@ -441,6 +450,12 @@ bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc)
return false; return false;
} }
static inline
bool ucfg_nan_get_is_separate_nan_iface(struct wlan_objmgr_psoc *psoc)
{
return false;
}
static inline static inline
QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc,
uint8_t *data, uint32_t data_len) uint8_t *data, uint32_t data_len)

View File

@@ -66,6 +66,9 @@ static void nan_cfg_dp_init(struct wlan_objmgr_psoc *psoc,
cfg_get(psoc, CFG_NAN_RANDOMIZE_NDI_MAC); cfg_get(psoc, CFG_NAN_RANDOMIZE_NDI_MAC);
nan_obj->cfg_param.ndp_inactivity_timeout = nan_obj->cfg_param.ndp_inactivity_timeout =
cfg_get(psoc, CFG_NAN_NDP_INACTIVITY_TIMEOUT); cfg_get(psoc, CFG_NAN_NDP_INACTIVITY_TIMEOUT);
nan_obj->cfg_param.nan_separate_iface_support =
cfg_get(psoc, CFG_NAN_SEPARATE_IFACE_SUPP);
} }
#else #else
static void nan_cfg_init(struct wlan_objmgr_psoc *psoc, static void nan_cfg_init(struct wlan_objmgr_psoc *psoc,
@@ -1046,6 +1049,17 @@ bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc)
return psoc_nan_obj->nan_caps.nan_vdev_allowed; return psoc_nan_obj->nan_caps.nan_vdev_allowed;
} }
bool ucfg_nan_get_is_separate_nan_iface(struct wlan_objmgr_psoc *psoc)
{
struct nan_psoc_priv_obj *nan_obj = nan_get_psoc_priv_obj(psoc);
if (!nan_obj) {
nan_err("NAN obj null");
return false;
}
return nan_obj->cfg_param.nan_separate_iface_support;
}
QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc,
uint8_t *data, uint32_t data_len) uint8_t *data, uint32_t data_len)
{ {

View File

@@ -12866,7 +12866,12 @@ hdd_open_adapters_for_mission_mode(struct hdd_context *hdd_ctx)
if (status) if (status)
goto err_close_adapters; goto err_close_adapters;
if (ucfg_nan_is_vdev_creation_allowed(hdd_ctx->psoc)) { /*
* Create separate interface (wifi-aware0) for NAN. All NAN commands
* should go on this new interface.
*/
if (ucfg_nan_is_vdev_creation_allowed(hdd_ctx->psoc) &&
ucfg_nan_get_is_separate_nan_iface(hdd_ctx->psoc)) {
mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_NAN_DISC_MODE); mac_addr = wlan_hdd_get_intf_addr(hdd_ctx, QDF_NAN_DISC_MODE);
status = hdd_open_adapter_no_trans(hdd_ctx, QDF_NAN_DISC_MODE, status = hdd_open_adapter_no_trans(hdd_ctx, QDF_NAN_DISC_MODE,
"wifi-aware%d", mac_addr); "wifi-aware%d", mac_addr);

View File

@@ -5392,6 +5392,10 @@ static int wma_update_hdd_cfg(tp_wma_handle wma_handle)
return -EINVAL; return -EINVAL;
} }
wlan_res_cfg->nan_separate_iface_support =
ucfg_nan_is_vdev_creation_allowed(wma_handle->psoc) &&
ucfg_nan_get_is_separate_nan_iface(wma_handle->psoc);
service_ext_param = service_ext_param =
target_psoc_get_service_ext_param(tgt_hdl); target_psoc_get_service_ext_param(tgt_hdl);
wmi_handle = get_wmi_unified_hdl_from_psoc(wma_handle->psoc); wmi_handle = get_wmi_unified_hdl_from_psoc(wma_handle->psoc);