summaryrefslogtreecommitdiffstats
path: root/libwifi_hal
diff options
context:
space:
mode:
authorChristopher Wiley <wiley@google.com>2016-06-15 12:54:12 -0700
committerChristopher Wiley <wiley@google.com>2016-06-16 10:17:14 -0700
commit189a1eff9eef200cab7a61e5bf6e9865bfa46ce4 (patch)
tree18c29c91d8bcf2ce53750f02525bfc4c138e1d98 /libwifi_hal
parent051a0607b6b2f1ad058f048e2a104e4ebe36c730 (diff)
downloadandroid_frameworks_opt_net_wifi-189a1eff9eef200cab7a61e5bf6e9865bfa46ce4.tar.gz
android_frameworks_opt_net_wifi-189a1eff9eef200cab7a61e5bf6e9865bfa46ce4.tar.bz2
android_frameworks_opt_net_wifi-189a1eff9eef200cab7a61e5bf6e9865bfa46ce4.zip
Wrap vendor provided HAL in libwifi-hal
While here, fix the include paths so that we explicitly refer to the headers in hardware_legacy. Bug: 29396611 Test: Compiles, can associate to an AP on angler/bullhead Test: runtest frameworks-wifi continues to pass Change-Id: Ic76ce613b80eb9b3200699c5e1dd083a43e2b1c5
Diffstat (limited to 'libwifi_hal')
-rw-r--r--libwifi_hal/Android.mk65
-rw-r--r--libwifi_hal/wifi_hal_fallback.cpp21
2 files changed, 86 insertions, 0 deletions
diff --git a/libwifi_hal/Android.mk b/libwifi_hal/Android.mk
new file mode 100644
index 000000000..e83c25e47
--- /dev/null
+++ b/libwifi_hal/Android.mk
@@ -0,0 +1,65 @@
+# Copyright (C) 2016 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH := $(call my-dir)
+ifneq ($(TARGET_BUILD_PDK), true)
+
+# A fallback "vendor" HAL library.
+# Don't link this, link libwifi-hal.
+# ============================================================
+include $(CLEAR_VARS)
+LOCAL_MODULE := libwifi-hal-fallback
+LOCAL_CFLAGS := \
+ -Wall \
+ -Werror \
+ -Wextra \
+ -Winit-self \
+ -Wno-unused-function \
+ -Wno-unused-parameter \
+ -Wshadow \
+ -Wunused-variable \
+ -Wwrite-strings
+LOCAL_SRC_FILES := wifi_hal_fallback.cpp
+LOCAL_C_INCLUDES := $(call include-path-for, libhardware_legacy)
+include $(BUILD_STATIC_LIBRARY)
+
+# Pick a vendor provided HAL implementation library.
+# ============================================================
+LIB_WIFI_HAL := libwifi-hal-fallback
+ifeq ($(BOARD_WLAN_DEVICE), bcmdhd)
+ LIB_WIFI_HAL := libwifi-hal-bcm
+else ifeq ($(BOARD_WLAN_DEVICE), qcwcn)
+ LIB_WIFI_HAL := libwifi-hal-qcom
+else ifeq ($(BOARD_WLAN_DEVICE), mrvl)
+ # this is commented because none of the nexus devices
+ # that sport Marvell's wifi have support for HAL
+ # LIB_WIFI_HAL := libwifi-hal-mrvl
+else ifeq ($(BOARD_WLAN_DEVICE), MediaTek)
+ # support MTK WIFI HAL
+ LIB_WIFI_HAL := libwifi-hal-mt66xx
+endif
+
+# The WiFi HAL that you should be linking.
+# ============================================================
+include $(CLEAR_VARS)
+LOCAL_MODULE := libwifi-hal
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(call include-path-for, libhardware_legacy)
+LOCAL_SHARED_LIBRARIES := \
+ liblog \
+ libnl \
+ libutils
+LOCAL_WHOLE_STATIC_LIBRARIES := $(LIB_WIFI_HAL)
+include $(BUILD_SHARED_LIBRARY)
+
+endif
diff --git a/libwifi_hal/wifi_hal_fallback.cpp b/libwifi_hal/wifi_hal_fallback.cpp
new file mode 100644
index 000000000..64259a11d
--- /dev/null
+++ b/libwifi_hal/wifi_hal_fallback.cpp
@@ -0,0 +1,21 @@
+/*
+ * Copyright 2016, The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "hardware_legacy/wifi_hal.h"
+
+wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn) {
+ return WIFI_ERROR_NOT_SUPPORTED;
+}