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
This commit is contained in:

committed by
Rahul Choudhary

parent
b4834eb736
commit
588192efbd
@@ -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
|
||||
|
@@ -2054,7 +2054,6 @@ _conditional_srcs = {
|
||||
"components/umac/mlme/sap/ll_sap/core/src/wlan_ll_sap_main.c",
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
def _define_module_for_target_variant_chipset(target, variant, chipset):
|
||||
@@ -2081,6 +2080,66 @@ 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)],
|
||||
@@ -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,
|
||||
|
Reference in New Issue
Block a user