aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/pwr.h4
-rw-r--r--include/radio.h1
-rw-r--r--include/sec.h44
-rw-r--r--samsung-ipc/device/crespo/crespo_ipc.c21
-rw-r--r--samsung-ipc/ipc.c1
-rw-r--r--samsung-ipc/ipc_util.c17
6 files changed, 41 insertions, 47 deletions
diff --git a/include/pwr.h b/include/pwr.h
index ab1a23e..92be615 100644
--- a/include/pwr.h
+++ b/include/pwr.h
@@ -30,8 +30,8 @@
#define IPC_PWR_BATT_COMP 0x0106
#define IPC_PWR_PHONE_STATE 0x0107
-#define IPC_PWR_PHONE_STATE_LPM 0x0
-#define IPC_PWR_PHONE_STATE_NORMAL 0x2
+#define IPC_PWR_PHONE_STATE_LPM 0x0001
+#define IPC_PWR_PHONE_STATE_NORMAL 0x0202
#endif
diff --git a/include/radio.h b/include/radio.h
index 17c01e2..ef58937 100644
--- a/include/radio.h
+++ b/include/radio.h
@@ -85,6 +85,7 @@ void ipc_client_send_exec(struct ipc_client *client, const unsigned short comman
/* Utility functions */
const char *ipc_command_type_to_str(int command);
const char *ipc_response_type_to_str(int type);
+const char *ipc_request_type_to_str(int type);
#endif
diff --git a/include/sec.h b/include/sec.h
index 9b5f82b..ddd9502 100644
--- a/include/sec.h
+++ b/include/sec.h
@@ -65,12 +65,6 @@ struct ipc_message_info;
#define IPC_SEC_RSIM_COMMAND_UPDATE_BINARY 0xd6
#define IPC_SEC_RSIM_COMMAND_STATUS 0xf2
-#define IPC_SEC_RSIM_ACCESS_UNKNOWN 0x00
-#define IPC_SEC_RSIM_ACCESS_COMP_NORMAL 0x01
-#define IPC_SEC_RSIM_ACCESS_COMP_WARNING 0x02
-#define IPC_SEC_RSIM_ACCESS_ABORT_EXEC 0x03
-#define IPC_SEC_RSIM_ACCESS_ABORT_CHECK 0x04
-
struct ipc_sec_pin_status_noti {
unsigned char type;
unsigned char key;
@@ -116,45 +110,11 @@ struct ipc_sec_lock_info_response {
unsigned char attempts;
} __attribute__((__packed__));
-/*
- * struct ipc_sec_sim_filesystem_entry
- * Source: cornucopia fsogsmd/src/lib/consts.vala
- * Git HEAD: f2e0268075ffb15ef237371cd2e1896561567665
- *
- * Copyright (C) 2009-2011 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
- *
- * This program 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 2
- * of the License, or (at your option) any later version.
- *
- * This program 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-struct ipc_sec_sim_filesystem_entry
-{
- uint16_t id;
- uint16_t parent;
- char *name;
-};
-
-int ipc_sec_rsim_access_response_get_status(struct ipc_message_info *response);
-char* ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response);
-void ipc_sec_rsim_access_request_setup(struct ipc_sec_rsim_access_request *request,
- unsigned char command, char *entry_name,
- unsigned char p1, unsigned char p2, unsigned char p3);
-
void ipc_sec_pin_status_set_setup(struct ipc_sec_pin_status_set *message,
unsigned char pin_type, char *pin1, char *pin2);
+char* ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response);
+
#endif
// vim:ts=4:sw=4:expandtab
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)