summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSourav Mohapatra <mohapatr@codeaurora.org>2019-03-29 15:38:01 +0530
committernshrivas <nshrivas@codeaurora.org>2019-04-09 01:50:47 -0700
commite794ab6054ee8efed0ccf94ccf57cc1738ea0848 (patch)
treedc40319c3ea8784a1c2d8c53f2673518aed798a9
parentc8f90d8249a3b67f95ef6110981d7fc2cb738ff5 (diff)
qcacld-3.0: Send vdev param to configure beacon offload to FW
Add support to send WMI_VDEV_PARAM_NTH_BEACON_TO_HOST to the firmware. The value is received from the userspace as a parameter to wifi set configuration. The configured value will be used by firmware to forward that beacon to host which is then forwarded to the userspace. This value is configured to the firmware via a new attribute QCA_WLAN_VENDOR_ATTR_CONFIG_NTH_BEACON_REPORT to WIFI_SET_CONFIG Change-Id: Ie789f7ef016973adba233c7a49ab6ffaebb586d1 CRs-Fixed: 2427033
-rw-r--r--Kbuild7
-rw-r--r--core/hdd/inc/wlan_hdd_cfg.h24
-rw-r--r--core/hdd/inc/wlan_hdd_main.h8
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c10
-rw-r--r--core/hdd/src/wlan_hdd_cfg.c11
-rw-r--r--core/hdd/src/wlan_hdd_main.c29
6 files changed, 89 insertions, 0 deletions
diff --git a/Kbuild b/Kbuild
index 90486f343a9b..cfa13e139986 100644
--- a/Kbuild
+++ b/Kbuild
@@ -291,6 +291,9 @@ ifneq ($(CONFIG_MOBILE_ROUTER), y)
CONFIG_QCOM_ESE := y
endif
+#Enable beacon reporting feature
+CONFIG_WLAN_BEACON_REPORTING := y
+
# Feature flags which are not (currently) configurable via Kconfig
#Whether to build debug version
@@ -1455,6 +1458,10 @@ ifeq ($(CONFIG_WLAN_FEATURE_SAE),y)
CDEFINES += -DWLAN_FEATURE_SAE
endif
+ifeq ($(CONFIG_WLAN_BEACON_REPORTING),y)
+CDEFINES += -DNTH_BEACON_OFFLOAD
+endif
+
ifeq ($(BUILD_DIAG_VERSION),1)
CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT
CDEFINES += -DFEATURE_WLAN_DIAG_SUPPORT_CSR
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 867e2a58c26d..bf95869194c1 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -1856,6 +1856,29 @@ enum hdd_dot11_mode {
/*
* <ini>
+ * nth_beacon_reporting - Enable/Disable the nth beacon reporting offload
+ * @Min: 0
+ * @Max: 65536
+ * @Default: 0
+ *
+ * The configured value will be used by firmware to forward
+ * that beacon to host which is then forwarded to the userspace.
+ *
+ * Related: None
+ *
+ * Supported Feature: Beacon reporting
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_NTH_BEACON_REPORTING_OFFLOAD_NAME "nth_beacon_reporting"
+#define CFG_NTH_BEACON_REPORTING_OFFLOAD_MIN (0)
+#define CFG_NTH_BEACON_REPORTING_OFFLOAD_MAX (65536)
+#define CFG_NTH_BEACON_REPORTING_OFFLOAD_DEFAULT (0)
+
+/*
+ * <ini>
* g11agNumTxChains - Number of Tx Chanins in 11ag mode
* @Min: 0
* @Max: 2
@@ -16326,6 +16349,7 @@ struct hdd_config {
uint32_t btm_max_attempt_cnt;
uint32_t btm_sticky_time;
uint32_t btm_query_bitmask;
+ uint16_t beacon_reporting;
};
#define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index 5d9ff82231a5..a0d9c12d6ef4 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -3219,4 +3219,12 @@ void hdd_get_nud_stats_cb(void *data, struct rsp_stats *rsp, void *context);
void hdd_sched_scan_results(struct wiphy *wiphy, uint64_t reqid);
+/**
+ * hdd_set_nth_beacon_offload() - Send the nth beacon offload command to FW
+ * @adapter: HDD adapter
+ * @value: Value of n, for which the nth beacon will be forwarded by the FW
+ *
+ * Return: QDF_STATUS_SUCCESS on success and failure status on failure
+ */
+QDF_STATUS hdd_set_nth_beacon_offload(hdd_adapter_t *adapter, uint16_t value);
#endif /* end #if !defined(WLAN_HDD_MAIN_H) */
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index 7dcb517dcbdc..e49b4d430a34 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -2693,6 +2693,16 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
/* Indicate 'connect' status to user space */
hdd_send_association_event(dev, pRoamInfo);
+ /* Send beacon reporting offload command to FW */
+ if (pHddCtx->config->beacon_reporting) {
+ qdf_status = hdd_set_nth_beacon_offload
+ (pAdapter,
+ pHddCtx->config->beacon_reporting);
+
+ if (QDF_IS_STATUS_ERROR(qdf_status))
+ hdd_err("Failed to set nth beacon reporting");
+ }
+
if (cds_is_mcc_in_24G()) {
if (pHddCtx->miracast_value)
cds_set_mas(pAdapter, pHddCtx->miracast_value);
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 0e55b4166a34..1fdf00523c47 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -5796,6 +5796,14 @@ struct reg_table_entry g_registry_table[] = {
CFG_ROAM_PREAUTH_NO_ACK_TIMEOUT_DEFAULT,
CFG_ROAM_PREAUTH_NO_ACK_TIMEOUT_MIN,
CFG_ROAM_PREAUTH_NO_ACK_TIMEOUT_MAX),
+
+ REG_VARIABLE(CFG_NTH_BEACON_REPORTING_OFFLOAD_NAME,
+ WLAN_PARAM_Integer,
+ struct hdd_config, beacon_reporting,
+ VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+ CFG_NTH_BEACON_REPORTING_OFFLOAD_DEFAULT,
+ CFG_NTH_BEACON_REPORTING_OFFLOAD_MIN,
+ CFG_NTH_BEACON_REPORTING_OFFLOAD_MAX),
};
/**
@@ -7836,6 +7844,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
pHddCtx->config->btm_sticky_time);
hdd_debug("Name = [btm_query_bitmask] value = [0x%x]",
pHddCtx->config->btm_query_bitmask);
+ hdd_debug("Name = [%s] value = [%u]",
+ CFG_NTH_BEACON_REPORTING_OFFLOAD_NAME,
+ pHddCtx->config->beacon_reporting);
}
/**
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index eda121ceee7c..9f1d4b8dd62a 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -13467,6 +13467,35 @@ void hdd_pld_ipa_uc_shutdown_pipes(void)
hdd_ipa_uc_force_pipe_shutdown(hdd_ctx);
}
+#ifdef NTH_BEACON_OFFLOAD
+/**
+ * hdd_set_nth_beacon_offload() - Send the nth beacon offload command to FW
+ * @adapter: HDD adapter
+ * @value: Value of n, for which the nth beacon will be forwarded by the FW
+ *
+ * Return: QDF_STATUS_SUCCESS on success and failure status on failure
+ */
+QDF_STATUS hdd_set_nth_beacon_offload(hdd_adapter_t *adapter, uint16_t value)
+{
+ int ret;
+
+ ret = sme_cli_set_command(adapter->sessionId,
+ WMI_VDEV_PARAM_NTH_BEACON_TO_HOST,
+ value, VDEV_CMD);
+ if (ret) {
+ hdd_err("WMI_VDEV_PARAM_NTH_BEACON_TO_HOST %d", ret);
+ return QDF_STATUS_E_FAILURE;
+ }
+
+ return QDF_STATUS_SUCCESS;
+}
+#else
+QDF_STATUS hdd_set_nth_beacon_offload(hdd_adapter_t *adapter, uint16_t value)
+{
+ return QDF_STATUS_SUCCESS;
+}
+#endif
+
/**
* hdd_start_driver_ops_timer() - Starts driver ops inactivity timer
* @drv_op: Enum indicating driver op