Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dafd2a63 authored by Abhinav Kumar's avatar Abhinav Kumar Committed by nshrivas
Browse files

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
parent b683a25b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/*
 * 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
 * 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
 * @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
 */
struct nan_cfg_params {
	bool enable;
	bool dp_enable;
	bool ndi_mac_randomize;
	uint16_t ndp_inactivity_timeout;
	bool nan_separate_iface_support;
};

/**
+27 −2
Original line number Diff line number Diff line
/*
 * 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
@@ -49,6 +49,30 @@
#define CFG_NAN_ENABLE CFG_INI_BOOL("gEnableNanSupport", \
				    0, \
				    "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>
 * 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_DP      CFG(CFG_NAN_DATAPATH_ENABLE) \
			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
#define CFG_NAN_DISC
#define CFG_NAN_DP
+15 −0
Original line number Diff line number Diff line
@@ -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);

/**
 * 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
 * @psoc: pointer to psoc object
@@ -441,6 +450,12 @@ bool ucfg_nan_is_vdev_creation_allowed(struct wlan_objmgr_psoc *psoc)
	return false;
}

static inline
bool ucfg_nan_get_is_separate_nan_iface(struct wlan_objmgr_psoc *psoc)
{
	return false;
}

static inline
QDF_STATUS ucfg_disable_nan_discovery(struct wlan_objmgr_psoc *psoc,
				      uint8_t *data, uint32_t data_len)
+14 −0
Original line number Diff line number Diff line
@@ -66,6 +66,9 @@ static void nan_cfg_dp_init(struct wlan_objmgr_psoc *psoc,
				cfg_get(psoc, CFG_NAN_RANDOMIZE_NDI_MAC);
	nan_obj->cfg_param.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
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;
}

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,
				      uint8_t *data, uint32_t data_len)
{
+6 −1
Original line number Diff line number Diff line
@@ -12866,7 +12866,12 @@ hdd_open_adapters_for_mission_mode(struct hdd_context *hdd_ctx)
	if (status)
		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);
		status = hdd_open_adapter_no_trans(hdd_ctx, QDF_NAN_DISC_MODE,
						   "wifi-aware%d", mac_addr);
Loading