From 59ba89e0d0fb48cda14bfe42713fca60c0e00eb6 Mon Sep 17 00:00:00 2001 From: Paul Keith Date: Tue, 7 Feb 2017 12:30:45 -0600 Subject: macloader: Allow overriding non-standard paths * Follow the rest of the hals Change-Id: Ib3bf92b3e975d96586802a1473c589fc9536ad40 Signed-off-by: Paul Keith --- macloader/Android.mk | 10 ++------- macloader/include/samsung_macloader.h | 40 +++++++++++++++++++++++++++++++++++ macloader/macloader.c | 12 ++--------- 3 files changed, 44 insertions(+), 18 deletions(-) create mode 100644 macloader/include/samsung_macloader.h (limited to 'macloader') 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 * Marco Hillenbrand + * 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 -#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 enum Type { NONE, -- cgit v1.2.3