ソースを参照

qcacld-3.0: Add go_ignore_non_p2p_probe_req in probe rsp template

Add config to enable go ignore non-p2p probe req feature. If set,
don't need to send probe rsp to STA, hence save power.

Change-Id: I8b4776e4ffd1315bf30e210797b22a673cf2a6c2
CRs-Fixed: 3812361
Jianmin Zhu 1 年間 前
コミット
dcb8aef352

+ 4 - 1
components/p2p/core/src/wlan_p2p_main.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. 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
@@ -555,6 +555,9 @@ static QDF_STATUS p2p_object_init_params(
 			cfg_get(psoc, CFG_ACTION_FRAME_RANDOM_SEQ_NUM_ENABLED);
 	p2p_soc_obj->param.indoor_channel_support =
 			cfg_get(psoc, CFG_P2P_GO_ON_5GHZ_INDOOR_CHANNEL);
+	p2p_soc_obj->param.go_ignore_non_p2p_probe_req =
+			cfg_get(psoc, CFG_GO_IGNORE_NON_P2P_PROBE_REQ);
+
 	return QDF_STATUS_SUCCESS;
 }
 

+ 3 - 1
components/p2p/core/src/wlan_p2p_main.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. 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
@@ -213,6 +213,7 @@ void p2p_status_update(struct p2p_soc_priv_obj *p2p_soc_obj,
  * @skip_dfs_channel_p2p_search:    skip DFS Channel in case of P2P Search
  * @is_random_seq_num_enabled:      Flag to generate random sequence numbers
  * @indoor_channel_support:         support to allow GO in indoor channels
+ * @go_ignore_non_p2p_probe_req:    P2P GO ignore non-P2P probe req
  */
 struct p2p_param {
 	uint32_t go_keepalive_period;
@@ -220,6 +221,7 @@ struct p2p_param {
 	bool p2p_device_addr_admin;
 	bool is_random_seq_num_enabled;
 	bool indoor_channel_support;
+	bool go_ignore_non_p2p_probe_req;
 };
 
 /**

+ 26 - 2
components/p2p/dispatcher/inc/cfg_p2p.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. 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
@@ -147,11 +147,35 @@
 					0, \
 					"Allow P2P GO on 5 GHz indoor channels")
 
+/*
+ * <ini>
+ * p2p_go_ignore_non_p2p_probe_req - P2P GO ignore non-P2P probe req
+ *
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable/disable P2P GO ignore non-P2P probe req and don't
+ * send probe rsp to non-p2p device like STA.
+ *
+ *
+ * Supported Feature: P2P GO
+ *
+ * Usage: external
+ *
+ * </ini>
+ */
+#define CFG_GO_IGNORE_NON_P2P_PROBE_REQ CFG_INI_BOOL(\
+					"go_ignore_non_p2p_probe_req", \
+					0, \
+					"P2P GO ignore non-P2P probe req")
+
 #define CFG_P2P_ALL \
 	CFG(CFG_ACTION_FRAME_RANDOM_SEQ_NUM_ENABLED) \
 	CFG(CFG_GO_KEEP_ALIVE_PERIOD) \
 	CFG(CFG_GO_LINK_MONITOR_PERIOD) \
 	CFG(CFG_P2P_DEVICE_ADDRESS_ADMINISTRATED) \
-	CFG(CFG_P2P_GO_ON_5GHZ_INDOOR_CHANNEL)
+	CFG(CFG_P2P_GO_ON_5GHZ_INDOOR_CHANNEL) \
+	CFG(CFG_GO_IGNORE_NON_P2P_PROBE_REQ)
 
 #endif

+ 9 - 0
components/p2p/dispatcher/inc/wlan_p2p_cfg_api.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. 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
@@ -70,4 +71,12 @@ cfg_p2p_get_device_addr_admin(struct wlan_objmgr_psoc *psoc,
  */
 bool cfg_p2p_is_roam_config_disabled(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * cfg_p2p_is_go_ignore_non_p2p_probe_req() - Is P2P GO ignore non-P2P probe
+ * req enabled
+ * @psoc:        pointer to psoc object
+ *
+ * If P2P GO ignore non-P2P probe req enabled, don't send probe rsp to STA
+ */
+bool cfg_p2p_is_go_ignore_non_p2p_probe_req(struct wlan_objmgr_psoc *psoc);
 #endif /* _WLAN_P2P_CFG_API_H_ */

+ 16 - 0
components/p2p/dispatcher/src/wlan_p2p_cfg.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. 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
@@ -97,3 +98,18 @@ bool cfg_p2p_is_roam_config_disabled(struct wlan_objmgr_psoc *psoc)
 
 	return false;
 }
+
+bool
+cfg_p2p_is_go_ignore_non_p2p_probe_req(struct wlan_objmgr_psoc *psoc)
+{
+	struct p2p_soc_priv_obj *p2p_soc_obj;
+
+	p2p_soc_obj = wlan_psoc_get_p2p_object(psoc);
+	if (!p2p_soc_obj) {
+		p2p_err("p2p psoc null");
+		return false;
+	}
+
+	return p2p_soc_obj->param.go_ignore_non_p2p_probe_req;
+}
+

+ 8 - 1
core/mac/src/pe/sch/sch_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. 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
@@ -51,6 +51,7 @@
 #include <target_if_vdev_mgr_tx_ops.h>
 #include <wlan_cmn_ieee80211.h>
 #include <wlan_mgmt_txrx_utils_api.h>
+#include <wlan_p2p_cfg_api.h>
 
 /* Fils Discovery Frame */
 /**
@@ -858,6 +859,12 @@ uint32_t lim_send_probe_rsp_template_to_hal(struct mac_context *mac,
 		pprobeRespParams->probeRespTemplateLen = nBytes;
 		qdf_mem_copy(pprobeRespParams->ucProxyProbeReqValidIEBmap,
 			     IeBitmap, (sizeof(uint32_t) * 8));
+		if (pe_session->opmode == QDF_P2P_GO_MODE &&
+		    cfg_p2p_is_go_ignore_non_p2p_probe_req(mac->psoc)) {
+			pe_debug("GO ignore non-P2P probe req");
+			pprobeRespParams->go_ignore_non_p2p_probe_req = true;
+		}
+
 		msgQ.type = WMA_SEND_PROBE_RSP_TMPL;
 		msgQ.reserved = 0;
 		msgQ.bodyptr = pprobeRespParams;

+ 2 - 0
core/wma/inc/wma_if.h

@@ -528,12 +528,14 @@ typedef struct {
  * @probeRespTemplate: probe response template
  * @probeRespTemplateLen: probe response template length
  * @ucProxyProbeReqValidIEBmap: valid IE bitmap
+ * @go_ignore_non_p2p_probe_req: go ignore non-p2p probe req
  */
 typedef struct sSendProbeRespParams {
 	tSirMacAddr bssId;
 	uint8_t probeRespTemplate[SIR_MAX_PROBE_RESP_SIZE];
 	uint32_t probeRespTemplateLen;
 	uint32_t ucProxyProbeReqValidIEBmap[8];
+	bool go_ignore_non_p2p_probe_req;
 } tSendProbeRespParams, *tpSendProbeRespParams;
 
 /**

+ 2 - 0
core/wma/src/wma_mgmt.c

@@ -2111,6 +2111,8 @@ static int wmi_unified_probe_rsp_tmpl_send(tp_wma_handle wma,
 
 	params.prb_rsp_template_len = probe_rsp_info->probeRespTemplateLen;
 	params.prb_rsp_template_frm = probe_rsp_info->probeRespTemplate;
+	params.go_ignore_non_p2p_probe_req =
+		probe_rsp_info->go_ignore_non_p2p_probe_req;
 
 	return wmi_unified_probe_rsp_tmpl_send_cmd(wma->wmi_handle, vdev_id,
 						   &params);