cnss2: add support to enable wlan module based on target
Add support to enable wlan module based on target. Change-Id: I43e6adce83ec0657604a00c953a18bb675f05a8c CRs-Fixed: 3577272
This commit is contained in:

committed by
Rahul Choudhary

parent
882ac969c2
commit
dca762d821
@@ -2,26 +2,32 @@ load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir")
|
|||||||
load("//build/kernel/kleaf:kernel.bzl", "ddk_module")
|
load("//build/kernel/kleaf:kernel.bzl", "ddk_module")
|
||||||
load("//msm-kernel:target_variants.bzl", "get_all_variants")
|
load("//msm-kernel:target_variants.bzl", "get_all_variants")
|
||||||
|
|
||||||
_module_enablement_map = {
|
_default_module_enablement_list = [
|
||||||
# "ALL" will enable for all target/variant combos
|
"cnss_nl",
|
||||||
"cnss2": ["ALL"],
|
"cnss_prealloc",
|
||||||
# Empty list disables the module build
|
"cnss_utils",
|
||||||
"icnss2": [],
|
"wlan_firmware_service"
|
||||||
"cnss_nl": ["ALL"],
|
]
|
||||||
"cnss_prealloc": ["ALL"],
|
|
||||||
"cnss_utils": ["ALL"],
|
_cnss2_enabled_target = ["pineapple"]
|
||||||
"wlan_firmware_service": ["ALL"],
|
_icnss2_enabled_target = ["blair"]
|
||||||
"cnss_plat_ipc_qmi_svc": ["ALL"],
|
|
||||||
}
|
|
||||||
|
|
||||||
def _get_module_list(target, variant):
|
def _get_module_list(target, variant):
|
||||||
tv = "{}_{}".format(target, variant)
|
tv = "{}_{}".format(target, variant)
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
for (mod, enabled_platforms) in _module_enablement_map.items():
|
is_wlan_platform_enabled = False
|
||||||
if "ALL" in enabled_platforms or tv in enabled_platforms:
|
|
||||||
ret.append(mod)
|
if target in _cnss2_enabled_target:
|
||||||
continue
|
ret.extend(["cnss2", "cnss_plat_ipc_qmi_svc"])
|
||||||
|
is_wlan_platform_enabled = True
|
||||||
|
|
||||||
|
if target in _icnss2_enabled_target:
|
||||||
|
ret.extend(["icnss2"])
|
||||||
|
is_wlan_platform_enabled = True
|
||||||
|
|
||||||
|
if is_wlan_platform_enabled:
|
||||||
|
ret.extend(_default_module_enablement_list)
|
||||||
|
|
||||||
return [":{}_{}".format(tv, mod) for mod in ret]
|
return [":{}_{}".format(tv, mod) for mod in ret]
|
||||||
|
|
||||||
@@ -29,79 +35,92 @@ def _get_module_list(target, variant):
|
|||||||
def _define_modules_for_target_variant(target, variant):
|
def _define_modules_for_target_variant(target, variant):
|
||||||
tv = "{}_{}".format(target, variant)
|
tv = "{}_{}".format(target, variant)
|
||||||
|
|
||||||
ddk_module(
|
cnss2_enabled = 0
|
||||||
name = "{}_cnss2".format(tv),
|
plat_ipc_qmi_svc_enabled = 0
|
||||||
srcs = native.glob([
|
icnss2_enabled = 0
|
||||||
"cnss2/main.c",
|
|
||||||
"cnss2/bus.c",
|
|
||||||
"cnss2/debug.c",
|
|
||||||
"cnss2/pci.c",
|
|
||||||
"cnss2/pci_platform.h",
|
|
||||||
"cnss2/power.c",
|
|
||||||
"cnss2/genl.c",
|
|
||||||
"cnss2/*.h",
|
|
||||||
"cnss_utils/*.h",
|
|
||||||
]),
|
|
||||||
includes = ["cnss", "cnss_utils"],
|
|
||||||
kconfig = "cnss2/Kconfig",
|
|
||||||
defconfig = "cnss2/{}_defconfig".format(tv),
|
|
||||||
conditional_srcs = {
|
|
||||||
"CONFIG_CNSS2_QMI": {
|
|
||||||
True: [
|
|
||||||
"cnss2/qmi.c",
|
|
||||||
"cnss2/coexistence_service_v01.c",
|
|
||||||
"cnss2/ip_multimedia_subsystem_private_service_v01.c",
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"CONFIG_PCI_MSM": {
|
|
||||||
True: [
|
|
||||||
"cnss2/pci_qcom.c",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
out = "cnss2.ko",
|
|
||||||
kernel_build = "//msm-kernel:{}".format(tv),
|
|
||||||
deps = [
|
|
||||||
"//vendor/qcom/opensource/securemsm-kernel:{}_smcinvoke_dlkm".format(tv),
|
|
||||||
":{}_cnss_utils".format(tv),
|
|
||||||
":{}_cnss_prealloc".format(tv),
|
|
||||||
":{}_wlan_firmware_service".format(tv),
|
|
||||||
":{}_cnss_plat_ipc_qmi_svc".format(tv),
|
|
||||||
"//msm-kernel:all_headers",
|
|
||||||
":wlan-platform-headers",
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
ddk_module(
|
if target in _cnss2_enabled_target:
|
||||||
name = "{}_icnss2".format(tv),
|
cnss2_enabled = 1
|
||||||
srcs = native.glob([
|
plat_ipc_qmi_svc_enabled = 1
|
||||||
"icnss2/main.c",
|
|
||||||
"icnss2/debug.c",
|
if target in _icnss2_enabled_target:
|
||||||
"icnss2/power.c",
|
icnss2_enabled = 1
|
||||||
"icnss2/genl.c",
|
|
||||||
"icnss2/*.h",
|
if cnss2_enabled:
|
||||||
"cnss_utils/*.h",
|
ddk_module(
|
||||||
]),
|
name = "{}_cnss2".format(tv),
|
||||||
includes = ["icnss2", "cnss_utils"],
|
srcs = native.glob([
|
||||||
kconfig = "icnss2/Kconfig",
|
"cnss2/main.c",
|
||||||
defconfig = "icnss2/{}_defconfig".format(tv),
|
"cnss2/bus.c",
|
||||||
conditional_srcs = {
|
"cnss2/debug.c",
|
||||||
"CONFIG_ICNSS2_QMI": {
|
"cnss2/pci.c",
|
||||||
True: [
|
"cnss2/pci_platform.h",
|
||||||
"icnss2/qmi.c",
|
"cnss2/power.c",
|
||||||
],
|
"cnss2/genl.c",
|
||||||
|
"cnss2/*.h",
|
||||||
|
"cnss_utils/*.h",
|
||||||
|
]),
|
||||||
|
includes = ["cnss", "cnss_utils"],
|
||||||
|
kconfig = "cnss2/Kconfig",
|
||||||
|
defconfig = "cnss2/{}_defconfig".format(tv),
|
||||||
|
conditional_srcs = {
|
||||||
|
"CONFIG_CNSS2_QMI": {
|
||||||
|
True: [
|
||||||
|
"cnss2/qmi.c",
|
||||||
|
"cnss2/coexistence_service_v01.c",
|
||||||
|
"cnss2/ip_multimedia_subsystem_private_service_v01.c",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"CONFIG_PCI_MSM": {
|
||||||
|
True: [
|
||||||
|
"cnss2/pci_qcom.c",
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
out = "cnss2.ko",
|
||||||
out = "icnss2.ko",
|
kernel_build = "//msm-kernel:{}".format(tv),
|
||||||
kernel_build = "//msm-kernel:{}".format(tv),
|
deps = [
|
||||||
deps = [
|
"//vendor/qcom/opensource/securemsm-kernel:{}_smcinvoke_dlkm".format(tv),
|
||||||
":{}_cnss_utils".format(tv),
|
":{}_cnss_utils".format(tv),
|
||||||
":{}_cnss_prealloc".format(tv),
|
":{}_cnss_prealloc".format(tv),
|
||||||
":{}_wlan_firmware_service".format(tv),
|
":{}_wlan_firmware_service".format(tv),
|
||||||
"//msm-kernel:all_headers",
|
":{}_cnss_plat_ipc_qmi_svc".format(tv),
|
||||||
":wlan-platform-headers",
|
"//msm-kernel:all_headers",
|
||||||
],
|
":wlan-platform-headers",
|
||||||
)
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
if icnss2_enabled:
|
||||||
|
ddk_module(
|
||||||
|
name = "{}_icnss2".format(tv),
|
||||||
|
srcs = native.glob([
|
||||||
|
"icnss2/main.c",
|
||||||
|
"icnss2/debug.c",
|
||||||
|
"icnss2/power.c",
|
||||||
|
"icnss2/genl.c",
|
||||||
|
"icnss2/*.h",
|
||||||
|
"cnss_utils/*.h",
|
||||||
|
]),
|
||||||
|
includes = ["icnss2", "cnss_utils"],
|
||||||
|
kconfig = "icnss2/Kconfig",
|
||||||
|
defconfig = "icnss2/{}_defconfig".format(tv),
|
||||||
|
conditional_srcs = {
|
||||||
|
"CONFIG_ICNSS2_QMI": {
|
||||||
|
True: [
|
||||||
|
"icnss2/qmi.c",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
out = "icnss2.ko",
|
||||||
|
kernel_build = "//msm-kernel:{}".format(tv),
|
||||||
|
deps = [
|
||||||
|
":{}_cnss_utils".format(tv),
|
||||||
|
":{}_cnss_prealloc".format(tv),
|
||||||
|
":{}_wlan_firmware_service".format(tv),
|
||||||
|
"//msm-kernel:all_headers",
|
||||||
|
":wlan-platform-headers",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
ddk_module(
|
ddk_module(
|
||||||
name = "{}_cnss_nl".format(tv),
|
name = "{}_cnss_nl".format(tv),
|
||||||
@@ -165,19 +184,20 @@ def _define_modules_for_target_variant(target, variant):
|
|||||||
deps = ["//msm-kernel:all_headers"],
|
deps = ["//msm-kernel:all_headers"],
|
||||||
)
|
)
|
||||||
|
|
||||||
ddk_module(
|
if plat_ipc_qmi_svc_enabled:
|
||||||
name = "{}_cnss_plat_ipc_qmi_svc".format(tv),
|
ddk_module(
|
||||||
srcs = native.glob([
|
name = "{}_cnss_plat_ipc_qmi_svc".format(tv),
|
||||||
"cnss_utils/cnss_plat_ipc_qmi.c",
|
srcs = native.glob([
|
||||||
"cnss_utils/cnss_plat_ipc_service_v01.c",
|
"cnss_utils/cnss_plat_ipc_qmi.c",
|
||||||
"cnss_utils/*.h"
|
"cnss_utils/cnss_plat_ipc_service_v01.c",
|
||||||
]),
|
"cnss_utils/*.h"
|
||||||
kconfig = "cnss_utils/Kconfig",
|
]),
|
||||||
defconfig = "cnss_utils/{}_defconfig".format(tv),
|
kconfig = "cnss_utils/Kconfig",
|
||||||
out = "cnss_plat_ipc_qmi_svc.ko",
|
defconfig = "cnss_utils/{}_defconfig".format(tv),
|
||||||
kernel_build = "//msm-kernel:{}".format(tv),
|
out = "cnss_plat_ipc_qmi_svc.ko",
|
||||||
deps = ["//msm-kernel:all_headers"],
|
kernel_build = "//msm-kernel:{}".format(tv),
|
||||||
)
|
deps = ["//msm-kernel:all_headers"],
|
||||||
|
)
|
||||||
|
|
||||||
copy_to_dist_dir(
|
copy_to_dist_dir(
|
||||||
name = "{}_modules_dist".format(tv),
|
name = "{}_modules_dist".format(tv),
|
||||||
|
Reference in New Issue
Block a user