diff options
author | PaulK <contact@paulk.fr> | 2011-10-30 16:59:31 +0100 |
---|---|---|
committer | PaulK <contact@paulk.fr> | 2011-10-30 16:59:31 +0100 |
commit | 0308a183e84b144cdfd2dedda4d2fde73fbb6eb9 (patch) | |
tree | b62de8451017e54faef25e80f4a49434ff46a8ac /samsung-ipc | |
parent | 3e24a8ae9c14cba2aa44d487e89374f7d6275111 (diff) | |
download | external_libsamsung-ipc-0308a183e84b144cdfd2dedda4d2fde73fbb6eb9.zip external_libsamsung-ipc-0308a183e84b144cdfd2dedda4d2fde73fbb6eb9.tar.gz external_libsamsung-ipc-0308a183e84b144cdfd2dedda4d2fde73fbb6eb9.tar.bz2 |
Fixed IPC_PWR_PHONE_STATE (from SEC RIL logs) removed last SIMIO bits + other stuff
Diffstat (limited to 'samsung-ipc')
-rw-r--r-- | samsung-ipc/device/crespo/crespo_ipc.c | 21 | ||||
-rw-r--r-- | samsung-ipc/ipc.c | 1 | ||||
-rw-r--r-- | samsung-ipc/ipc_util.c | 17 |
3 files changed, 36 insertions, 3 deletions
diff --git a/samsung-ipc/device/crespo/crespo_ipc.c b/samsung-ipc/device/crespo/crespo_ipc.c index 44e31ca..719383e 100644 --- a/samsung-ipc/device/crespo/crespo_ipc.c +++ b/samsung-ipc/device/crespo/crespo_ipc.c @@ -301,7 +301,6 @@ int crespo_ipc_client_send(struct ipc_client *client, struct ipc_message_info *r int rc = 0; memset(&modem_data, 0, sizeof(struct modem_io)); - modem_data.data = malloc(MAX_MODEM_DATA_SIZE); modem_data.size = request->length + sizeof(struct ipc_header); reqhdr.mseq = request->mseq; @@ -318,6 +317,18 @@ int crespo_ipc_client_send(struct ipc_client *client, struct ipc_message_info *r assert(client->handlers->write != NULL); + ipc_client_log(client, "INFO: crespo_ipc_client_send: Modem SEND FMT (id=%d cmd=%d size=%d)!", modem_data.id, modem_data.cmd, modem_data.size); + ipc_client_log(client, "INFO: crespo_ipc_client_send: request: type = %d (%s), group = %d, index = %d (%s)", + request->type, ipc_request_type_to_str(request->type), request->group, request->index, ipc_command_type_to_str(IPC_COMMAND(request))); + + if(request->length > 0) + { + ipc_client_log(client, "INFO: ==== DATA DUMP ===="); + hex_dump((void *) request->data, request->length); + } + + ipc_client_log(client, ""); + rc = client->handlers->write((uint8_t*) &modem_data, sizeof(struct modem_io), client->handlers->write_data); return rc; } @@ -386,17 +397,21 @@ int crespo_ipc_client_recv(struct ipc_client *client, struct ipc_message_info *r response->length = modem_data.size - sizeof(struct ipc_header); response->data = NULL; - ipc_client_log(client, "INFO: crespo_ipc_client_recv: response: group = %d, index = %d", - resphdr->group, resphdr->index); + ipc_client_log(client, "INFO: crespo_ipc_client_recv: response: type = %d (%s), group = %d, index = %d (%s)", + resphdr->type, ipc_response_type_to_str(resphdr->type), resphdr->group, resphdr->index, ipc_command_type_to_str(IPC_COMMAND(resphdr))); if(response->length > 0) { + ipc_client_log(client, "INFO: ==== DATA DUMP ===="); + hex_dump((void *) (modem_data.data + sizeof(struct ipc_header)), response->length); response->data = malloc(response->length); memcpy(response->data, (uint8_t *) modem_data.data + sizeof(struct ipc_header), response->length); } free(modem_data.data); + ipc_client_log(client, ""); + wake_unlock("secril_fmt-interface"); return 0; diff --git a/samsung-ipc/ipc.c b/samsung-ipc/ipc.c index 8b6ec96..ecb2ad2 100644 --- a/samsung-ipc/ipc.c +++ b/samsung-ipc/ipc.c @@ -71,6 +71,7 @@ struct ipc_client* ipc_client_new(int client_type) client->handlers = (struct ipc_handlers *) malloc(sizeof(struct ipc_handlers)); client->log_handler = log_handler_default; + /* FIXME: WE DONT WANT THIS FOR FSO!!! */ /* Set default handlers */ ipc_client_set_handlers(client, &ipc_default_handlers); diff --git a/samsung-ipc/ipc_util.c b/samsung-ipc/ipc_util.c index b5b2231..8fdd074 100644 --- a/samsung-ipc/ipc_util.c +++ b/samsung-ipc/ipc_util.c @@ -36,6 +36,23 @@ const char *ipc_response_type_to_str(int type) { } } +const char *ipc_request_type_to_str(int type) { + switch(type) { + case IPC_TYPE_EXEC: + return "EXEC"; + case IPC_TYPE_GET: + return "GET"; + case IPC_TYPE_SET: + return "SET"; + case IPC_TYPE_CFRM: + return "CFRM"; + case IPC_TYPE_EVENT: + return "EVENT"; + default: + return "UNKNOWN"; + } +} + const char *ipc_command_type_to_str(int command) { switch(command) { IPC_STR(IPC_PWR_PHONE_PWR_UP) |