Эх сурвалжийг харах

qcacld-3.0: Add grep functionality bazel

Current wlan bazel implementation does not
support grep of source code.
Fix this by adding grep functionality.

Change-Id: I0649577424fbd095524d9c1083c3515c682723e2
CRs-Fixed: 3572350
Mohammed Ahmed 1 жил өмнө
parent
commit
588192efbd

+ 0 - 5
configs/pineapple_gki_kiwi-v2_defconfig

@@ -354,11 +354,8 @@ CONFIG_WMI_INTERFACE_EVENT_LOGGING=y
 CONFIG_WMI_ROAM_SUPPORT=y
 CONFIG_WMI_SEND_RECV_QMI=y
 CONFIG_WMI_STA_SUPPORT=y
-CONFIG_CFG80211_RU_PUNCT_NOTIFY=y
-CONFIG_CFG80211_MLO_KEY_OPERATION_SUPPORT=y
 CONFIG_CFG80211_EXTERNAL_AUTH_MLO_SUPPORT=y
 CONFIG_CFG80211_EXT_FEATURE_SECURE_NAN=y
-CONFIG_CFG80211_LINK_STA_PARAMS_PRESENT=y
 CONFIG_WLAN_CTRL_NAME="wlan"
 CONFIG_MULTI_IF_NAME="kiwi_v2"
 CONFIG_NL80211_TESTMODE=y
@@ -378,9 +375,7 @@ CONFIG_DP_MULTIPASS_SUPPORT=y
 CONFIG_WLAN_DP_VDEV_NO_SELF_PEER=y
 CONFIG_WLAN_FEATURE_AFFINITY_MGR=y
 CONFIG_WALT_GET_CPU_TAKEN_SUPPORT=y
-CONFIG_NL80211_EXT_FEATURE_PUNCT_SUPPORT=y
 CONFIG_DP_MLO_LINK_STATS_SUPPORT=y
-CONFIG_CFG80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA=y
 CONFIG_HIF_DEBUG=y
 CONFIG_WLAN_OBJMGR_DEBUG=y
 CONFIG_WLAN_OBJMGR_REF_ID_TRACE=y

+ 84 - 25
wlan_qcacld3_modules.bzl

@@ -1495,13 +1495,13 @@ _conditional_srcs = {
         ],
     },
     #"LEGACY_CONFIG_WLAN_FASTPATH": {
-        #True: [
-        #    "core/dp/txrx/ol_tx_ll_fastpath.c",
-        #],
-	#TODO: Will need to create a separate flag to handle false case
-        #False: [
-        #    "core/dp/txrx/ol_tx_ll_legacy.c",
-        #],
+    #True: [
+    #    "core/dp/txrx/ol_tx_ll_fastpath.c",
+    #],
+    #TODO: Will need to create a separate flag to handle false case
+    #False: [
+    #    "core/dp/txrx/ol_tx_ll_legacy.c",
+    #],
     #},
     "CONFIG_WLAN_FEATURE_11AX": {
         True: [
@@ -1746,7 +1746,7 @@ _conditional_srcs = {
             "os_if/twt/src/osif_twt_ext_util.c",
             # TODO: rest being removed by David's TWT change
             #            "components/mlme/core/src/wlan_mlme_twt_api.c",
-	    # TODO: to be removed by David's TWT change
+            # TODO: to be removed by David's TWT change
             "components/mlme/dispatcher/src/wlan_mlme_twt_ucfg_api.c",
             "core/wma/src/wma_twt.c",
         ],
@@ -2049,12 +2049,11 @@ _conditional_srcs = {
     },
     "CONFIG_WLAN_FEATURE_LL_LT_SAP": {
         True: [
-           "components/umac/mlme/sap/ll_sap/dispatcher/src/wlan_ll_sap_ucfg_api.c",
-           "components/umac/mlme/sap/ll_sap/core/src/wlan_ll_lt_sap_main.c",
-           "components/umac/mlme/sap/ll_sap/core/src/wlan_ll_sap_main.c",
+            "components/umac/mlme/sap/ll_sap/dispatcher/src/wlan_ll_sap_ucfg_api.c",
+            "components/umac/mlme/sap/ll_sap/core/src/wlan_ll_lt_sap_main.c",
+            "components/umac/mlme/sap/ll_sap/core/src/wlan_ll_sap_main.c",
         ],
     },
-
 }
 
 def _define_module_for_target_variant_chipset(target, variant, chipset):
@@ -2081,29 +2080,89 @@ def _define_module_for_target_variant_chipset(target, variant, chipset):
         copts.append("-include")
         copts.append(i)
 
+    feature_grep_map = [
+        {
+            "pattern": "walt_get_cpus_taken",
+            "file": "kernel/sched/walt/walt.c",
+            "flag": "WALT_GET_CPU_TAKEN_SUPPORT",
+        },
+        {
+            "pattern": "nl80211_validate_key_link_id",
+            "file": "net/wireless/nl80211.c",
+            "flag": "CFG80211_MLO_KEY_OPERATION_SUPPORT",
+        },
+        {
+            "pattern": "struct link_station_parameters",
+            "file": "include/net/cfg80211.h",
+            "flag": "CFG80211_LINK_STA_PARAMS_PRESENT",
+        },
+        {
+            "pattern": "NL80211_EXT_FEATURE_PUNCT",
+            "file": "include/uapi/linux/nl80211.h",
+            "flag": "NL80211_EXT_FEATURE_PUNCT_SUPPORT",
+        },
+        {
+            "pattern": "unsigned int link_id, u16 punct_bitmap",
+            "file": "include/net/cfg80211.h",
+            "flag": "CFG80211_RU_PUNCT_NOTIFY",
+        },
+        {
+            "pattern": "NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA",
+            "file": "include/uapi/linux/nl80211.h",
+            "flag": "CFG80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA",
+        },
+    ]
+
+    cmd = 'touch "$@"\n'
+    for feature_grep in feature_grep_map:
+        cmd += """
+          if grep -qF "{pattern}" $(location //msm-kernel:{file}); then
+            echo "#define {flag} (1)" >> "$@"
+          fi
+        """.format(
+            pattern = feature_grep["pattern"],
+            file = feature_grep["file"],
+            flag = feature_grep["flag"],
+        )
+
+    grepSrcFiles = []
+    for e in feature_grep_map:
+        grepSrcFiles.append("//msm-kernel:{}".format(e["file"]))
+
+    depsetSrc = depset(grepSrcFiles)
+    native.genrule(
+        name = "{}_grep_defines".format(tvc),
+        outs = ["configs/grep_defines_{}.h".format(tvc)],
+        srcs = depsetSrc.to_list(),
+        cmd = cmd,
+    )
+
+    copts.append("-include")
+    copts.append("$(location :{}_grep_defines)".format(tvc))
+
     native.genrule(
         name = "configs/{}_defconfig_generate_consolidate".format(tvc),
         outs = ["configs/{}_defconfig.generated_consolidate".format(tvc)],
-	srcs = [
-		"configs/{}_gki_{}_defconfig".format(target,chipset),
-		"configs/{}_consolidate_{}_defconfig".format(target,chipset),
-	],
-	cmd = "cat $(SRCS) > $@",
+        srcs = [
+            "configs/{}_gki_{}_defconfig".format(target, chipset),
+            "configs/{}_consolidate_{}_defconfig".format(target, chipset),
+        ],
+        cmd = "cat $(SRCS) > $@",
     )
     native.genrule(
         name = "configs/{}_defconfig_generate_gki".format(tvc),
         outs = ["configs/{}_defconfig.generated_gki".format(tvc)],
-	srcs = [
-		"configs/{}_gki_{}_defconfig".format(target,chipset),
-	],
-	cmd = "cat $(SRCS) > $@",
+        srcs = [
+            "configs/{}_gki_{}_defconfig".format(target, chipset),
+        ],
+        cmd = "cat $(SRCS) > $@",
     )
 
     srcs = native.glob(iglobs) + _fixed_srcs
 
     out = "qca_cld3_{}.ko".format(chipset.replace("-", "_"))
     kconfig = "Kconfig"
-    defconfig = ":configs/{}_defconfig_generate_{}".format(tvc,variant)
+    defconfig = ":configs/{}_defconfig_generate_{}".format(tvc, variant)
 
     print("name=", name)
     print("hw=", hw)
@@ -2117,7 +2176,7 @@ def _define_module_for_target_variant_chipset(target, variant, chipset):
 
     ddk_module(
         name = name,
-        srcs = srcs,
+        srcs = srcs + [":{}_grep_defines".format(tvc)],
         includes = ipaths + ["."],
         kconfig = kconfig,
         defconfig = defconfig,
@@ -2132,8 +2191,8 @@ def _define_module_for_target_variant_chipset(target, variant, chipset):
             "//vendor/qcom/opensource/wlan/platform:{}_cnss_nl".format(tv),
             "//msm-kernel:all_headers",
             "//vendor/qcom/opensource/wlan/platform:wlan-platform-headers",
-	    "//vendor/qcom/opensource/dataipa:include_headers",
-	    "//vendor/qcom/opensource/dataipa:{}_{}_ipam".format(target, variant),
+            "//vendor/qcom/opensource/dataipa:include_headers",
+            "//vendor/qcom/opensource/dataipa:{}_{}_ipam".format(target, variant),
         ],
     )