1// Copyright (C) 2011 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// See: http://go/android-license-faq
16package {
17    default_applicable_licenses: ["wlan_legacy_qcwcn_license"],
18}
19
20license {
21    name: "wlan_legacy_qcwcn_license",
22    visibility: [":__subpackages__"],
23    license_kinds: [
24        "SPDX-license-identifier-Apache-2.0",
25        "SPDX-license-identifier-BSD",
26    ],
27}
28
29cc_library_shared {
30    name: "libwifi-hal-ctrl",
31    vendor: true,
32    cflags: [
33        "-Wno-unused-parameter",
34        "-Wall",
35        "-Werror",
36    ],
37    local_include_dirs: ["wifi_hal_ctrl"],
38    srcs: ["wifi_hal_ctrl/wifi_hal_ctrl.c"],
39    header_libs: ["libcutils_headers"],
40}
41
42cc_library_headers {
43    name: "libwifi-hal-ctrl_headers",
44    vendor: true,
45    export_include_dirs: ["wifi_hal_ctrl"],
46    header_libs: ["libcutils_headers"],
47}
48
49soong_config_module_type {
50    name: "wifi_hal_cc_defaults",
51    module_type: "cc_defaults",
52    config_namespace: "wifi",
53    value_variables: [
54        "driver_state_ctrl_param", // WIFI_DRIVER_STATE_CTRL_PARAM
55        "driver_state_on", // WIFI_DRIVER_STATE_ON
56    ],
57    properties: [
58        "cflags",
59        "cppflags",
60    ],
61}
62
63wifi_hal_cc_defaults {
64    name: "libwifi-hal-qcom-defaults",
65    soong_config_variables: {
66        driver_state_ctrl_param: {
67            cflags: ["-DWIFI_DRIVER_STATE_CTRL_PARAM=%s"],
68        },
69        driver_state_on: {
70            cflags: ["-DWIFI_DRIVER_STATE_ON=%s"],
71        },
72    },
73}
74
75// Make the HAL library
76// ============================================================
77cc_library {
78    name: "libwifi-hal-qcom",
79    vendor: true,
80    defaults: [
81        "libwifi-hal-qcom-defaults",
82    ],
83    cflags: [
84        "-Wno-unused-parameter",
85        "-Wall",
86        "-Werror",
87        // gscan.cpp: address of array 'cached_results[i].results' will always evaluate to 'true'
88        "-Wno-pointer-bool-conversion",
89        // Allow implicit fallthrough in nan_ind.cpp:834 until it is fixed
90        "-Wno-implicit-fallthrough",
91    ],
92    product_variables: {
93        debuggable: {
94            cflags: ["-DLOG_NDEBUG=0"],
95        },
96    },
97    header_libs: [
98        "libcutils_headers",
99        "libnetlink_iface_headers",
100        "libutils_headers",
101        "libwifi-hal-ctrl_headers",
102        "wifi_legacy_headers",
103    ],
104    local_include_dirs: ["."],
105    srcs: [
106        "common.cpp",
107        "cpp_bindings.cpp",
108        "gscan_event_handler.cpp",
109        "gscan.cpp",
110        "ifaceeventhandler.cpp",
111        "list.cpp",
112        "llstats.cpp",
113        "nan_ind.cpp",
114        "nan_req.cpp",
115        "nan_rsp.cpp",
116        "nan.cpp",
117        "radio_mode.cpp",
118        "rb_wrapper.cpp",
119        "ring_buffer.cpp",
120        "roam.cpp",
121        "rssi_monitor.cpp",
122        "rtt.cpp",
123        "tdls.cpp",
124        "wifi_hal.cpp",
125        "wificonfig.cpp",
126        "wifilogger_diag.cpp",
127        "wifilogger.cpp",
128    ],
129    shared_libs: [
130        "libcld80211",
131        "libnetutils",
132        "liblog",
133        "libnl",
134    ],
135}
136