diff options
author | Alexander Tarasikov <alexander.tarasikov@gmail.com> | 2012-08-23 01:21:52 +0400 |
---|---|---|
committer | Alexander Tarasikov <alexander.tarasikov@gmail.com> | 2012-08-23 01:21:52 +0400 |
commit | 6e6ad0dd8a929d6816284dccce13898c4a30fbe5 (patch) | |
tree | 30ec62eef7da2fd404db95f26362121305a22368 | |
parent | ea4e5b66893aae8d9eca97cbbc0a46b9c5b4d256 (diff) | |
download | hardware_ril_samsung-ril-6e6ad0dd8a929d6816284dccce13898c4a30fbe5.zip hardware_ril_samsung-ril-6e6ad0dd8a929d6816284dccce13898c4a30fbe5.tar.gz hardware_ril_samsung-ril-6e6ad0dd8a929d6816284dccce13898c4a30fbe5.tar.bz2 |
Add the compat.h header to multiple Android trees
-rw-r--r-- | Android.mk | 12 | ||||
-rw-r--r-- | compat.h | 54 | ||||
-rw-r--r-- | samsung-ril.c | 2 | ||||
-rw-r--r-- | samsung-ril.h | 15 |
4 files changed, 56 insertions, 27 deletions
@@ -60,12 +60,6 @@ endif ifeq ($(TARGET_DEVICE),galaxys2) LOCAL_CFLAGS += -DDEVICE_IPC_V4 - LOCAL_CFLAGS += -DRIL_REQUEST_REGISTRATION_STATE=RIL_REQUEST_VOICE_REGISTRATION_STATE - LOCAL_CFLAGS += -DRIL_REQUEST_GPRS_REGISTRATION_STATE=RIL_REQUEST_DATA_REGISTRATION_STATE - LOCAL_CFLAGS += -DRIL_SignalStrength=RIL_SignalStrength_v6 - LOCAL_CFLAGS += -DRIL_CardStatus=RIL_CardStatus_v6 - LOCAL_CFLAGS += -DRIL_SIM_IO=RIL_SIM_IO_v6 - LOCAL_CFLAGS += -DRIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED=RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED samsung-ipc_device := galaxys2 endif @@ -80,12 +74,6 @@ endif ifeq ($(TARGET_DEVICE),maguro) LOCAL_CFLAGS += -DDEVICE_IPC_V4 - LOCAL_CFLAGS += -DRIL_REQUEST_REGISTRATION_STATE=RIL_REQUEST_VOICE_REGISTRATION_STATE - LOCAL_CFLAGS += -DRIL_REQUEST_GPRS_REGISTRATION_STATE=RIL_REQUEST_DATA_REGISTRATION_STATE - LOCAL_CFLAGS += -DRIL_SignalStrength=RIL_SignalStrength_v6 - LOCAL_CFLAGS += -DRIL_CardStatus=RIL_CardStatus_v6 - LOCAL_CFLAGS += -DRIL_SIM_IO=RIL_SIM_IO_v6 - LOCAL_CFLAGS += -DRIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED=RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED samsung-ipc_device := maguro endif diff --git a/compat.h b/compat.h new file mode 100644 index 0000000..efbdd60 --- /dev/null +++ b/compat.h @@ -0,0 +1,54 @@ +/** + * This file is part of samsung-ril. + * + * Copyright (C) 2010-2011 Joerie de Gram <j.de.gram@gmail.com> + * Copyright (C) 2011 Paul Kocialkowski <contact@oaulk.fr> + * Copyright (C) 2012 Alexander Tarasikov <alexander.tarasikov@gmail.com> + * + * samsung-ril is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * samsung-ril is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with samsung-ril. If not, see <http://www.gnu.org/licenses/>. + * + */ + +#ifndef __COMPAT_H__ +#define __COMPAT_H__ + +#include <telephony/ril.h> +#include <utils/Log.h> + +#ifndef LOGE + #define LOGE ALOGE +#endif + +#ifndef LOGI + #define LOGI ALOGI +#endif + +#ifndef LOGD + #define LOGD ALOGD +#endif + +#if RIL_VERSION >= 6 + #define RIL_REQUEST_REGISTRATION_STATE RIL_REQUEST_VOICE_REGISTRATION_STATE + #define RIL_REQUEST_GPRS_REGISTRATION_STATE RIL_REQUEST_DATA_REGISTRATION_STATE + #define RIL_SignalStrength RIL_SignalStrength_v6 + #define RIL_CardStatus RIL_CardStatus_v6 + #define RIL_SIM_IO RIL_SIM_IO_v6 + #define RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED +#endif + +//set it to the maximum supported revision +//we've not yet fully implemented version 7 +#define SAMSUNG_RIL_VERSION 6 + +#endif //__COMPAT_H__ diff --git a/samsung-ril.c b/samsung-ril.c index 6aca65b..8f15810 100644 --- a/samsung-ril.c +++ b/samsung-ril.c @@ -525,7 +525,7 @@ void ril_state_lpm(void) static const RIL_RadioFunctions ril_ops = { - 6, //RIL_VERSION + SAMSUNG_RIL_VERSION, onRequest, currentState, onSupports, diff --git a/samsung-ril.h b/samsung-ril.h index d94d583..b0e46e4 100644 --- a/samsung-ril.h +++ b/samsung-ril.h @@ -27,20 +27,7 @@ #include <telephony/ril.h> #include <radio.h> -#include <utils/Log.h> - -#ifndef LOGE - #define LOGE ALOGE -#endif - -#ifndef LOGI - #define LOGI ALOGI -#endif - -#ifndef LOGD - #define LOGD ALOGD -#endif - +#include "compat.h" #include "ipc.h" #include "srs.h" |