|
|
@ -114,12 +114,8 @@ RIL_RadioFunctions s_callbacks = {0, NULL, NULL, NULL, NULL, NULL}; |
|
|
|
static int s_registerCalled = 0; |
|
|
|
static int s_registerCalled = 0; |
|
|
|
|
|
|
|
|
|
|
|
static pthread_t s_tid_dispatch; |
|
|
|
static pthread_t s_tid_dispatch; |
|
|
|
static pthread_t s_tid_reader; |
|
|
|
|
|
|
|
static int s_started = 0; |
|
|
|
static int s_started = 0; |
|
|
|
|
|
|
|
|
|
|
|
static int s_fdDebug = -1; |
|
|
|
|
|
|
|
static int s_fdDebug_socket2 = -1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static int s_fdWakeupRead; |
|
|
|
static int s_fdWakeupRead; |
|
|
|
static int s_fdWakeupWrite; |
|
|
|
static int s_fdWakeupWrite; |
|
|
|
|
|
|
|
|
|
|
@ -128,44 +124,30 @@ int s_wakelock_count = 0; |
|
|
|
static struct ril_event s_wakeupfd_event; |
|
|
|
static struct ril_event s_wakeupfd_event; |
|
|
|
|
|
|
|
|
|
|
|
static pthread_mutex_t s_pendingRequestsMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_pendingRequestsMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_writeMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
|
|
|
|
static pthread_mutex_t s_wakeLockCountMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_wakeLockCountMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static RequestInfo *s_pendingRequests = NULL; |
|
|
|
static RequestInfo *s_pendingRequests = NULL; |
|
|
|
|
|
|
|
|
|
|
|
#if (SIM_COUNT >= 2) |
|
|
|
#if (SIM_COUNT >= 2) |
|
|
|
static pthread_mutex_t s_pendingRequestsMutex_socket2 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_pendingRequestsMutex_socket2 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_writeMutex_socket2 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
|
|
|
|
static RequestInfo *s_pendingRequests_socket2 = NULL; |
|
|
|
static RequestInfo *s_pendingRequests_socket2 = NULL; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if (SIM_COUNT >= 3) |
|
|
|
#if (SIM_COUNT >= 3) |
|
|
|
static pthread_mutex_t s_pendingRequestsMutex_socket3 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_pendingRequestsMutex_socket3 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_writeMutex_socket3 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
|
|
|
|
static RequestInfo *s_pendingRequests_socket3 = NULL; |
|
|
|
static RequestInfo *s_pendingRequests_socket3 = NULL; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#if (SIM_COUNT >= 4) |
|
|
|
#if (SIM_COUNT >= 4) |
|
|
|
static pthread_mutex_t s_pendingRequestsMutex_socket4 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_pendingRequestsMutex_socket4 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_writeMutex_socket4 = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
|
|
|
|
static RequestInfo *s_pendingRequests_socket4 = NULL; |
|
|
|
static RequestInfo *s_pendingRequests_socket4 = NULL; |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
static struct ril_event s_wake_timeout_event; |
|
|
|
|
|
|
|
static struct ril_event s_debug_event; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static const struct timeval TIMEVAL_WAKE_TIMEOUT = {ANDROID_WAKE_LOCK_SECS,ANDROID_WAKE_LOCK_USECS}; |
|
|
|
static const struct timeval TIMEVAL_WAKE_TIMEOUT = {ANDROID_WAKE_LOCK_SECS,ANDROID_WAKE_LOCK_USECS}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static pthread_mutex_t s_startupMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_mutex_t s_startupMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
static pthread_cond_t s_startupCond = PTHREAD_COND_INITIALIZER; |
|
|
|
static pthread_cond_t s_startupCond = PTHREAD_COND_INITIALIZER; |
|
|
|
|
|
|
|
|
|
|
|
static pthread_mutex_t s_dispatchMutex = PTHREAD_MUTEX_INITIALIZER; |
|
|
|
|
|
|
|
static pthread_cond_t s_dispatchCond = PTHREAD_COND_INITIALIZER; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static RequestInfo *s_toDispatchHead = NULL; |
|
|
|
|
|
|
|
static RequestInfo *s_toDispatchTail = NULL; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static UserCallbackInfo *s_last_wake_timeout_info = NULL; |
|
|
|
static UserCallbackInfo *s_last_wake_timeout_info = NULL; |
|
|
|
|
|
|
|
|
|
|
|
static void *s_lastNITZTimeData = NULL; |
|
|
|
static void *s_lastNITZTimeData = NULL; |
|
|
@ -455,9 +437,6 @@ extern "C" void RIL_setcallbacks (const RIL_RadioFunctions *callbacks) { |
|
|
|
|
|
|
|
|
|
|
|
extern "C" void |
|
|
|
extern "C" void |
|
|
|
RIL_register (const RIL_RadioFunctions *callbacks) { |
|
|
|
RIL_register (const RIL_RadioFunctions *callbacks) { |
|
|
|
int ret; |
|
|
|
|
|
|
|
int flags; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RLOGI("SIM_COUNT: %d", SIM_COUNT); |
|
|
|
RLOGI("SIM_COUNT: %d", SIM_COUNT); |
|
|
|
|
|
|
|
|
|
|
|
if (callbacks == NULL) { |
|
|
|
if (callbacks == NULL) { |
|
|
@ -602,9 +581,7 @@ checkAndDequeueRequestInfoIfAck(struct RequestInfo *pRI, bool isAck) { |
|
|
|
extern "C" void |
|
|
|
extern "C" void |
|
|
|
RIL_onRequestAck(RIL_Token t) { |
|
|
|
RIL_onRequestAck(RIL_Token t) { |
|
|
|
RequestInfo *pRI; |
|
|
|
RequestInfo *pRI; |
|
|
|
int ret; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
size_t errorOffset; |
|
|
|
|
|
|
|
RIL_SOCKET_ID socket_id = RIL_SOCKET_1; |
|
|
|
RIL_SOCKET_ID socket_id = RIL_SOCKET_1; |
|
|
|
|
|
|
|
|
|
|
|
pRI = (RequestInfo *)t; |
|
|
|
pRI = (RequestInfo *)t; |
|
|
@ -638,7 +615,6 @@ extern "C" void |
|
|
|
RIL_onRequestComplete(RIL_Token t, RIL_Errno e, void *response, size_t responselen) { |
|
|
|
RIL_onRequestComplete(RIL_Token t, RIL_Errno e, void *response, size_t responselen) { |
|
|
|
RequestInfo *pRI; |
|
|
|
RequestInfo *pRI; |
|
|
|
int ret; |
|
|
|
int ret; |
|
|
|
size_t errorOffset; |
|
|
|
|
|
|
|
RIL_SOCKET_ID socket_id = RIL_SOCKET_1; |
|
|
|
RIL_SOCKET_ID socket_id = RIL_SOCKET_1; |
|
|
|
|
|
|
|
|
|
|
|
pRI = (RequestInfo *)t; |
|
|
|
pRI = (RequestInfo *)t; |
|
|
|