summaryrefslogtreecommitdiffstats
path: root/macloader
diff options
context:
space:
mode:
authorPaul Keith <javelinanddart@aidenswann.com>2017-02-07 12:30:45 -0600
committerPaul Keith <javelinanddart@aidenswann.com>2017-02-09 18:41:18 +0000
commit59ba89e0d0fb48cda14bfe42713fca60c0e00eb6 (patch)
tree4ecc45deeeed6c429a5a589c3336865a7747286c /macloader
parentcd60dd84b0afd1e3b6d6911a92f8cefc5dc1828e (diff)
downloadhardware_samsung-59ba89e0d0fb48cda14bfe42713fca60c0e00eb6.tar.gz
hardware_samsung-59ba89e0d0fb48cda14bfe42713fca60c0e00eb6.tar.bz2
hardware_samsung-59ba89e0d0fb48cda14bfe42713fca60c0e00eb6.zip
macloader: Allow overriding non-standard paths
* Follow the rest of the hals Change-Id: Ib3bf92b3e975d96586802a1473c589fc9536ad40 Signed-off-by: Paul Keith <javelinanddart@aidenswann.com>
Diffstat (limited to 'macloader')
-rw-r--r--macloader/Android.mk10
-rw-r--r--macloader/include/samsung_macloader.h40
-rw-r--r--macloader/macloader.c12
3 files changed, 44 insertions, 18 deletions
diff --git a/macloader/Android.mk b/macloader/Android.mk
index ee843be..dfb80ef 100644
--- a/macloader/Android.mk
+++ b/macloader/Android.mk
@@ -3,20 +3,14 @@ ifeq ($(BOARD_HAVE_SAMSUNG_WIFI),true)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
-ifdef WIFI_DRIVER_NVRAM_PATH
-LOCAL_CFLAGS += -DWIFI_DRIVER_NVRAM_PATH=\"$(WIFI_DRIVER_NVRAM_PATH)\"
-endif
-
-ifdef WIFI_DRIVER_NVRAM_PATH_PARAM
-LOCAL_CFLAGS += -DWIFI_DRIVER_NVRAM_PATH_PARAM=\"$(WIFI_DRIVER_NVRAM_PATH_PARAM)\"
-endif
-
LOCAL_SRC_FILES := \
macloader.c
LOCAL_SHARED_LIBRARIES := \
liblog libutils
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
+
LOCAL_MODULE := macloader
LOCAL_MODULE_TAGS := optional
diff --git a/macloader/include/samsung_macloader.h b/macloader/include/samsung_macloader.h
new file mode 100644
index 0000000..8a77033
--- /dev/null
+++ b/macloader/include/samsung_macloader.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2017 The LineageOS 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.
+ */
+
+#ifndef SAMSUNG_MACLOADER_H
+#define SAMSUNG_MACLOADER_H
+
+/*
+ * Board specific nodes
+ *
+ * If your kernel exposes these controls in another place, you can either
+ * symlink to the locations given here, or override this header in your
+ * device tree.
+ */
+
+/* NVRAM calibration, NULL if calibration unneeded */
+#define WIFI_DRIVER_NVRAM_PATH NULL
+
+/* NVRAM calibration parameters */
+#define WIFI_DRIVER_NVRAM_PATH_PARAM "/sys/module/wlan/parameters/nvram_path"
+
+/* Physical address (MAC) */
+#define MACADDR_PATH "/efs/wifi/.mac.info"
+
+/* Consumer identification number (CID) */
+#define CID_PATH "/data/.cid.info"
+
+#endif // SAMSUNG_MACLOADER_H
diff --git a/macloader/macloader.c b/macloader/macloader.c
index e436900..b20c848 100644
--- a/macloader/macloader.c
+++ b/macloader/macloader.c
@@ -2,6 +2,7 @@
* Copyright (C) 2012, The CyanogenMod Project
* Daniel Hillenbrand <codeworkx@cyanogenmod.com>
* Marco Hillenbrand <marco.hillenbrand@googlemail.com>
+ * Copyright (C) 2017, The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,16 +32,7 @@
#include <cutils/log.h>
-#ifndef WIFI_DRIVER_NVRAM_PATH
-#define WIFI_DRIVER_NVRAM_PATH NULL
-#endif
-
-#ifndef WIFI_DRIVER_NVRAM_PATH_PARAM
-#define WIFI_DRIVER_NVRAM_PATH_PARAM "/sys/module/wlan/parameters/nvram_path"
-#endif
-
-#define MACADDR_PATH "/efs/wifi/.mac.info"
-#define CID_PATH "/data/.cid.info"
+#include <samsung_macloader.h>
enum Type {
NONE,