summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-12-20 22:29:42 +0100
committerPaul Kocialkowski <contact@paulk.fr>2013-12-20 22:29:42 +0100
commitc8408cd2c116b0b99a399282032b6607a1318b84 (patch)
tree536ad6926d7ab2808ed35d5f9cac69ce76c5d9a6
parent8d0081ae32ea13821166bb11c6034e966c23a5cc (diff)
downloadhardware_replicant_libsamsung-ril-c8408cd2c116b0b99a399282032b6607a1318b84.tar.gz
hardware_replicant_libsamsung-ril-c8408cd2c116b0b99a399282032b6607a1318b84.tar.bz2
hardware_replicant_libsamsung-ril-c8408cd2c116b0b99a399282032b6607a1318b84.zip
RIL_LOG macro to log messagesreplicant-4.2-0002replicant-4.2-0001
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--call.c14
-rw-r--r--client.c24
-rw-r--r--disp.c4
-rw-r--r--gen.c8
-rw-r--r--gprs.c88
-rw-r--r--ipc.c62
-rw-r--r--misc.c22
-rw-r--r--net.c64
-rw-r--r--pwr.c10
-rw-r--r--rfs.c12
-rw-r--r--samsung-ril.c34
-rw-r--r--samsung-ril.h18
-rw-r--r--sat.c8
-rw-r--r--sec.c48
-rw-r--r--sms.c54
-rw-r--r--snd.c12
-rw-r--r--srs.c40
-rw-r--r--ss.c18
-rw-r--r--svc.c8
-rw-r--r--util.c4
20 files changed, 279 insertions, 273 deletions
diff --git a/call.c b/call.c
index deb9e46..680aba5 100644
--- a/call.c
+++ b/call.c
@@ -33,7 +33,7 @@ unsigned char ril2ipc_call_identity(int clir)
case 2:
return IPC_CALL_IDENTITY_HIDE;
default:
- LOGE("Unknown call identity: 0x%x", clir);
+ RIL_LOGE("Unknown call identity: 0x%x", clir);
return IPC_CALL_IDENTITY_DEFAULT;
}
}
@@ -54,7 +54,7 @@ unsigned char ipc2ril_call_list_entry_state(unsigned char call_state)
case IPC_CALL_LIST_ENTRY_STATE_WAITING:
return RIL_CALL_WAITING;
default:
- LOGE("Unknown call list entry state: 0x%x", call_state);
+ RIL_LOGE("Unknown call list entry state: 0x%x", call_state);
return -1;
}
}
@@ -67,7 +67,7 @@ RIL_LastCallFailCause ipc2ril_call_fail_cause(unsigned char end_cause)
return CALL_FAIL_NORMAL;
case IPC_CALL_END_CAUSE_UNSPECIFIED:
default:
- LOGE("Unknown call fail cause: 0x%x", end_cause);
+ RIL_LOGE("Unknown call fail cause: 0x%x", end_cause);
return CALL_FAIL_ERROR_UNSPECIFIED;
}
}
@@ -88,7 +88,7 @@ void ipc_call_status(struct ipc_message_info *info)
call_status = (struct ipc_call_status *) info->data;
- LOGD("Updating call status data");
+ RIL_LOGD("Updating call status data");
memcpy(&(ril_data.state.call_status), call_status, sizeof(struct ipc_call_status));
ril_request_unsolicited(RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED, NULL, 0);
@@ -259,7 +259,7 @@ void ril_request_dtmf(RIL_Token t, void *data, int length)
count = 1;
if (ril_data.state.dtmf_tone != 0) {
- LOGD("Another tone wasn't stopped, stopping it before anything");
+ RIL_LOGD("Another tone wasn't stopped, stopping it before anything");
cont_dtmf.state = IPC_CALL_DTMF_STATE_STOP;
cont_dtmf.tone = 0;
@@ -305,7 +305,7 @@ void ipc_call_burst_dtmf(struct ipc_message_info *info)
// This apparently should return 1, or perhaps that is the DTMF tones count
if (code == 0) {
- LOGD("Apparently, something went wrong with DTMF burst (code=0x%x)", code);
+ RIL_LOGD("Apparently, something went wrong with DTMF burst (code=0x%x)", code);
goto error;
}
@@ -329,7 +329,7 @@ void ril_request_dtmf_start(RIL_Token t, void *data, int length)
tone = *((unsigned char *) data);
if (ril_data.state.dtmf_tone != 0) {
- LOGD("Another tone wasn't stopped, stopping it before anything");
+ RIL_LOGD("Another tone wasn't stopped, stopping it before anything");
cont_dtmf.state = IPC_CALL_DTMF_STATE_STOP;
cont_dtmf.tone = 0;
diff --git a/client.c b/client.c
index 448d60d..92ebc2c 100644
--- a/client.c
+++ b/client.c
@@ -63,11 +63,11 @@ int ril_client_create(struct ril_client *client)
return -1;
for (c = RIL_CLIENT_MAX_TRIES ; c > 0 ; c--) {
- LOGD("Creating RIL client inners, try #%d", RIL_CLIENT_MAX_TRIES - c + 1);
+ RIL_LOGD("Creating RIL client inners, try #%d", RIL_CLIENT_MAX_TRIES - c + 1);
rc = client->funcs.create(client);
if (rc < 0)
- LOGE("RIL client inners creation failed");
+ RIL_LOGE("RIL client inners creation failed");
else
break;
@@ -75,7 +75,7 @@ int ril_client_create(struct ril_client *client)
}
if (c == 0) {
- LOGE("RIL client inners creation failed too many times");
+ RIL_LOGE("RIL client inners creation failed too many times");
client->state = RIL_CLIENT_ERROR;
return -1;
}
@@ -94,11 +94,11 @@ int ril_client_destroy(struct ril_client *client)
return -1;
for (c = RIL_CLIENT_MAX_TRIES ; c > 0 ; c--) {
- LOGD("Destroying RIL client inners, try #%d", RIL_CLIENT_MAX_TRIES - c + 1);
+ RIL_LOGD("Destroying RIL client inners, try #%d", RIL_CLIENT_MAX_TRIES - c + 1);
rc = client->funcs.destroy(client);
if (rc < 0)
- LOGE("RIL client inners destroying failed");
+ RIL_LOGE("RIL client inners destroying failed");
else
break;
@@ -106,7 +106,7 @@ int ril_client_destroy(struct ril_client *client)
}
if (c == 0) {
- LOGE("RIL client inners destroying failed too many times");
+ RIL_LOGE("RIL client inners destroying failed too many times");
client->state = RIL_CLIENT_ERROR;
return -1;
}
@@ -137,7 +137,7 @@ void *ril_client_thread(void *data)
if (rc < 0) {
client->state = RIL_CLIENT_ERROR;
- LOGE("RIL client read loop failed");
+ RIL_LOGE("RIL client read loop failed");
ril_client_destroy(client);
ril_client_create(client);
@@ -146,13 +146,13 @@ void *ril_client_thread(void *data)
} else {
client->state = RIL_CLIENT_CREATED;
- LOGD("RIL client read loop ended");
+ RIL_LOGD("RIL client read loop ended");
break;
}
}
if (c == 0) {
- LOGE("RIL client read loop failed too many times");
+ RIL_LOGE("RIL client read loop failed too many times");
client->state = RIL_CLIENT_ERROR;
}
@@ -160,11 +160,11 @@ void *ril_client_thread(void *data)
rc = ril_client_destroy(client);
if (rc < 0)
- LOGE("RIL client destroy failed");
+ RIL_LOGE("RIL client destroy failed");
rc = ril_client_free(client);
if (rc < 0)
- LOGE("RIL client free failed");
+ RIL_LOGE("RIL client free failed");
return 0;
}
@@ -180,7 +180,7 @@ int ril_client_thread_start(struct ril_client *client)
rc = pthread_create(&(client->thread), &attr, ril_client_thread, (void *) client);
if (rc != 0) {
- LOGE("RIL client thread creation failed");
+ RIL_LOGE("RIL client thread creation failed");
return -1;
}
diff --git a/disp.c b/disp.c
index 72f8219..9f6a56a 100644
--- a/disp.c
+++ b/disp.c
@@ -46,7 +46,7 @@ void ipc2ril_rssi(unsigned char rssi, RIL_SignalStrength *ss)
asu = 31;
}
- LOGD("Signal Strength is %d\n", asu);
+ RIL_LOGD("Signal Strength is %d\n", asu);
#if RIL_VERSION >= 6
memset(ss, 0, sizeof(RIL_SignalStrength_v6));
@@ -80,7 +80,7 @@ void ipc2ril_bars(unsigned char bars, RIL_SignalStrength *ss)
default : asu = bars; break;
}
- LOGD("Signal Strength is %d\n", asu);
+ RIL_LOGD("Signal Strength is %d\n", asu);
#if RIL_VERSION >= 6
memset(ss, 0, sizeof(RIL_SignalStrength_v6));
diff --git a/gen.c b/gen.c
index 67fca93..596560c 100644
--- a/gen.c
+++ b/gen.c
@@ -158,18 +158,18 @@ void ipc_gen_phone_res(struct ipc_message_info *info)
expect = ipc_gen_phone_res_expect_info_find_aseq(info->aseq);
if (expect == NULL) {
- LOGD("aseq: 0x%x not found in the IPC_GEN_PHONE_RES queue", info->aseq);
+ RIL_LOGD("aseq: 0x%x not found in the IPC_GEN_PHONE_RES queue", info->aseq);
return;
}
- LOGD("aseq: 0x%x found in the IPC_GEN_PHONE_RES queue!", info->aseq);
+ RIL_LOGD("aseq: 0x%x found in the IPC_GEN_PHONE_RES queue!", info->aseq);
if (expect->command != IPC_COMMAND(phone_res)) {
- LOGE("IPC_GEN_PHONE_RES aseq (0x%x) doesn't match the queued one with command (0x%x)",
+ RIL_LOGE("IPC_GEN_PHONE_RES aseq (0x%x) doesn't match the queued one with command (0x%x)",
expect->aseq, expect->command);
if (expect->func != NULL) {
- LOGE("Not safe to run the custom function, reporting generic failure");
+ RIL_LOGE("Not safe to run the custom function, reporting generic failure");
ril_request_complete(ril_request_get_token(expect->aseq), RIL_E_GENERIC_FAILURE, NULL, 0);
goto unregister;
}
diff --git a/gprs.c b/gprs.c
index 4e77043..90dda72 100644
--- a/gprs.c
+++ b/gprs.c
@@ -209,11 +209,11 @@ list_continue:
}
if (cid <= 0) {
- LOGE("Unable to find an unused cid, aborting");
+ RIL_LOGE("Unable to find an unused cid, aborting");
return NULL;
}
- LOGD("Using GPRS connection cid: %d", cid);
+ RIL_LOGD("Using GPRS connection cid: %d", cid);
rc = ril_gprs_connection_register(cid);
if (rc < 0)
return NULL;
@@ -243,7 +243,7 @@ void ipc_gprs_pdp_context_enable_complete(struct ipc_message_info *info)
gprs_connection = ril_gprs_connection_find_token(ril_request_get_token(info->aseq));
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection, aborting");
+ RIL_LOGE("Unable to find GPRS connection, aborting");
ril_request_complete(ril_request_get_token(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
@@ -252,7 +252,7 @@ void ipc_gprs_pdp_context_enable_complete(struct ipc_message_info *info)
rc = ipc_gen_phone_res_check(phone_res);
if (rc < 0) {
- LOGE("There was an error, aborting PDP context complete");
+ RIL_LOGE("There was an error, aborting PDP context complete");
gprs_connection->fail_cause = PDP_FAIL_ERROR_UNSPECIFIED;
gprs_connection->token = RIL_TOKEN_NULL;
@@ -263,7 +263,7 @@ void ipc_gprs_pdp_context_enable_complete(struct ipc_message_info *info)
return;
}
- LOGD("Waiting for IP configuration!");
+ RIL_LOGD("Waiting for IP configuration!");
}
void ipc_gprs_define_pdp_context_complete(struct ipc_message_info *info)
@@ -278,7 +278,7 @@ void ipc_gprs_define_pdp_context_complete(struct ipc_message_info *info)
gprs_connection = ril_gprs_connection_find_token(ril_request_get_token(info->aseq));
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection, aborting");
+ RIL_LOGE("Unable to find GPRS connection, aborting");
ril_request_complete(ril_request_get_token(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
@@ -287,7 +287,7 @@ void ipc_gprs_define_pdp_context_complete(struct ipc_message_info *info)
rc = ipc_gen_phone_res_check(phone_res);
if (rc < 0) {
- LOGE("There was an error, aborting define PDP context complete");
+ RIL_LOGE("There was an error, aborting define PDP context complete");
gprs_connection->fail_cause = PDP_FAIL_ERROR_UNSPECIFIED;
gprs_connection->token = RIL_TOKEN_NULL;
@@ -324,7 +324,7 @@ void ipc_gprs_port_list_complete(struct ipc_message_info *info)
gprs_connection = ril_gprs_connection_find_token(ril_request_get_token(info->aseq));
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection, aborting");
+ RIL_LOGE("Unable to find GPRS connection, aborting");
ril_request_complete(ril_request_get_token(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
@@ -333,7 +333,7 @@ void ipc_gprs_port_list_complete(struct ipc_message_info *info)
rc = ipc_gen_phone_res_check(phone_res);
if (rc < 0) {
- LOGE("There was an error, aborting port list complete");
+ RIL_LOGE("There was an error, aborting port list complete");
gprs_connection->fail_cause = PDP_FAIL_ERROR_UNSPECIFIED;
gprs_connection->token = RIL_TOKEN_NULL;
@@ -384,12 +384,12 @@ void ril_request_setup_data_call(RIL_Token t, void *data, int length)
username = ((char **) data)[3];
password = ((char **) data)[4];
- LOGD("Requesting data connection to APN '%s'\n", apn);
+ RIL_LOGD("Requesting data connection to APN '%s'\n", apn);
gprs_connection = ril_gprs_connection_start();
if (!gprs_connection) {
- LOGE("Unable to create GPRS connection, aborting");
+ RIL_LOGE("Unable to create GPRS connection, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
return;
@@ -444,20 +444,20 @@ void ipc_gprs_ip_configuration(struct ipc_message_info *info)
gprs_connection = ril_gprs_connection_find_cid(ip_configuration->cid);
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection, aborting");
+ RIL_LOGE("Unable to find GPRS connection, aborting");
ril_request_complete(ril_request_get_token(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
- LOGD("Obtained IP Configuration");
+ RIL_LOGD("Obtained IP Configuration");
// Copy the obtained IP configuration to the GPRS connection structure
memcpy(&(gprs_connection->ip_configuration),
ip_configuration, sizeof(struct ipc_gprs_ip_configuration));
- LOGD("Waiting for GPRS call status");
+ RIL_LOGD("Waiting for GPRS call status");
return;
@@ -475,7 +475,7 @@ void ipc_gprs_pdp_context_disable_complete(struct ipc_message_info *info)
gprs_connection = ril_gprs_connection_find_token(ril_request_get_token(info->aseq));
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection, aborting");
+ RIL_LOGE("Unable to find GPRS connection, aborting");
ril_request_complete(ril_request_get_token(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
@@ -484,7 +484,7 @@ void ipc_gprs_pdp_context_disable_complete(struct ipc_message_info *info)
rc = ipc_gen_phone_res_check(phone_res);
if (rc < 0) {
- LOGE("There was an error, aborting PDP context complete");
+ RIL_LOGE("There was an error, aborting PDP context complete");
// RILJ is not going to ask for fail reason
ril_gprs_connection_stop(gprs_connection);
@@ -494,7 +494,7 @@ void ipc_gprs_pdp_context_disable_complete(struct ipc_message_info *info)
return;
}
- LOGD("Waiting for GPRS call status");
+ RIL_LOGD("Waiting for GPRS call status");
}
void ril_request_deactivate_data_call(RIL_Token t, void *data, int length)
@@ -516,7 +516,7 @@ void ril_request_deactivate_data_call(RIL_Token t, void *data, int length)
gprs_connection = ril_gprs_connection_find_cid(atoi(cid));
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection, aborting");
+ RIL_LOGE("Unable to find GPRS connection, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
return;
@@ -601,13 +601,13 @@ int ipc_gprs_connection_enable(struct ril_gprs_connection *gprs_connection,
rc = ipc_client_gprs_activate(ipc_client, gprs_connection->cid);
if (rc < 0) {
// This is not a critical issue
- LOGE("Failed to activate interface!");
+ RIL_LOGE("Failed to activate interface!");
}
interface = ipc_client_gprs_get_iface(ipc_client, gprs_connection->cid);
if (interface == NULL) {
// This is not a critical issue, fallback to rmnet
- LOGE("Failed to get interface name!");
+ RIL_LOGE("Failed to get interface name!");
asprintf(&interface, "rmnet%d", gprs_connection->cid - 1);
}
@@ -615,9 +615,9 @@ int ipc_gprs_connection_enable(struct ril_gprs_connection *gprs_connection,
gprs_connection->interface = strdup(interface);
}
- LOGD("Using net interface: %s\n", interface);
+ RIL_LOGD("Using net interface: %s\n", interface);
- LOGD("GPRS configuration: iface: %s, ip:%s, "
+ RIL_LOGD("GPRS configuration: iface: %s, ip:%s, "
"gateway:%s, subnet_mask:%s, dns1:%s, dns2:%s",
interface, ip, gateway, subnet_mask, dns1, dns2);
@@ -636,7 +636,7 @@ int ipc_gprs_connection_enable(struct ril_gprs_connection *gprs_connection,
#endif
if (rc < 0) {
- LOGE("ifc_configure failed");
+ RIL_LOGE("ifc_configure failed");
free(interface);
return -1;
@@ -693,14 +693,14 @@ int ipc_gprs_connection_disable(struct ril_gprs_connection *gprs_connection)
interface = ipc_client_gprs_get_iface(ipc_client, gprs_connection->cid);
if (interface == NULL) {
// This is not a critical issue, fallback to rmnet
- LOGE("Failed to get interface name!");
+ RIL_LOGE("Failed to get interface name!");
asprintf(&interface, "rmnet%d", gprs_connection->cid);
}
} else {
interface = gprs_connection->interface;
}
- LOGD("Using net interface: %s\n", interface);
+ RIL_LOGD("Using net interface: %s\n", interface);
rc = ifc_down(interface);
@@ -708,13 +708,13 @@ int ipc_gprs_connection_disable(struct ril_gprs_connection *gprs_connection)
free(interface);
if (rc < 0) {
- LOGE("ifc_down failed");
+ RIL_LOGE("ifc_down failed");
}
rc = ipc_client_gprs_deactivate(ipc_client, gprs_connection->cid);
if (rc < 0) {
// This is not a critical issue
- LOGE("Could not deactivate interface!");
+ RIL_LOGE("Could not deactivate interface!");
}
return 0;
@@ -772,7 +772,7 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
gprs_connection = ril_gprs_connection_find_cid(call_status->cid);
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection, aborting");
+ RIL_LOGE("Unable to find GPRS connection, aborting");
ril_request_complete(ril_request_get_token(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
@@ -783,12 +783,12 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
if (!gprs_connection->enabled &&
call_status->state == IPC_GPRS_STATE_ENABLED &&
gprs_connection->token != RIL_TOKEN_NULL) {
- LOGD("GPRS connection is now enabled");
+ RIL_LOGD("GPRS connection is now enabled");
rc = ipc_gprs_connection_enable(gprs_connection,
&setup_data_call_response);
if (rc < 0) {
- LOGE("Failed to enable and configure GPRS interface");
+ RIL_LOGE("Failed to enable and configure GPRS interface");
gprs_connection->enabled = 0;
gprs_connection->fail_cause = PDP_FAIL_ERROR_UNSPECIFIED;
@@ -797,7 +797,7 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
ril_request_complete(gprs_connection->token,
RIL_E_GENERIC_FAILURE, NULL, 0);
} else {
- LOGD("GPRS interface enabled");
+ RIL_LOGD("GPRS interface enabled");
gprs_connection->enabled = 1;
@@ -819,11 +819,11 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
} else if (gprs_connection->enabled &&
call_status->state == IPC_GPRS_STATE_DISABLED &&
gprs_connection->token != RIL_TOKEN_NULL) {
- LOGD("GPRS connection is now disabled");
+ RIL_LOGD("GPRS connection is now disabled");
rc = ipc_gprs_connection_disable(gprs_connection);
if (rc < 0) {
- LOGE("Failed to disable GPRS interface");
+ RIL_LOGE("Failed to disable GPRS interface");
ril_request_complete(gprs_connection->token,
RIL_E_GENERIC_FAILURE, NULL, 0);
@@ -831,7 +831,7 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
// RILJ is not going to ask for fail reason
ril_gprs_connection_stop(gprs_connection);
} else {
- LOGD("GPRS interface disabled");
+ RIL_LOGD("GPRS interface disabled");
gprs_connection->enabled = 0;
@@ -841,7 +841,7 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
ril_gprs_connection_stop(gprs_connection);
}
} else {
- LOGE("GPRS connection reported as changed though state is not OK:"
+ RIL_LOGE("GPRS connection reported as changed though state is not OK:"
"\n\tgprs_connection->enabled=%d\n\tgprs_connection->token=0x%x",
gprs_connection->enabled, (unsigned)gprs_connection->token);
@@ -852,7 +852,7 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
(call_status->state == IPC_GPRS_STATE_NOT_ENABLED ||
call_status->state == IPC_GPRS_STATE_DISABLED) &&
gprs_connection->token != RIL_TOKEN_NULL) {
- LOGE("Failed to enable GPRS connection");
+ RIL_LOGE("Failed to enable GPRS connection");
gprs_connection->enabled = 0;
gprs_connection->fail_cause =
@@ -866,16 +866,16 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
ril_unsol_data_call_list_changed();
} else if (gprs_connection->enabled &&
call_status->state == IPC_GPRS_STATE_DISABLED) {
- LOGE("GPRS connection suddently got disabled");
+ RIL_LOGE("GPRS connection suddently got disabled");
rc = ipc_gprs_connection_disable(gprs_connection);
if (rc < 0) {
- LOGE("Failed to disable GPRS interface");
+ RIL_LOGE("Failed to disable GPRS interface");
// RILJ is not going to ask for fail reason
ril_gprs_connection_stop(gprs_connection);
} else {
- LOGE("GPRS interface disabled");
+ RIL_LOGE("GPRS interface disabled");
gprs_connection->enabled = 0;
ril_gprs_connection_stop(gprs_connection);
@@ -883,7 +883,7 @@ void ipc_gprs_call_status(struct ipc_message_info *info)
ril_unsol_data_call_list_changed();
} else {
- LOGE("GPRS connection reported to have failed though state is OK:"
+ RIL_LOGE("GPRS connection reported to have failed though state is OK:"
"\n\tgprs_connection->enabled=%d\n\tgprs_connection->token=0x%x",
gprs_connection->enabled, (unsigned)gprs_connection->token);
@@ -909,7 +909,7 @@ void ril_request_last_data_call_fail_cause(RIL_Token t)
last_failed_cid = ril_data.state.gprs_last_failed_cid;
if (!last_failed_cid) {
- LOGE("No GPRS connection was reported to have failed");
+ RIL_LOGE("No GPRS connection was reported to have failed");
goto fail_cause_unspecified;
}
@@ -917,14 +917,14 @@ void ril_request_last_data_call_fail_cause(RIL_Token t)
gprs_connection = ril_gprs_connection_find_cid(last_failed_cid);
if (!gprs_connection) {
- LOGE("Unable to find GPRS connection");
+ RIL_LOGE("Unable to find GPRS connection");
goto fail_cause_unspecified;
}
fail_cause = gprs_connection->fail_cause;
- LOGD("Destroying GPRS connection with cid: %d", gprs_connection->cid);
+ RIL_LOGD("Destroying GPRS connection with cid: %d", gprs_connection->cid);
ril_gprs_connection_stop(gprs_connection);
goto fail_cause_return;
@@ -998,7 +998,7 @@ void ipc_gprs_pdp_context(struct ipc_message_info *info)
gprs_connection = ril_gprs_connection_find_cid(context->desc[i].cid);
if (gprs_connection == NULL) {
- LOGE("CID %d reported as enabled but not listed here",
+ RIL_LOGE("CID %d reported as enabled but not listed here",
context->desc[i].cid);
continue;
}
diff --git a/ipc.c b/ipc.c
index c427295..a86a27f 100644
--- a/ipc.c
+++ b/ipc.c
@@ -29,7 +29,7 @@
void ipc_log_handler(void *log_data, const char *message)
{
- LOGD("ipc: %s", message);
+ RIL_LOGD("ipc: %s", message);
}
/*
@@ -65,7 +65,7 @@ int ipc_fmt_read_loop(struct ril_client *client)
while (1) {
rc = ipc_client_poll(ipc_client, NULL);
if (rc < 0) {
- LOGE("IPC FMT client poll failed, aborting");
+ RIL_LOGE("IPC FMT client poll failed, aborting");
goto error;
}
@@ -74,7 +74,7 @@ int ipc_fmt_read_loop(struct ril_client *client)
RIL_CLIENT_LOCK(client);
if (ipc_client_recv(ipc_client, &info) < 0) {
RIL_CLIENT_UNLOCK(client);
- LOGE("IPC FMT recv failed, aborting");
+ RIL_LOGE("IPC FMT recv failed, aborting");
goto error;
}
RIL_CLIENT_UNLOCK(client);
@@ -106,57 +106,57 @@ int ipc_fmt_create(struct ril_client *client)
if (client == NULL)
return -EINVAL;
- LOGD("Creating new FMT client");
+ RIL_LOGD("Creating new FMT client");
ipc_client = ipc_client_create(IPC_CLIENT_TYPE_FMT);
if (ipc_client == NULL) {
- LOGE("FMT client creation failed");
+ RIL_LOGE("FMT client creation failed");
goto error_client_create;
}
client->data = (void *) ipc_client;
- LOGD("Setting log handler");
+ RIL_LOGD("Setting log handler");
rc = ipc_client_set_log_callback(ipc_client, ipc_log_handler, NULL);
if (rc < 0) {
- LOGE("Setting log handler failed");
+ RIL_LOGE("Setting log handler failed");
goto error_log_callback;
}
- LOGD("Creating data");
+ RIL_LOGD("Creating data");
rc = ipc_client_data_create(ipc_client);
if (rc < 0) {
- LOGE("Creating data failed");
+ RIL_LOGE("Creating data failed");
goto error_data_create;
}
- LOGD("Starting bootstrap");
+ RIL_LOGD("Starting bootstrap");
rc = ipc_client_bootstrap(ipc_client);
if (rc < 0) {
- LOGE("Modem bootstrap failed");
+ RIL_LOGE("Modem bootstrap failed");
goto error_bootstrap;
}
- LOGD("Client power on...");
+ RIL_LOGD("Client power on...");
rc = ipc_client_power_on(ipc_client);
if (rc < 0) {
- LOGE("%s: failed to power on ipc client", __func__);
+ RIL_LOGE("%s: failed to power on ipc client", __func__);
goto error_power_on;
}
- LOGD("Client open...");
+ RIL_LOGD("Client open...");
rc = ipc_client_open(ipc_client);
if (rc < 0) {
- LOGE("%s: failed to open ipc client", __func__);
+ RIL_LOGE("%s: failed to open ipc client", __func__);
goto error_open;
}
- LOGD("IPC FMT client done");
+ RIL_LOGD("IPC FMT client done");
return 0;
@@ -188,13 +188,13 @@ int ipc_fmt_destroy(struct ril_client *client)
int rc;
if (client == NULL || client->data == NULL) {
- LOGE("Client was already destroyed");
+ RIL_LOGE("Client was already destroyed");
return 0;
}
ipc_client = (struct ipc_client *) client->data;
- LOGD("Destroying ipc fmt client");
+ RIL_LOGD("Destroying ipc fmt client");
if (ipc_client != NULL) {
ipc_client_power_off(ipc_client);
@@ -241,7 +241,7 @@ int ipc_rfs_read_loop(struct ril_client *client)
while (1) {
rc = ipc_client_poll(ipc_client, NULL);
if (rc < 0) {
- LOGE("IPC RFS client poll failed, aborting");
+ RIL_LOGE("IPC RFS client poll failed, aborting");
goto error;
}
@@ -250,7 +250,7 @@ int ipc_rfs_read_loop(struct ril_client *client)
RIL_CLIENT_LOCK(client);
if (ipc_client_recv(ipc_client, &info) < 0) {
RIL_CLIENT_UNLOCK(client);
- LOGE("IPC RFS recv failed, aborting");
+ RIL_LOGE("IPC RFS recv failed, aborting");
goto error;
}
RIL_CLIENT_UNLOCK(client);
@@ -282,41 +282,41 @@ int ipc_rfs_create(struct ril_client *client)
if (client == NULL)
return -EINVAL;
- LOGD("Creating new RFS client");
+ RIL_LOGD("Creating new RFS client");
ipc_client = ipc_client_create(IPC_CLIENT_TYPE_RFS);
if (ipc_client == NULL) {
- LOGE("RFS client creation failed");
+ RIL_LOGE("RFS client creation failed");
goto error_client_create;
}
client->data = (void *) ipc_client;
- LOGD("Setting log handler");
+ RIL_LOGD("Setting log handler");
rc = ipc_client_set_log_callback(ipc_client, ipc_log_handler, NULL);
if (rc < 0) {
- LOGE("Setting log handler failed");
+ RIL_LOGE("Setting log handler failed");
goto error_log_callback;
}
- LOGD("Creating data");
+ RIL_LOGD("Creating data");
rc = ipc_client_data_create(ipc_client);
if (rc < 0) {
- LOGE("Creating data failed");
+ RIL_LOGE("Creating data failed");
goto error_data_create;
}
- LOGD("Client open...");
+ RIL_LOGD("Client open...");
rc = ipc_client_open(ipc_client);
if (rc < 0) {
- LOGE("%s: failed to open ipc client", __func__);
+ RIL_LOGE("%s: failed to open ipc client", __func__);
goto error_open;
}
- LOGD("IPC RFS client done");
+ RIL_LOGD("IPC RFS client done");
return 0;
@@ -345,13 +345,13 @@ int ipc_rfs_destroy(struct ril_client *client)
int rc;
if (client == NULL || client->data == NULL) {
- LOGE("Client was already destroyed");
+ RIL_LOGE("Client was already destroyed");
return 0;
}
ipc_client = (struct ipc_client *) client->data;
- LOGD("Destroying ipc rfs client");
+ RIL_LOGD("Destroying ipc rfs client");
if (ipc_client != NULL) {
ipc_client_close(ipc_client);
diff --git a/misc.c b/misc.c
index 85dc235..131a660 100644
--- a/misc.c
+++ b/misc.c
@@ -38,7 +38,7 @@ void ril_request_get_imei(RIL_Token t)
return;
if (ril_data.tokens.get_imei) {
- LOGD("Another IMEI request is waiting, aborting");
+ RIL_LOGD("Another IMEI request is waiting, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
@@ -46,11 +46,11 @@ void ril_request_get_imei(RIL_Token t)
ril_data.tokens.get_imei = t;
if (ril_data.tokens.get_imeisv) {
- LOGD("IMEISV token found: %p", ril_data.tokens.get_imeisv);
+ RIL_LOGD("IMEISV token found: %p", ril_data.tokens.get_imeisv);
ril_request_get_imei_send(ril_data.tokens.get_imei);
} else {
- LOGD("Waiting for IMEISV token");
+ RIL_LOGD("Waiting for IMEISV token");
}
}
@@ -60,7 +60,7 @@ void ril_request_get_imeisv(RIL_Token t)
return;
if (ril_data.tokens.get_imeisv) {
- LOGD("Another IMEISV request is waiting, aborting");
+ RIL_LOGD("Another IMEISV request is waiting, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
@@ -68,11 +68,11 @@ void ril_request_get_imeisv(RIL_Token t)
ril_data.tokens.get_imeisv = t;
if (ril_data.tokens.get_imei) {
- LOGD("IMEI token found: %p", ril_data.tokens.get_imei);
+ RIL_LOGD("IMEI token found: %p", ril_data.tokens.get_imei);
ril_request_get_imei_send(ril_data.tokens.get_imei);
} else {
- LOGD("Waiting for IMEI token");
+ RIL_LOGD("Waiting for IMEI token");
}
}
@@ -93,7 +93,7 @@ void ipc_misc_me_sn_imei(struct ipc_message_info *info)
t = ril_request_get_token(info->aseq);
if (ril_data.tokens.get_imei != t)
- LOGE("IMEI tokens mismatch (%p and %p)",
+ RIL_LOGE("IMEI tokens mismatch (%p and %p)",
ril_data.tokens.get_imei, t);
if (imei_info->length > 32)
@@ -149,7 +149,7 @@ void ipc_misc_me_sn(struct ipc_message_info *info)
ipc_misc_me_sn_imei(info);
break;
case IPC_MISC_ME_SN_SERIAL_NUM_SERIAL:
- LOGD("Got IPC_MISC_ME_SN_SERIAL_NUM_SERIAL: %s\n",
+ RIL_LOGD("Got IPC_MISC_ME_SN_SERIAL_NUM_SERIAL: %s\n",
me_sn_info->data);
break;
}
@@ -168,7 +168,7 @@ void ril_request_baseband_version(RIL_Token t)
return;
if (ril_data.tokens.baseband_version) {
- LOGD("Another Baseband version request is waiting, aborting");
+ RIL_LOGD("Another Baseband version request is waiting, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
return;
}
@@ -196,7 +196,7 @@ void ipc_misc_me_version(struct ipc_message_info *info)
t = ril_request_get_token(info->aseq);
if (ril_data.tokens.baseband_version != t)
- LOGE("Baseband tokens mismatch (%p and %p)",
+ RIL_LOGE("Baseband tokens mismatch (%p and %p)",
ril_data.tokens.baseband_version, t);
memcpy(sw_version, version->sw_version, 32);
@@ -233,7 +233,7 @@ void ipc_misc_me_imsi(struct ipc_message_info *info)
imsi_length = *((unsigned char *) info->data);
if (((int) info->length) < imsi_length + 1) {
- LOGE("%s: missing IMSI data", __func__);
+ RIL_LOGE("%s: missing IMSI data", __func__);
ril_request_complete(ril_request_get_token(info->aseq),
RIL_E_GENERIC_FAILURE, NULL, 0);
return;
diff --git a/net.c b/net.c
index c9bb778..04a06ff 100644
--- a/net.c
+++ b/net.c
@@ -42,7 +42,7 @@ unsigned char ipc2ril_reg_state(unsigned char reg_state)
case IPC_NET_REGISTRATION_STATE_UNKNOWN:
return 4;
default:
- LOGE("%s: invalid reg_state: %d", __func__, reg_state);
+ RIL_LOGE("%s: invalid reg_state: %d", __func__, reg_state);
return 0;
}
}
@@ -193,7 +193,7 @@ int ril_tokens_net_get_data_waiting(void)
void ril_tokens_net_state_dump(void)
{
- LOGD("ril_tokens_net_state_dump:\n\
+ RIL_LOGD("ril_tokens_net_state_dump:\n\
\tril_data.tokens.registration_state = %p\n\
\tril_data.tokens.gprs_registration_state = %p\n\
\tril_data.tokens.operator = %p\n", ril_data.tokens.registration_state, ril_data.tokens.gprs_registration_state, ril_data.tokens.operator);
@@ -241,7 +241,7 @@ void ril_plmn_string(char *plmn_data, char *response[3])
plmn_entries = sizeof(plmn_list) / sizeof(struct plmn_list_entry);
- LOGD("Found %d plmn records", plmn_entries);
+ RIL_LOGD("Found %d plmn records", plmn_entries);
for (i = 0 ; i < plmn_entries ; i++) {
if (plmn_list[i].mcc == mcc && plmn_list[i].mnc == mnc) {
@@ -313,7 +313,7 @@ void ril_request_operator(RIL_Token t)
}
if (ril_data.tokens.operator == RIL_TOKEN_DATA_WAITING) {
- LOGD("Got RILJ request for UNSOL data");
+ RIL_LOGD("Got RILJ request for UNSOL data");
/* Send back the data we got UNSOL */
ril_plmn_string(ril_data.state.plmndata.plmn, response);
@@ -327,13 +327,13 @@ void ril_request_operator(RIL_Token t)
ril_data.tokens.operator = RIL_TOKEN_NULL;
} else if (ril_data.tokens.operator == RIL_TOKEN_NULL) {
- LOGD("Got RILJ request for SOL data");
+ RIL_LOGD("Got RILJ request for SOL data");
/* Request data to the modem */
ril_data.tokens.operator = t;
ipc_fmt_send_get(IPC_NET_CURRENT_PLMN, ril_request_get_id(t));
} else {
- LOGE("Another request is going on, returning UNSOL data");
+ RIL_LOGE("Another request is going on, returning UNSOL data");
/* Send back the data we got UNSOL */
ril_plmn_string(ril_data.state.plmndata.plmn, response);
@@ -365,7 +365,7 @@ void ipc_net_current_plmn(struct ipc_message_info *info)
switch (info->type) {
case IPC_TYPE_NOTI:
- LOGD("Got UNSOL Operator message");
+ RIL_LOGD("Got UNSOL Operator message");
// IPC_NET_REGISTRATION_STATE_ROAMING is the biggest valid value
if (ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE ||
@@ -378,7 +378,7 @@ void ipc_net_current_plmn(struct ipc_message_info *info)
return;
} else {
if (ril_data.tokens.operator != RIL_TOKEN_NULL && ril_data.tokens.operator != RIL_TOKEN_DATA_WAITING) {
- LOGE("Another Operator Req is in progress, skipping");
+ RIL_LOGE("Another Operator Req is in progress, skipping");
return;
}
@@ -386,7 +386,7 @@ void ipc_net_current_plmn(struct ipc_message_info *info)
/* we already told RILJ to get the new data but it wasn't done yet */
if (ril_tokens_net_get_data_waiting() && ril_data.tokens.operator == RIL_TOKEN_DATA_WAITING) {
- LOGD("Updating Operator data in background");
+ RIL_LOGD("Updating Operator data in background");
} else {
ril_tokens_net_set_data_waiting();
#if RIL_VERSION >= 6
@@ -398,7 +398,7 @@ void ipc_net_current_plmn(struct ipc_message_info *info)
}
break;
case IPC_TYPE_RESP:
- LOGD("Got SOL Operator message");
+ RIL_LOGD("Got SOL Operator message");
// IPC_NET_REGISTRATION_STATE_ROAMING is the biggest valid value
if (ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE ||
@@ -415,7 +415,7 @@ void ipc_net_current_plmn(struct ipc_message_info *info)
return;
} else {
if (ril_data.tokens.operator != t)
- LOGE("Operator tokens mismatch");
+ RIL_LOGE("Operator tokens mismatch");
/* Better keeping it up to date */
memcpy(&(ril_data.state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response));
@@ -434,7 +434,7 @@ void ipc_net_current_plmn(struct ipc_message_info *info)
}
break;
default:
- LOGE("%s: unhandled ipc method: %d", __func__, info->type);
+ RIL_LOGE("%s: unhandled ipc method: %d", __func__, info->type);
break;
}
@@ -461,7 +461,7 @@ void ril_request_registration_state(RIL_Token t)
return;
if (ril_data.tokens.registration_state == RIL_TOKEN_DATA_WAITING) {
- LOGD("Got RILJ request for UNSOL data");
+ RIL_LOGD("Got RILJ request for UNSOL data");
/* Send back the data we got UNSOL */
ipc2ril_reg_state_resp(&(ril_data.state.netinfo), response);
@@ -475,14 +475,14 @@ void ril_request_registration_state(RIL_Token t)
ril_data.tokens.registration_state = RIL_TOKEN_NULL;
} else if (ril_data.tokens.registration_state == RIL_TOKEN_NULL) {
- LOGD("Got RILJ request for SOL data");
+ RIL_LOGD("Got RILJ request for SOL data");
/* Request data to the modem */
ril_data.tokens.registration_state = t;
ipc_net_regist_get_setup(&regist_req, IPC_NET_SERVICE_DOMAIN_GSM);
ipc_fmt_send(IPC_NET_REGIST, IPC_TYPE_GET, (void *)&regist_req, sizeof(struct ipc_net_regist_get), ril_request_get_id(t));
} else {
- LOGE("Another request is going on, returning UNSOL data");
+ RIL_LOGE("Another request is going on, returning UNSOL data");
/* Send back the data we got UNSOL */
ipc2ril_reg_state_resp(&(ril_data.state.netinfo), response);
@@ -512,7 +512,7 @@ void ril_request_gprs_registration_state(RIL_Token t)
return;
if (ril_data.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING) {
- LOGD("Got RILJ request for UNSOL data");
+ RIL_LOGD("Got RILJ request for UNSOL data");
/* Send back the data we got UNSOL */
ipc2ril_gprs_reg_state_resp(&(ril_data.state.gprs_netinfo), response);
@@ -526,7 +526,7 @@ void ril_request_gprs_registration_state(RIL_Token t)
ril_data.tokens.gprs_registration_state = RIL_TOKEN_NULL;
} else if (ril_data.tokens.gprs_registration_state == RIL_TOKEN_NULL) {
- LOGD("Got RILJ request for SOL data");
+ RIL_LOGD("Got RILJ request for SOL data");
/* Request data to the modem */
ril_data.tokens.gprs_registration_state = t;
@@ -534,7 +534,7 @@ void ril_request_gprs_registration_state(RIL_Token t)
ipc_net_regist_get_setup(&regist_req, IPC_NET_SERVICE_DOMAIN_GPRS);
ipc_fmt_send(IPC_NET_REGIST, IPC_TYPE_GET, (void *)&regist_req, sizeof(struct ipc_net_regist_get), ril_request_get_id(t));
} else {
- LOGE("Another request is going on, returning UNSOL data");
+ RIL_LOGE("Another request is going on, returning UNSOL data");
/* Send back the data we got UNSOL */
ipc2ril_gprs_reg_state_resp(&(ril_data.state.gprs_netinfo), response);
@@ -559,12 +559,12 @@ void ipc_net_regist_unsol(struct ipc_message_info *info)
netinfo = (struct ipc_net_regist_response *) info->data;
- LOGD("Got UNSOL NetRegist message");
+ RIL_LOGD("Got UNSOL NetRegist message");
switch (netinfo->domain) {
case IPC_NET_SERVICE_DOMAIN_GSM:
if (ril_data.tokens.registration_state != RIL_TOKEN_NULL && ril_data.tokens.registration_state != RIL_TOKEN_DATA_WAITING) {
- LOGE("Another NetRegist Req is in progress, skipping");
+ RIL_LOGE("Another NetRegist Req is in progress, skipping");
return;
}
@@ -572,7 +572,7 @@ void ipc_net_regist_unsol(struct ipc_message_info *info)
/* we already told RILJ to get the new data but it wasn't done yet */
if (ril_tokens_net_get_data_waiting() && ril_data.tokens.registration_state == RIL_TOKEN_DATA_WAITING) {
- LOGD("Updating NetRegist data in background");
+ RIL_LOGD("Updating NetRegist data in background");
} else {
ril_tokens_net_set_data_waiting();
#if RIL_VERSION >= 6
@@ -585,7 +585,7 @@ void ipc_net_regist_unsol(struct ipc_message_info *info)
case IPC_NET_SERVICE_DOMAIN_GPRS:
if (ril_data.tokens.gprs_registration_state != RIL_TOKEN_NULL && ril_data.tokens.gprs_registration_state != RIL_TOKEN_DATA_WAITING) {
- LOGE("Another GPRS NetRegist Req is in progress, skipping");
+ RIL_LOGE("Another GPRS NetRegist Req is in progress, skipping");
return;
}
@@ -593,7 +593,7 @@ void ipc_net_regist_unsol(struct ipc_message_info *info)
/* we already told RILJ to get the new data but it wasn't done yet */
if (ril_tokens_net_get_data_waiting() && ril_data.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING) {
- LOGD("Updating GPRSNetRegist data in background");
+ RIL_LOGD("Updating GPRSNetRegist data in background");
} else {
ril_tokens_net_set_data_waiting();
#if RIL_VERSION >= 6
@@ -604,7 +604,7 @@ void ipc_net_regist_unsol(struct ipc_message_info *info)
}
break;
default:
- LOGE("%s: unhandled service domain: %d", __func__, netinfo->domain);
+ RIL_LOGE("%s: unhandled service domain: %d", __func__, netinfo->domain);
break;
}
@@ -631,12 +631,12 @@ void ipc_net_regist_sol(struct ipc_message_info *info)
netinfo = (struct ipc_net_regist_response *) info->data;
t = ril_request_get_token(info->aseq);
- LOGD("Got SOL NetRegist message");
+ RIL_LOGD("Got SOL NetRegist message");
switch (netinfo->domain) {
case IPC_NET_SERVICE_DOMAIN_GSM:
if (ril_data.tokens.registration_state != t)
- LOGE("Registration state tokens mismatch");
+ RIL_LOGE("Registration state tokens mismatch");
/* Better keeping it up to date */
memcpy(&(ril_data.state.netinfo), netinfo, sizeof(struct ipc_net_regist_response));
@@ -655,7 +655,7 @@ void ipc_net_regist_sol(struct ipc_message_info *info)
break;
case IPC_NET_SERVICE_DOMAIN_GPRS:
if (ril_data.tokens.gprs_registration_state != t)
- LOGE("GPRS registration state tokens mismatch");
+ RIL_LOGE("GPRS registration state tokens mismatch");
/* Better keeping it up to date */
memcpy(&(ril_data.state.gprs_netinfo), netinfo, sizeof(struct ipc_net_regist_response));
@@ -672,7 +672,7 @@ void ipc_net_regist_sol(struct ipc_message_info *info)
ril_data.tokens.gprs_registration_state = RIL_TOKEN_NULL;
break;
default:
- LOGE("%s: unhandled service domain: %d", __func__, netinfo->domain);
+ RIL_LOGE("%s: unhandled service domain: %d", __func__, netinfo->domain);
break;
}
@@ -701,7 +701,7 @@ void ipc_net_regist(struct ipc_message_info *info)
ipc_net_regist_sol(info);
break;
default:
- LOGE("%s: unhandled ipc method: %d", __func__, info->type);
+ RIL_LOGE("%s: unhandled ipc method: %d", __func__, info->type);
break;
}
@@ -733,7 +733,7 @@ void ipc_net_plmn_list(struct ipc_message_info *info)
entries_info = (struct ipc_net_plmn_entries *) info->data;
entries = (struct ipc_net_plmn_entry *) (info->data + sizeof(struct ipc_net_plmn_entries));
- LOGD("Listed %d PLMNs\n", entries_info->num);
+ RIL_LOGD("Listed %d PLMNs\n", entries_info->num);
length = sizeof(char *) * 4 * entries_info->num;
response = (char **) calloc(1, length);
@@ -871,10 +871,10 @@ void ipc_net_plmn_sel_complete(struct ipc_message_info *info)
rc = ipc_gen_phone_res_check(phone_res);
if (rc < 0) {
if ((phone_res->code & 0x00ff) == 0x6f) {
- LOGE("Not authorized to register to this network!");
+ RIL_LOGE("Not authorized to register to this network!");
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_ILLEGAL_SIM_OR_ME, NULL, 0);
} else {
- LOGE("There was an error during operator selection!");
+ RIL_LOGE("There was an error during operator selection!");
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_GENERIC_FAILURE, NULL, 0);
}
return;
diff --git a/pwr.c b/pwr.c
index 989f727..e6c4eb4 100644
--- a/pwr.c
+++ b/pwr.c
@@ -51,7 +51,7 @@ void ipc_pwr_phone_state(struct ipc_message_info *info)
switch (state) {
case IPC_PWR_R(IPC_PWR_PHONE_STATE_LPM):
- LOGD("Got power to LPM");
+ RIL_LOGD("Got power to LPM");
if (ril_data.tokens.radio_power != RIL_TOKEN_NULL) {
ril_request_complete(ril_data.tokens.radio_power, RIL_E_SUCCESS, NULL, 0);
@@ -61,7 +61,7 @@ void ipc_pwr_phone_state(struct ipc_message_info *info)
ril_radio_state_update(RADIO_STATE_OFF);
break;
case IPC_PWR_R(IPC_PWR_PHONE_STATE_NORMAL):
- LOGD("Got power to NORMAL");
+ RIL_LOGD("Got power to NORMAL");
if (ril_data.tokens.radio_power != RIL_TOKEN_NULL) {
ril_request_complete(ril_data.tokens.radio_power, RIL_E_SUCCESS, NULL, 0);
@@ -88,10 +88,10 @@ void ril_request_radio_power(RIL_Token t, void *data, int length)
power_state = *((int *) data);
- LOGD("requested power_state is %d", power_state);
+ RIL_LOGD("requested power_state is %d", power_state);
if (power_state > 0) {
- LOGD("Request power to NORMAL");
+ RIL_LOGD("Request power to NORMAL");
power_data = IPC_PWR_PHONE_STATE_NORMAL;
ipc_gen_phone_res_expect_to_abort(ril_request_get_id(t), IPC_PWR_PHONE_STATE);
@@ -99,7 +99,7 @@ void ril_request_radio_power(RIL_Token t, void *data, int length)
ril_data.tokens.radio_power = t;
} else {
- LOGD("Request power to LPM");
+ RIL_LOGD("Request power to LPM");
power_data = IPC_PWR_PHONE_STATE_LPM;
ipc_gen_phone_res_expect_to_abort(ril_request_get_id(t), IPC_PWR_PHONE_STATE);
diff --git a/rfs.c b/rfs.c
index 0e287d0..da2a77e 100644
--- a/rfs.c
+++ b/rfs.c
@@ -46,13 +46,13 @@ void ipc_rfs_nv_read_item(struct ipc_message_info *info)
rfs_io_conf = calloc(1, rfs_io->length + sizeof(struct ipc_rfs_io_confirm));
rfs_data = rfs_io_conf + sizeof(struct ipc_rfs_io_confirm);
- LOGD("Asked to read 0x%x bytes at offset 0x%x", rfs_io->length, rfs_io->offset);
+ RIL_LOGD("Asked to read 0x%x bytes at offset 0x%x", rfs_io->length, rfs_io->offset);
rc = nv_data_read(ipc_client, rfs_io->offset, rfs_io->length, rfs_data);
- LOGD("Read rfs_data dump:");
+ RIL_LOGD("Read rfs_data dump:");
hex_dump(rfs_data, rfs_io->length > 0x100 ? 0x100 : rfs_io->length);
- LOGD("Sending RFS IO Confirm message (rc is %d)", rc);
+ RIL_LOGD("Sending RFS IO Confirm message (rc is %d)", rc);
rfs_io_conf->confirm = rc < 0 ? 0 : 1;
rfs_io_conf->offset = rfs_io->offset;
rfs_io_conf->length = rfs_io->length;
@@ -85,13 +85,13 @@ void ipc_rfs_nv_write_item(struct ipc_message_info *info)
memset(&rfs_io_conf, 0, sizeof(rfs_io_conf));
rfs_data = info->data + sizeof(struct ipc_rfs_io);
- LOGD("Write rfs_data dump:");
+ RIL_LOGD("Write rfs_data dump:");
hex_dump(rfs_data, rfs_io->length > 0x100 ? 0x100 : rfs_io->length);
- LOGD("Asked to write 0x%x bytes at offset 0x%x", rfs_io->length, rfs_io->offset);
+ RIL_LOGD("Asked to write 0x%x bytes at offset 0x%x", rfs_io->length, rfs_io->offset);
rc = nv_data_write(ipc_client, rfs_io->offset, rfs_io->length, rfs_data);
- LOGD("Sending RFS IO Confirm message (rc is %d)", rc);
+ RIL_LOGD("Sending RFS IO Confirm message (rc is %d)", rc);
rfs_io_conf.confirm = rc < 0 ? 0 : 1;
rfs_io_conf.offset = rfs_io->offset;
rfs_io_conf.length = rfs_io->length;
diff --git a/samsung-ril.c b/samsung-ril.c
index fc29660..245685e 100644
--- a/samsung-ril.c
+++ b/samsung-ril.c
@@ -270,7 +270,7 @@ int ril_radio_state_complete(RIL_RadioState radio_state, RIL_Token token)
void ril_radio_state_update(RIL_RadioState radio_state)
{
- LOGD("Setting radio state to %d", radio_state);
+ RIL_LOGD("Setting radio state to %d", radio_state);
ril_data.state.radio_state = radio_state;
ril_request_unsolicited(RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED, NULL, 0);
@@ -446,7 +446,7 @@ void ipc_fmt_dispatch(struct ipc_message_info *info)
ipc_gprs_pdp_context(info);
break;
default:
- LOGE("%s: Unhandled request: %s (%04x)", __func__, ipc_command_to_str(IPC_COMMAND(info)), IPC_COMMAND(info));
+ RIL_LOGE("%s: Unhandled request: %s (%04x)", __func__, ipc_command_to_str(IPC_COMMAND(info)), IPC_COMMAND(info));
break;
}
@@ -468,7 +468,7 @@ void ipc_rfs_dispatch(struct ipc_message_info *info)
ipc_rfs_nv_write_item(info);
break;
default:
- LOGE("%s: Unhandled request: %s (%04x)", __func__, ipc_command_to_str(IPC_COMMAND(info)), IPC_COMMAND(info));
+ RIL_LOGE("%s: Unhandled request: %s (%04x)", __func__, ipc_command_to_str(IPC_COMMAND(info)), IPC_COMMAND(info));
break;
}
@@ -496,7 +496,7 @@ void srs_dispatch(struct srs_message *message)
srs_snd_set_call_audio_path(message);
break;
default:
- LOGE("%s: Unhandled request: (%04x)", __func__, message->command);
+ RIL_LOGE("%s: Unhandled request: (%04x)", __func__, message->command);
break;
}
@@ -684,7 +684,7 @@ void ril_on_request(int request, void *data, size_t length, RIL_Token t)
ril_request_complete(t, RIL_E_SUCCESS, NULL, 0);
break;
default:
- LOGE("%s: Unhandled request: %d", __func__, request);
+ RIL_LOGE("%s: Unhandled request: %d", __func__, request);
ril_request_complete(t, RIL_E_REQUEST_NOT_SUPPORTED, NULL, 0);
break;
}
@@ -753,67 +753,67 @@ const RIL_RadioFunctions *RIL_Init(const struct RIL_Env *env, int argc, char **a
RIL_LOCK();
- LOGD("Creating IPC FMT client");
+ RIL_LOGD("Creating IPC FMT client");
ipc_fmt_client = ril_client_new(&ipc_fmt_client_funcs);
rc = ril_client_create(ipc_fmt_client);
if (rc < 0) {
- LOGE("IPC FMT client creation failed.");
+ RIL_LOGE("IPC FMT client creation failed.");
goto ipc_rfs;
}
rc = ril_client_thread_start(ipc_fmt_client);
if (rc < 0) {
- LOGE("IPC FMT thread creation failed.");
+ RIL_LOGE("IPC FMT thread creation failed.");
goto ipc_rfs;
}
ril_data.ipc_fmt_client = ipc_fmt_client;
- LOGD("IPC FMT client ready");
+ RIL_LOGD("IPC FMT client ready");
ipc_rfs:
- LOGD("Creating IPC RFS client");
+ RIL_LOGD("Creating IPC RFS client");
ipc_rfs_client = ril_client_new(&ipc_rfs_client_funcs);
rc = ril_client_create(ipc_rfs_client);
if (rc < 0) {
- LOGE("IPC RFS client creation failed.");
+ RIL_LOGE("IPC RFS client creation failed.");
goto srs;
}
rc = ril_client_thread_start(ipc_rfs_client);
if (rc < 0) {
- LOGE("IPC RFS thread creation failed.");
+ RIL_LOGE("IPC RFS thread creation failed.");
goto srs;
}
ril_data.ipc_rfs_client = ipc_rfs_client;
- LOGD("IPC RFS client ready");
+ RIL_LOGD("IPC RFS client ready");
srs:
- LOGD("Creating SRS client");
+ RIL_LOGD("Creating SRS client");
srs_client = ril_client_new(&srs_client_funcs);
rc = ril_client_create(srs_client);
if (rc < 0) {
- LOGE("SRS client creation failed.");
+ RIL_LOGE("SRS client creation failed.");
goto end;
}
rc = ril_client_thread_start(srs_client);
if (rc < 0) {
- LOGE("SRS thread creation failed.");
+ RIL_LOGE("SRS thread creation failed.");
goto end;
}
ril_data.srs_client = srs_client;
- LOGD("SRS client ready");
+ RIL_LOGD("SRS client ready");
end:
RIL_UNLOCK();
diff --git a/samsung-ril.h b/samsung-ril.h
index 6fdc686..a154218 100644
--- a/samsung-ril.h
+++ b/samsung-ril.h
@@ -37,16 +37,22 @@
* Defines
*/
-#ifndef LOGE
- #define LOGE ALOGE
+#ifdef ALOGI
+#define RIL_LOGI ALOGI
+#else
+#define RIL_LOGI LOGI
#endif
-#ifndef LOGI
- #define LOGI ALOGI
+#ifdef ALOGD
+#define RIL_LOGD ALOGD
+#else
+#define RIL_LOGD LOGD
#endif
-#ifndef LOGD
- #define LOGD ALOGD
+#ifdef ALOGE
+#define RIL_LOGE ALOGE
+#else
+#define RIL_LOGE LOGE
#endif
#define RIL_VERSION_STRING "Samsung RIL"
diff --git a/sat.c b/sat.c
index 4a95cc6..d05e674 100644
--- a/sat.c
+++ b/sat.c
@@ -64,7 +64,7 @@ void ipc_sat_proactive_cmd_sol(struct ipc_message_info *info)
if (sw1 == 0x90 && sw2 == 0x00) {
ril_request_unsolicited(RIL_UNSOL_STK_SESSION_END, NULL, 0);
} else {
- LOGE("%s: unhandled response sw1=%02x sw2=%02x", __func__, sw1, sw2);
+ RIL_LOGE("%s: unhandled response sw1=%02x sw2=%02x", __func__, sw1, sw2);
}
return;
@@ -81,7 +81,7 @@ void ipc_sat_proactive_cmd(struct ipc_message_info *info)
} else if (info->type == IPC_TYPE_RESP) {
ipc_sat_proactive_cmd_sol(info);
} else {
- LOGE("%s: unhandled proactive command response type %d",__func__, info->type);
+ RIL_LOGE("%s: unhandled proactive command response type %d",__func__, info->type);
}
}
@@ -95,7 +95,7 @@ void ril_request_stk_send_terminal_response(RIL_Token t, void *data, size_t leng
size = strlen(data) / 2;
if (size > 255) {
- LOGE("%s: data exceeds maximum length", __func__);
+ RIL_LOGE("%s: data exceeds maximum length", __func__);
goto error;
}
@@ -124,7 +124,7 @@ void ril_request_stk_send_envelope_command(RIL_Token t, void *data, size_t lengt
size = strlen(data) / 2;
if (size > 255) {
- LOGE("%s: data exceeds maximum length", __func__);
+ RIL_LOGE("%s: data exceeds maximum length", __func__);
goto error;
}
diff --git a/sec.c b/sec.c
index 0e0bdb6..7d92f26 100644
--- a/sec.c
+++ b/sec.c
@@ -43,7 +43,7 @@ ril_sim_state ipc2ril_sim_state(struct ipc_sec_sim_status_response *pin_status)
case IPC_SEC_FACILITY_LOCK_TYPE_SC_CARD_BLOCKED:
return SIM_STATE_BLOCKED;
default:
- LOGE("Unknown SIM facility lock: 0x%x", pin_status->facility_lock);
+ RIL_LOGE("Unknown SIM facility lock: 0x%x", pin_status->facility_lock);
return SIM_STATE_ABSENT;
}
break;
@@ -67,7 +67,7 @@ ril_sim_state ipc2ril_sim_state(struct ipc_sec_sim_status_response *pin_status)
case IPC_SEC_SIM_STATUS_CARD_ERROR:
return SIM_STATE_ABSENT;
default:
- LOGE("Unknown SIM status: 0x%x", pin_status->status);
+ RIL_LOGE("Unknown SIM status: 0x%x", pin_status->status);
return SIM_STATE_ABSENT;
}
}
@@ -184,12 +184,12 @@ void ipc2ril_card_status(struct ipc_sec_sim_status_response *pin_status, RIL_Car
card_status->cdma_subscription_app_index = (int) sim_state;
card_status->num_applications = app_status_array_length;
- LOGD("Selecting application #%d on %d", (int) sim_state, app_status_array_length);
+ RIL_LOGD("Selecting application #%d on %d", (int) sim_state, app_status_array_length);
}
void ril_tokens_pin_status_dump(void)
{
- LOGD("ril_tokens_pin_status_dump:\n\
+ RIL_LOGD("ril_tokens_pin_status_dump:\n\
\tril_data.tokens.pin_status = %p\n", ril_data.tokens.pin_status);
}
@@ -215,10 +215,10 @@ void ipc_sec_sim_status(struct ipc_message_info *info)
if (ril_radio_state_complete(RADIO_STATE_OFF, RIL_TOKEN_NULL))
return;
- LOGD("Got UNSOL PIN status message");
+ RIL_LOGD("Got UNSOL PIN status message");
if (ril_data.tokens.pin_status != RIL_TOKEN_NULL && ril_data.tokens.pin_status != RIL_TOKEN_DATA_WAITING) {
- LOGE("Another PIN status Req is in progress, skipping");
+ RIL_LOGE("Another PIN status Req is in progress, skipping");
return;
}
@@ -231,10 +231,10 @@ void ipc_sec_sim_status(struct ipc_message_info *info)
ril_request_unsolicited(RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED, NULL, 0);
break;
case IPC_TYPE_RESP:
- LOGD("Got SOL PIN status message");
+ RIL_LOGD("Got SOL PIN status message");
if (ril_data.tokens.pin_status != t)
- LOGE("PIN status tokens mismatch");
+ RIL_LOGE("PIN status tokens mismatch");
sim_state = ipc2ril_sim_state(pin_status);
ril_state_update(sim_state);
@@ -249,7 +249,7 @@ void ipc_sec_sim_status(struct ipc_message_info *info)
ril_data.tokens.pin_status = RIL_TOKEN_NULL;
break;
default:
- LOGE("%s: unhandled ipc method: %d", __func__, info->type);
+ RIL_LOGE("%s: unhandled ipc method: %d", __func__, info->type);
break;
}
@@ -275,7 +275,7 @@ void ril_request_get_sim_status(RIL_Token t)
return;
if (ril_data.tokens.pin_status == RIL_TOKEN_DATA_WAITING) {
- LOGD("Got RILJ request for UNSOL data");
+ RIL_LOGD("Got RILJ request for UNSOL data");
hex_dump(&(ril_data.state.sim_pin_status), sizeof(struct ipc_sec_sim_status_response));
pin_status = &(ril_data.state.sim_pin_status);
@@ -285,14 +285,14 @@ void ril_request_get_sim_status(RIL_Token t)
ril_data.tokens.pin_status = RIL_TOKEN_NULL;
} else if (ril_data.tokens.pin_status == RIL_TOKEN_NULL) {
- LOGD("Got RILJ request for SOL data");
+ RIL_LOGD("Got RILJ request for SOL data");
/* Request data to the modem */
ril_data.tokens.pin_status = t;
ipc_fmt_send_get(IPC_SEC_SIM_STATUS, ril_request_get_id(t));
} else {
- LOGE("Another request is going on, returning UNSOL data");
+ RIL_LOGE("Another request is going on, returning UNSOL data");
pin_status = &(ril_data.state.sim_pin_status);
@@ -526,7 +526,7 @@ void ril_request_sim_io(RIL_Token t, void *data, int length)
sim_io->p1, sim_io->p2, sim_io->p3, sim_io_data, sim_io_data_length,
&sim_io_info);
if (rc < 0 || sim_io_info == NULL) {
- LOGE("Unable to add the request to the list");
+ RIL_LOGE("Unable to add the request to the list");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
if (sim_io_data != NULL)
@@ -537,7 +537,7 @@ void ril_request_sim_io(RIL_Token t, void *data, int length)
}
if (ril_data.tokens.sim_io != RIL_TOKEN_NULL) {
- LOGD("Another SIM I/O is being processed, adding to the list");
+ RIL_LOGD("Another SIM I/O is being processed, adding to the list");
return;
}
@@ -576,7 +576,7 @@ void ipc_sec_rsim_access(struct ipc_message_info *info)
sim_io_info = ril_request_sim_io_info_find_token(ril_request_get_token(info->aseq));
if (sim_io_info == NULL) {
- LOGE("Unable to find SIM I/O in the list!");
+ RIL_LOGE("Unable to find SIM I/O in the list!");
// Send the next SIM I/O in the list
ril_request_sim_io_next();
@@ -687,7 +687,7 @@ void ipc_sec_rsim_access(struct ipc_message_info *info)
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_SUCCESS, &sim_io_response, sizeof(sim_io_response));
if (sim_io_response.simResponse != NULL) {
- LOGD("SIM response: %s", sim_io_response.simResponse);
+ RIL_LOGD("SIM response: %s", sim_io_response.simResponse);
free(sim_io_response.simResponse);
}
@@ -713,17 +713,17 @@ void ipc_sec_sim_status_complete(struct ipc_message_info *info)
rc = ipc_gen_phone_res_check(phone_res);
if (rc < 0) {
if ((phone_res->code & 0x00ff) == 0x10) {
- LOGE("Wrong password!");
+ RIL_LOGE("Wrong password!");
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_PASSWORD_INCORRECT, &attempts, sizeof(attempts));
} else if ((phone_res->code & 0x00ff) == 0x0c) {
- LOGE("Wrong password and no attempts left!");
+ RIL_LOGE("Wrong password and no attempts left!");
attempts = 0;
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_PASSWORD_INCORRECT, &attempts, sizeof(attempts));
ril_request_unsolicited(RIL_UNSOL_RESPONSE_SIM_STATUS_CHANGED, NULL, 0);
} else {
- LOGE("There was an error during pin status complete!");
+ RIL_LOGE("There was an error during pin status complete!");
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_GENERIC_FAILURE, NULL, 0);
}
return;
@@ -749,9 +749,9 @@ void ipc_sec_lock_info(struct ipc_message_info *info)
if (lock_info->type == IPC_SEC_PIN_TYPE_PIN1) {
attempts = lock_info->attempts;
- LOGD("%s: PIN1 %d attempts left", __func__, attempts);
+ RIL_LOGD("%s: PIN1 %d attempts left", __func__, attempts);
} else {
- LOGE("%s: unhandled lock type %d", __func__, lock_info->type);
+ RIL_LOGE("%s: unhandled lock type %d", __func__, lock_info->type);
}
}
@@ -769,7 +769,7 @@ void ril_request_enter_sim_pin(RIL_Token t, void *data, size_t length)
// 1. Send PIN
if (strlen(data) > 16) {
- LOGE("%s: pin exceeds maximum length", __func__);
+ RIL_LOGE("%s: pin exceeds maximum length", __func__);
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
@@ -908,7 +908,7 @@ void ril_request_query_facility_lock(RIL_Token t, void *data, size_t length)
} else if (!strcmp(facility, "PC")) {
lock_request.facility = IPC_SEC_FACILITY_TYPE_PC;
} else {
- LOGE("%s: unsupported facility: %s", __func__, facility);
+ RIL_LOGE("%s: unsupported facility: %s", __func__, facility);
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
@@ -958,7 +958,7 @@ void ril_request_set_facility_lock(RIL_Token t, void *data, size_t length)
} else if (!strcmp(facility, "PC")) {
lock_request.type = IPC_SEC_SIM_STATUS_LOCK_PC;
} else {
- LOGE("%s: unsupported facility: %s", __func__, facility);
+ RIL_LOGE("%s: unsupported facility: %s", __func__, facility);
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
diff --git a/sms.c b/sms.c
index 0a1f310..2b990e3 100644
--- a/sms.c
+++ b/sms.c
@@ -207,7 +207,7 @@ void ril_request_send_sms_next(void)
ril_request_send_sms_unregister(send_sms);
if (pdu == NULL) {
- LOGE("SMS send request has no valid PDU");
+ RIL_LOGE("SMS send request has no valid PDU");
if (smsc != NULL)
free(smsc);
return;
@@ -216,11 +216,11 @@ void ril_request_send_sms_next(void)
ril_data.tokens.outgoing_sms = t;
if (smsc == NULL) {
// We first need to get SMS SVC before sending the message
- LOGD("We have no SMSC, let's ask one");
+ RIL_LOGD("We have no SMSC, let's ask one");
rc = ril_request_send_sms_register(pdu, pdu_length, NULL, 0, t);
if (rc < 0) {
- LOGE("Unable to add the request to the list");
+ RIL_LOGE("Unable to add the request to the list");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
if (pdu != NULL)
@@ -256,7 +256,7 @@ void ril_request_send_sms_complete(RIL_Token t, char *pdu, int pdu_length, unsig
goto error;
if ((pdu_length / 2 + smsc_length) > 0xfe) {
- LOGE("PDU or SMSC too large, aborting");
+ RIL_LOGE("PDU or SMSC too large, aborting");
goto error;
}
@@ -266,7 +266,7 @@ void ril_request_send_sms_complete(RIL_Token t, char *pdu, int pdu_length, unsig
// Length of the final message
length = sizeof(send_msg) + pdu_hex_length + smsc_length;
- LOGD("Sending SMS message (length: 0x%x)!", length);
+ RIL_LOGD("Sending SMS message (length: 0x%x)!", length);
pdu_hex = calloc(1, pdu_hex_length);
hex2bin(pdu, pdu_length, pdu_hex);
@@ -277,27 +277,27 @@ void ril_request_send_sms_complete(RIL_Token t, char *pdu, int pdu_length, unsig
unsigned char pdu_tp_da_len = pdu_hex[pdu_tp_da_index];
if (pdu_tp_da_len > 0xff / 2) {
- LOGE("PDU TP-DA Len failed (0x%x)\n", pdu_tp_da_len);
+ RIL_LOGE("PDU TP-DA Len failed (0x%x)\n", pdu_tp_da_len);
goto pdu_end;
}
- LOGD("PDU TP-DA Len is 0x%x\n", pdu_tp_da_len);
+ RIL_LOGD("PDU TP-DA Len is 0x%x\n", pdu_tp_da_len);
int pdu_tp_udh_index = pdu_tp_da_index + pdu_tp_da_len;
unsigned char pdu_tp_udh_len = pdu_hex[pdu_tp_udh_index];
if (pdu_tp_udh_len > 0xff / 2 || pdu_tp_udh_len < 5) {
- LOGE("PDU TP-UDH Len failed (0x%x)\n", pdu_tp_udh_len);
+ RIL_LOGE("PDU TP-UDH Len failed (0x%x)\n", pdu_tp_udh_len);
goto pdu_end;
}
- LOGD("PDU TP-UDH Len is 0x%x\n", pdu_tp_udh_len);
+ RIL_LOGD("PDU TP-UDH Len is 0x%x\n", pdu_tp_udh_len);
int pdu_tp_udh_num_index = pdu_tp_udh_index + 4;
unsigned char pdu_tp_udh_num = pdu_hex[pdu_tp_udh_num_index];
if (pdu_tp_udh_num > 0xf) {
- LOGE("PDU TP-UDH Num failed (0x%x)\n", pdu_tp_udh_num);
+ RIL_LOGE("PDU TP-UDH Num failed (0x%x)\n", pdu_tp_udh_num);
goto pdu_end;
}
@@ -305,14 +305,14 @@ void ril_request_send_sms_complete(RIL_Token t, char *pdu, int pdu_length, unsig
unsigned char pdu_tp_udh_seq = pdu_hex[pdu_tp_udh_seq_index];
if (pdu_tp_udh_seq > 0xf || pdu_tp_udh_seq > pdu_tp_udh_num) {
- LOGE("PDU TP-UDH Seq failed (0x%x)\n", pdu_tp_udh_seq);
+ RIL_LOGE("PDU TP-UDH Seq failed (0x%x)\n", pdu_tp_udh_seq);
goto pdu_end;
}
- LOGD("We are sending message %d on %d\n", pdu_tp_udh_seq, pdu_tp_udh_num);
+ RIL_LOGD("We are sending message %d on %d\n", pdu_tp_udh_seq, pdu_tp_udh_num);
if (pdu_tp_udh_num > 1) {
- LOGD("We are sending a multi-part message!");
+ RIL_LOGD("We are sending a multi-part message!");
send_msg_type = IPC_SMS_MSG_MULTIPLE;
}
@@ -379,11 +379,11 @@ void ril_request_send_sms(RIL_Token t, void *data, size_t length)
}
if (ril_data.tokens.outgoing_sms != RIL_TOKEN_NULL) {
- LOGD("Another outgoing SMS is being processed, adding to the list");
+ RIL_LOGD("Another outgoing SMS is being processed, adding to the list");
rc = ril_request_send_sms_register(pdu, pdu_length, smsc, smsc_length, t);
if (rc < 0) {
- LOGE("Unable to add the request to the list");
+ RIL_LOGE("Unable to add the request to the list");
goto error;
}
@@ -393,11 +393,11 @@ void ril_request_send_sms(RIL_Token t, void *data, size_t length)
ril_data.tokens.outgoing_sms = t;
if (smsc == NULL) {
// We first need to get SMS SVC before sending the message
- LOGD("We have no SMSC, let's ask one");
+ RIL_LOGD("We have no SMSC, let's ask one");
rc = ril_request_send_sms_register(pdu, pdu_length, NULL, 0, t);
if (rc < 0) {
- LOGE("Unable to add the request to the list");
+ RIL_LOGE("Unable to add the request to the list");
goto error;
}
@@ -444,7 +444,7 @@ void ipc_sms_svc_center_addr(struct ipc_message_info *info)
send_sms = ril_request_send_sms_info_find_token(ril_request_get_token(info->aseq));
if (send_sms == NULL || send_sms->pdu == NULL || send_sms->pdu_length <= 0) {
- LOGE("The request wasn't queued, reporting generic error!");
+ RIL_LOGE("The request wasn't queued, reporting generic error!");
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_GENERIC_FAILURE, NULL, 0);
ril_request_send_sms_info_clear(send_sms);
@@ -461,7 +461,7 @@ void ipc_sms_svc_center_addr(struct ipc_message_info *info)
smsc = (unsigned char *) info->data + sizeof(unsigned char);
smsc_length = (int) ((unsigned char *) info->data)[0];
- LOGD("Got SMSC, completing the request");
+ RIL_LOGD("Got SMSC, completing the request");
ril_request_send_sms_unregister(send_sms);
ril_request_send_sms_complete(t, pdu, pdu_length, smsc, smsc_length);
if (pdu != NULL)
@@ -480,7 +480,7 @@ void ipc_sms_send_msg_complete(struct ipc_message_info *info)
phone_res = (struct ipc_gen_phone_res *) info->data;
if (ipc_gen_phone_res_check(phone_res) < 0) {
- LOGE("IPC_GEN_PHONE_RES indicates error, abort request to RILJ");
+ RIL_LOGE("IPC_GEN_PHONE_RES indicates error, abort request to RILJ");
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_GENERIC_FAILURE, NULL, 0);
// Send the next SMS in the list
@@ -499,7 +499,7 @@ void ipc_sms_send_msg(struct ipc_message_info *info)
report_msg = (struct ipc_sms_send_msg_response *) info->data;
- LOGD("Got ACK for msg_tpid #%d\n", report_msg->msg_tpid);
+ RIL_LOGD("Got ACK for msg_tpid #%d\n", report_msg->msg_tpid);
memset(&response, 0, sizeof(response));
response.messageRef = report_msg->msg_tpid;
@@ -620,7 +620,7 @@ void ipc_sms_incoming_msg_complete(char *pdu, int length, unsigned char type, un
} else if (type == IPC_SMS_TYPE_STATUS_REPORT) {
ril_request_unsolicited(RIL_UNSOL_RESPONSE_NEW_SMS_STATUS_REPORT, pdu, length);
} else {
- LOGE("Unhandled message type: %x", type);
+ RIL_LOGE("Unhandled message type: %x", type);
}
free(pdu);
@@ -646,10 +646,10 @@ void ipc_sms_incoming_msg(struct ipc_message_info *info)
bin2hex(pdu_hex, msg->length, pdu);
if (ril_data.state.sms_incoming_msg_tpid != 0) {
- LOGD("Another message is waiting ACK, queuing");
+ RIL_LOGD("Another message is waiting ACK, queuing");
rc = ipc_sms_incoming_msg_register(pdu, length, msg->type, msg->msg_tpid);
if (rc < 0)
- LOGE("Unable to register incoming msg");
+ RIL_LOGE("Unable to register incoming msg");
return;
}
@@ -688,7 +688,7 @@ void ril_request_sms_acknowledge(RIL_Token t, void *data, size_t length)
fail_cause = ((int *) data)[1];
if (ril_data.state.sms_incoming_msg_tpid == 0) {
- LOGE("There is no SMS message to ACK!");
+ RIL_LOGE("There is no SMS message to ACK!");
goto error;
}
@@ -885,10 +885,10 @@ int ril_sms_send(char *number, char *message)
ril_data.state.ril_sms_tpid = RIL_SMS_TPID;
if (ril_data.state.sms_incoming_msg_tpid != 0) {
- LOGD("Another message is waiting ACK, queuing");
+ RIL_LOGD("Another message is waiting ACK, queuing");
rc = ipc_sms_incoming_msg_register(pdu, length, IPC_SMS_TYPE_POINT_TO_POINT, ril_data.state.ril_sms_tpid);
if (rc < 0) {
- LOGE("Unable to register incoming msg");
+ RIL_LOGE("Unable to register incoming msg");
return -1;
}
diff --git a/snd.c b/snd.c
index 4af8287..f71da7f 100644
--- a/snd.c
+++ b/snd.c
@@ -35,7 +35,7 @@ unsigned char srs2ipc_call_type(int type)
case SRS_SND_TYPE_BTVOICE:
return IPC_SND_VOLUME_TYPE_BTVOICE;
default:
- LOGE("Unknown call type: 0x%x", type);
+ RIL_LOGE("Unknown call type: 0x%x", type);
return 0;
}
}
@@ -56,7 +56,7 @@ unsigned char srs2ipc_audio_path(int path)
case SRS_SND_PATH_HEADPHONE:
return IPC_SND_AUDIO_PATH_HEADPHONE;
default:
- LOGE("Unknown audio path: 0x%x", path);
+ RIL_LOGE("Unknown audio path: 0x%x", path);
return 0;
}
}
@@ -75,7 +75,7 @@ void ril_request_set_mute(RIL_Token t, void *data, int length)
value = (int *) data;
mute = *value ? 1 : 0;
- LOGD("Mute is %d\n", mute);
+ RIL_LOGD("Mute is %d\n", mute);
ipc_gen_phone_res_expect_to_complete(ril_request_get_id(t), IPC_SND_MIC_MUTE_CTRL);
@@ -91,7 +91,7 @@ void srs_snd_set_call_clock_sync(struct srs_message *message)
sync = (unsigned char *) message->data;
- LOGD("Clock sync is 0x%x\n", *sync);
+ RIL_LOGD("Clock sync is 0x%x\n", *sync);
ipc_fmt_send(IPC_SND_CLOCK_CTRL, IPC_TYPE_EXEC, sync, sizeof(unsigned char), ril_request_id_get());
}
@@ -106,7 +106,7 @@ void srs_snd_set_call_volume(struct srs_message *message)
call_volume = (struct srs_snd_call_volume *) message->data;
- LOGD("Call volume for: 0x%x vol = 0x%x\n", call_volume->type, call_volume->volume);
+ RIL_LOGD("Call volume for: 0x%x vol = 0x%x\n", call_volume->type, call_volume->volume);
memset(&volume_ctrl, 0, sizeof(volume_ctrl));
volume_ctrl.type = srs2ipc_call_type(call_volume->type);
@@ -126,7 +126,7 @@ void srs_snd_set_call_audio_path(struct srs_message *message)
audio_path = (int *) message->data;
path = srs2ipc_audio_path(*audio_path);
- LOGD("Audio path to: 0x%x\n", path);
+ RIL_LOGD("Audio path to: 0x%x\n", path);
ipc_fmt_send(IPC_SND_AUDIO_PATH_CTRL, IPC_TYPE_SET, (void *) &path, sizeof(path), ril_request_id_get());
}
diff --git a/srs.c b/srs.c
index 741d01e..b05beb3 100644
--- a/srs.c
+++ b/srs.c
@@ -216,14 +216,14 @@ int srs_client_send_message(struct srs_client_data *srs_client_data, struct srs_
rc = select(srs_client_data->client_fd + 1, NULL, &fds, NULL, &timeout);
if (!FD_ISSET(srs_client_data->client_fd, &fds)) {
- LOGE("SRS write select failed on fd %d", srs_client_data->client_fd);
+ RIL_LOGE("SRS write select failed on fd %d", srs_client_data->client_fd);
rc = -1;
goto complete;
}
rc = write(srs_client_data->client_fd, data, header.length);
if (rc < (int) sizeof(struct srs_header)) {
- LOGE("SRS write failed on fd %d with %d bytes", srs_client_data->client_fd, rc);
+ RIL_LOGE("SRS write failed on fd %d with %d bytes", srs_client_data->client_fd, rc);
rc = -1;
goto complete;
}
@@ -253,7 +253,7 @@ int srs_client_send(struct srs_client_data *srs_client_data, unsigned short comm
RIL_CLIENT_UNLOCK(srs_client_data->client);
if (rc <= 0) {
- LOGD("SRS client with fd %d terminated", srs_client_data->client_fd);
+ RIL_LOGD("SRS client with fd %d terminated", srs_client_data->client_fd);
client = srs_client_info_find_fd(srs_client_data, srs_client_data->client_fd);
if (client != NULL)
@@ -275,11 +275,11 @@ int srs_send(unsigned short command, void *data, int length)
srs_client_data = (struct srs_client_data *) ril_data.srs_client->data;
- LOGD("SEND SRS: fd=%d command=%d length=%d", srs_client_data->client_fd, command, length);
+ RIL_LOGD("SEND SRS: fd=%d command=%d length=%d", srs_client_data->client_fd, command, length);
if (data != NULL && length > 0) {
- LOGD("==== SRS DATA DUMP ====");
+ RIL_LOGD("==== SRS DATA DUMP ====");
hex_dump(data, length);
- LOGD("=======================");
+ RIL_LOGD("=======================");
}
return srs_client_send(srs_client_data, command, data, length);
@@ -313,14 +313,14 @@ int srs_client_recv(struct srs_client_data *srs_client_data, struct srs_message
rc = select(srs_client_data->client_fd + 1, &fds, NULL, NULL, &timeout);
if (!FD_ISSET(srs_client_data->client_fd, &fds)) {
- LOGE("SRS read select failed on fd %d", srs_client_data->client_fd);
+ RIL_LOGE("SRS read select failed on fd %d", srs_client_data->client_fd);
rc = -1;
goto complete;
}
rc = read(srs_client_data->client_fd, data, SRS_DATA_MAX_SIZE);
if (rc < (int) sizeof(struct srs_header)) {
- LOGE("SRS read failed on fd %d with %d bytes", srs_client_data->client_fd, rc);
+ RIL_LOGE("SRS read failed on fd %d with %d bytes", srs_client_data->client_fd, rc);
rc = -1;
goto complete;
}
@@ -415,7 +415,7 @@ void *srs_client_read_loop(void *data)
RIL_CLIENT_LOCK(srs_client_data->client);
rc = srs_client_recv(srs_client_data, &message);
if (rc <= 0) {
- LOGD("SRS client with fd %d terminated", fd);
+ RIL_LOGD("SRS client with fd %d terminated", fd);
client = srs_client_info_find_fd(srs_client_data, fd);
if (client != NULL)
@@ -427,11 +427,11 @@ void *srs_client_read_loop(void *data)
}
RIL_CLIENT_UNLOCK(srs_client_data->client);
- LOGD("RECV SRS: fd=%d command=%d length=%d", fd, message.command, message.length);
+ RIL_LOGD("RECV SRS: fd=%d command=%d length=%d", fd, message.command, message.length);
if (message.data != NULL && message.length > 0) {
- LOGD("==== SRS DATA DUMP ====");
+ RIL_LOGD("==== SRS DATA DUMP ====");
hex_dump(message.data, message.length);
- LOGD("=======================");
+ RIL_LOGD("=======================");
}
srs_dispatch(&message);
@@ -471,7 +471,7 @@ int srs_read_loop(struct ril_client *client)
rc = pthread_create(&srs_client_data->thread, &attr, srs_client_read_loop, (void *) srs_client_data);
if (rc < 0) {
- LOGE("Unable to create SRS client read loop thread");
+ RIL_LOGE("Unable to create SRS client read loop thread");
return -1;
}
@@ -479,7 +479,7 @@ int srs_read_loop(struct ril_client *client)
fd = accept(srs_client_data->server_fd, (struct sockaddr *) &client_addr,
&client_addr_len);
if (fd < 0) {
- LOGE("Unable to accept new SRS client");
+ RIL_LOGE("Unable to accept new SRS client");
break;
}
@@ -487,18 +487,18 @@ int srs_read_loop(struct ril_client *client)
flags |= O_NONBLOCK;
fcntl(fd, F_SETFL, flags);
- LOGD("Accepted new SRS client from fd %d", fd);
+ RIL_LOGD("Accepted new SRS client from fd %d", fd);
SRS_CLIENT_LOCK();
rc = srs_client_register(srs_client_data, fd);
SRS_CLIENT_UNLOCK();
if (rc < 0) {
- LOGE("Unable to register SRS client");
+ RIL_LOGE("Unable to register SRS client");
break;
}
}
- LOGE("SRS server failure");
+ RIL_LOGE("SRS server failure");
srs_client_data->running = 0;
@@ -515,7 +515,7 @@ int srs_create(struct ril_client *client)
if (client == NULL)
return -EINVAL;
- LOGD("Creating new SRS client");
+ RIL_LOGD("Creating new SRS client");
signal(SIGPIPE, SIG_IGN);
@@ -523,7 +523,7 @@ int srs_create(struct ril_client *client)
srs_client_data->server_fd = srs_server_open();
if (srs_client_data->server_fd < 0) {
- LOGE("SRS server creation failed");
+ RIL_LOGE("SRS server creation failed");
goto error;
}
@@ -546,7 +546,7 @@ int srs_destroy(struct ril_client *client)
struct srs_client_info *client_info;
if (client == NULL || client->data == NULL) {
- LOGE("Client was already destroyed");
+ RIL_LOGE("Client was already destroyed");
return 0;
}
diff --git a/ss.c b/ss.c
index d28221c..bad8958 100644
--- a/ss.c
+++ b/ss.c
@@ -32,7 +32,7 @@ void ipc_ss_ussd_complete(struct ipc_message_info *info)
rc = ipc_gen_phone_res_check(phone_res);
if (rc < 0) {
- LOGE("There was an error, aborting USSD request");
+ RIL_LOGE("There was an error, aborting USSD request");
ril_request_complete(ril_request_get_token(info->aseq), RIL_E_GENERIC_FAILURE, NULL, 0);
ril_data.state.ussd_state = 0;
@@ -66,11 +66,11 @@ void ril_request_send_ussd(RIL_Token t, void *data, size_t length)
case IPC_SS_USSD_OTHER_CLIENT:
case IPC_SS_USSD_NOT_SUPPORT:
case IPC_SS_USSD_TIME_OUT:
- LOGD("USSD Tx encoding is GSM7");
+ RIL_LOGD("USSD Tx encoding is GSM7");
data_enc_len = ascii2gsm7_ussd(data, (unsigned char**)&data_enc, length);
if (data_enc_len > message_size) {
- LOGE("USSD message size is too long, aborting");
+ RIL_LOGE("USSD message size is too long, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
free(data_enc);
@@ -93,12 +93,12 @@ void ril_request_send_ussd(RIL_Token t, void *data, size_t length)
break;
case IPC_SS_USSD_ACTION_REQUIRE:
default:
- LOGD("USSD Tx encoding is ASCII");
+ RIL_LOGD("USSD Tx encoding is ASCII");
data_enc_len = asprintf(&data_enc, "%s", (char*)data);
if (data_enc_len > message_size) {
- LOGE("USSD message size is too long, aborting");
+ RIL_LOGE("USSD message size is too long, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
free(data_enc);
@@ -122,7 +122,7 @@ void ril_request_send_ussd(RIL_Token t, void *data, size_t length)
}
if (message == NULL) {
- LOGE("USSD message is empty, aborting");
+ RIL_LOGE("USSD message is empty, aborting");
ril_request_complete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
return;
@@ -209,7 +209,7 @@ void ipc_ss_ussd(struct ipc_message_info *info)
codingScheme = sms_get_coding_scheme(ussd->dcs);
switch (codingScheme) {
case SMS_CODING_SCHEME_GSM7:
- LOGD("USSD Rx encoding is GSM7");
+ RIL_LOGD("USSD Rx encoding is GSM7");
data_dec_len = gsm72ascii(info->data
+ sizeof(struct ipc_ss_ussd), &data_dec, info->length - sizeof(struct ipc_ss_ussd));
@@ -218,7 +218,7 @@ void ipc_ss_ussd(struct ipc_message_info *info)
break;
case SMS_CODING_SCHEME_UCS2:
- LOGD("USSD Rx encoding %x is UCS2", ussd->dcs);
+ RIL_LOGD("USSD Rx encoding %x is UCS2", ussd->dcs);
data_dec_len = info->length - sizeof(struct ipc_ss_ussd);
message[1] = malloc(data_dec_len * 4 + 1);
@@ -232,7 +232,7 @@ void ipc_ss_ussd(struct ipc_message_info *info)
message[1][result] = '\0';
break;
default:
- LOGD("USSD Rx encoding %x is unknown, assuming ASCII",
+ RIL_LOGD("USSD Rx encoding %x is unknown, assuming ASCII",
ussd->dcs);
data_dec_len = info->length - sizeof(struct ipc_ss_ussd);
diff --git a/svc.c b/svc.c
index de60bcd..ed90232 100644
--- a/svc.c
+++ b/svc.c
@@ -26,7 +26,7 @@
int ril_oem_hook_svc_session_start(void)
{
if (ril_data.oem_hook_svc_session != NULL) {
- LOGE("OEM hook SVC session was already started");
+ RIL_LOGE("OEM hook SVC session was already started");
return -1;
}
@@ -38,7 +38,7 @@ int ril_oem_hook_svc_session_start(void)
void ril_oem_hook_svc_session_stop(void)
{
if (ril_data.oem_hook_svc_session == NULL) {
- LOGE("OEM hook SVC session was already stopped");
+ RIL_LOGE("OEM hook SVC session was already stopped");
return;
}
@@ -120,7 +120,7 @@ void ipc_svc_callback(struct ipc_message_info *info)
goto error;
if (ril_data.oem_hook_svc_session->token != RIL_TOKEN_NULL) {
- LOGE("%s: Another token is waiting", __func__);
+ RIL_LOGE("%s: Another token is waiting", __func__);
goto error;
}
@@ -176,7 +176,7 @@ void ril_request_oem_hook_raw(RIL_Token token, void *data, int length)
} else {
rc = ril_oem_hook_svc_session_start();
if (rc < 0) {
- LOGE("%s: Unable to start OEM hook SVC session", __func__);
+ RIL_LOGE("%s: Unable to start OEM hook SVC session", __func__);
goto error;
}
diff --git a/util.c b/util.c
index e0943c1..5d73d2c 100644
--- a/util.c
+++ b/util.c
@@ -294,7 +294,7 @@ void hex_dump(void *data, int size)
if (n%16 == 0) {
/* line completed */
- LOGD("[%4.4s] %-50.50s %s", addrstr, hexstr, charstr);
+ RIL_LOGD("[%4.4s] %-50.50s %s", addrstr, hexstr, charstr);
hexstr[0] = 0;
charstr[0] = 0;
} else if (n%8 == 0) {
@@ -307,7 +307,7 @@ void hex_dump(void *data, int size)
if (strlen(hexstr) > 0) {
/* print rest of buffer if not empty */
- LOGD("[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr);
+ RIL_LOGD("[%4.4s] %-50.50s %s\n", addrstr, hexstr, charstr);
}
}