From 0b3a6b4838e4ba55c79387bf7314e6dffb33bf42 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Thu, 6 Feb 2014 20:26:30 +0100 Subject: Follow consistent coding style in headers Signed-off-by: Paul Kocialkowski --- include/call.h | 81 +++++++++++++++--------------- include/disp.h | 4 +- include/gen.h | 4 +- include/gprs.h | 92 ++++++++++++++++------------------ include/misc.h | 14 +++--- include/net.h | 99 +++++++++++++++++-------------------- include/protocol.h | 4 +- include/pwr.h | 6 --- include/rfs.h | 15 +++++- include/sec.h | 141 +++++++++++++++++++++++------------------------------ include/sms.h | 78 ++++++++++++++--------------- include/snd.h | 2 +- include/ss.h | 9 ++-- include/svc.h | 8 +-- samsung-ipc/call.c | 22 ++++----- samsung-ipc/gen.c | 2 +- samsung-ipc/gprs.c | 20 ++++---- samsung-ipc/net.c | 13 +++-- samsung-ipc/rfs.c | 22 ++++----- samsung-ipc/sec.c | 40 +++++++-------- samsung-ipc/sms.c | 8 +-- tools/modemctrl.c | 38 +++++++-------- 22 files changed, 344 insertions(+), 378 deletions(-) diff --git a/include/call.h b/include/call.h index 5c0759f..a98f847 100644 --- a/include/call.h +++ b/include/call.h @@ -2,7 +2,7 @@ * This file is part of libsamsung-ipc. * * Copyright (C) 2010-2011 Joerie de Gram - * Copyright (C) 2011-2013 Paul Kocialkowski + * Copyright (C) 2011-2014 Paul Kocialkowski * * libsamsung-ipc is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,19 +52,11 @@ #define IPC_CALL_PREFIX_NONE 0x00 #define IPC_CALL_PREFIX_INTL 0x11 -/* Only for ipc_call_status, NOT call_list */ -#define IPC_CALL_STATE_DIALING 0x01 -#define IPC_CALL_STATE_IGNORING_INCOMING_STATUS 0x02 -#define IPC_CALL_STATE_CONNECTED 0x03 -#define IPC_CALL_STATE_RELEASED 0x04 -#define IPC_CALL_STATE_CONNECTING 0x05 - -#define IPC_CALL_LIST_ENTRY_STATE_ACTIVE 0x01 -#define IPC_CALL_LIST_ENTRY_STATE_HOLDING 0x02 -#define IPC_CALL_LIST_ENTRY_STATE_DIALING 0x03 -#define IPC_CALL_LIST_ENTRY_STATE_ALERTING 0x04 -#define IPC_CALL_LIST_ENTRY_STATE_INCOMING 0x05 -#define IPC_CALL_LIST_ENTRY_STATE_WAITING 0x06 +#define IPC_CALL_STATUS_DIALING 0x01 +#define IPC_CALL_STATUS_IGNORING_INCOMING_STATUS 0x02 +#define IPC_CALL_STATUS_CONNECTED 0x03 +#define IPC_CALL_STATUS_RELEASED 0x04 +#define IPC_CALL_STATUS_CONNECTING 0x05 #define IPC_CALL_END_CAUSE_NORMAL 0x05 #define IPC_CALL_END_CAUSE_REJECTED 0x2F @@ -73,6 +65,13 @@ #define IPC_CALL_TERM_MO 0x01 #define IPC_CALL_TERM_MT 0x02 +#define IPC_CALL_LIST_ENTRY_STATUS_ACTIVE 0x01 +#define IPC_CALL_LIST_ENTRY_STATUS_HOLDING 0x02 +#define IPC_CALL_LIST_ENTRY_STATUS_DIALING 0x03 +#define IPC_CALL_LIST_ENTRY_STATUS_ALERTING 0x04 +#define IPC_CALL_LIST_ENTRY_STATUS_INCOMING 0x05 +#define IPC_CALL_LIST_ENTRY_STATUS_WAITING 0x06 + #define IPC_CALL_DTMF_STATE_START 0x01 #define IPC_CALL_DTMF_STATE_STOP 0x02 @@ -80,43 +79,43 @@ * Structures */ -struct ipc_call_incoming { - unsigned char unk; - unsigned char type; // IPC_CALL_TYPE_... - unsigned char id; - unsigned char line; +struct ipc_call_outgoing_data { + unsigned char unknown; + unsigned char type; // IPC_CALL_TYPE + unsigned char identity; // IPC_CALL_IDENTITY + unsigned char number_length; + unsigned char prefix; // IPC_CALL_PREFIX + unsigned char number[86]; } __attribute__((__packed__)); -struct ipc_call_outgoing { - unsigned char unk; +struct ipc_call_incoming_data { + unsigned char unknown; unsigned char type; // IPC_CALL_TYPE_... - unsigned char identity; // IPC_CALL_IDENTITY_... - unsigned char length; - unsigned char prefix; // IPC_CALL_PREFIX_... - unsigned char number[86]; + unsigned char id; + unsigned char line; } __attribute__((__packed__)); -struct ipc_call_status { - unsigned char unk; - unsigned char type; +struct ipc_call_status_data { + unsigned char unknown; + unsigned char type; // IPC_CALL_TYPE unsigned char id; - unsigned char state; + unsigned char status; // IPC_CALL_STATUS unsigned char reason; - unsigned char end_cause; + unsigned char end_cause; // IPC_CALL_END_CAUSE } __attribute__((__packed__)); struct ipc_call_list_entry { - unsigned char unk0; - unsigned char type; // IPC_CALL_TYPE_... - unsigned char idx; - unsigned char term; // IPC_CALL_TERM_... - unsigned char state; // IPC_CALL_LIST_ENTRY_STATE_... - unsigned char mpty; - unsigned char number_len; - unsigned char unk4; + unsigned char unknown1; + unsigned char type; // IPC_CALL_TYPE + unsigned char id; + unsigned char term; // IPC_CALL_TERM + unsigned char status; // IPC_CALL_LIST_ENTRY_STATUS + unsigned char unknown2; + unsigned char number_length; + unsigned char unknown3; } __attribute__((__packed__)); -struct ipc_call_cont_dtmf { +struct ipc_call_cont_dtmf_data { unsigned char state; unsigned char tone; } __attribute__((__packed__)); @@ -125,14 +124,14 @@ struct ipc_call_cont_dtmf { * Helpers */ -void ipc_call_outgoing_setup(struct ipc_call_outgoing *message, unsigned char type, +void ipc_call_outgoing_setup(struct ipc_call_outgoing_data *message, unsigned char type, unsigned char identity, unsigned char prefix, char *number); unsigned int ipc_call_list_response_get_num_entries(struct ipc_message_info *response); struct ipc_call_list_entry* ipc_call_list_response_get_entry(struct ipc_message_info *response, unsigned int num); char *ipc_call_list_response_get_entry_number(struct ipc_message_info *response, unsigned int num); -unsigned char *ipc_call_cont_dtmf_burst_pack(struct ipc_call_cont_dtmf *message, +unsigned char *ipc_call_cont_dtmf_burst_pack(struct ipc_call_cont_dtmf_data *message, unsigned char *burst, int burst_len); #endif diff --git a/include/disp.h b/include/disp.h index f16265d..1727b8f 100644 --- a/include/disp.h +++ b/include/disp.h @@ -35,14 +35,14 @@ * Structures */ -struct ipc_disp_icon_info { +struct ipc_disp_icon_info_data { unsigned char rssi; unsigned char bars; unsigned char act; unsigned char reg; } __attribute__((__packed__)); -struct ipc_disp_rssi_info { +struct ipc_disp_rssi_info_data { unsigned char rssi; } __attribute__((__packed__)); diff --git a/include/gen.h b/include/gen.h index 2856920..49e6f4a 100644 --- a/include/gen.h +++ b/include/gen.h @@ -33,7 +33,7 @@ * Structures */ -struct ipc_gen_phone_res { +struct ipc_gen_phone_res_data { unsigned char group; unsigned char index; unsigned char type; @@ -44,7 +44,7 @@ struct ipc_gen_phone_res { * Helpers */ -int ipc_gen_phone_res_check(struct ipc_gen_phone_res *res); +int ipc_gen_phone_res_check(struct ipc_gen_phone_res_data *res); #endif diff --git a/include/gprs.h b/include/gprs.h index e08d4d7..3323a4e 100644 --- a/include/gprs.h +++ b/include/gprs.h @@ -2,7 +2,7 @@ * This file is part of libsamsung-ipc. * * Copyright (C) 2011 Simon Busch - * Copyright (C) 2011-2013 Paul Kocialkowski + * Copyright (C) 2011-2014 Paul Kocialkowski * * libsamsung-ipc is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,98 +49,92 @@ * Values */ -#define IPC_GPRS_STATE_NOT_ENABLED 0x00 -#define IPC_GPRS_STATE_ENABLED 0x01 -#define IPC_GPRS_STATE_DISABLED 0x03 - -#define IPC_GPRS_FAIL_INSUFFICIENT_RESOURCES 0x0004 -#define IPC_GPRS_FAIL_MISSING_UKNOWN_APN 0x0005 -#define IPC_GPRS_FAIL_UNKNOWN_PDP_ADDRESS_TYPE 0x0006 -#define IPC_GPRS_FAIL_USER_AUTHENTICATION 0x0007 -#define IPC_GPRS_FAIL_ACTIVATION_REJECT_GGSN 0x0008 -#define IPC_GPRS_FAIL_ACTIVATION_REJECT_UNSPECIFIED 0x0009 -#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUPPORTED 0x000A -#define IPC_GPRS_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED 0x000B -#define IPC_GPRS_FAIL_SERVICE_OPTION_OUT_OF_ORDER 0x000C -#define IPC_GPRS_FAIL_NSAPI_IN_USE 0x000D - -#define IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT 0x03 +#define IPC_GPRS_STATUS_NOT_ENABLED 0x00 +#define IPC_GPRS_STATUS_ENABLED 0x01 +#define IPC_GPRS_STATUS_DISABLED 0x03 + +#define IPC_GPRS_FAIL_CAUSE_INSUFFICIENT_RESOURCES 0x0004 +#define IPC_GPRS_FAIL_CAUSE_MISSING_UKNOWN_APN 0x0005 +#define IPC_GPRS_FAIL_CAUSE_UNKNOWN_PDP_ADDRESS_TYPE 0x0006 +#define IPC_GPRS_FAIL_CAUSE_USER_AUTHENTICATION 0x0007 +#define IPC_GPRS_FAIL_CAUSE_ACTIVATION_REJECT_GGSN 0x0008 +#define IPC_GPRS_FAIL_CAUSE_ACTIVATION_REJECT_UNSPECIFIED 0x0009 +#define IPC_GPRS_FAIL_CAUSE_SERVICE_OPTION_NOT_SUPPORTED 0x000A +#define IPC_GPRS_FAIL_CAUSE_SERVICE_OPTION_NOT_SUBSCRIBED 0x000B +#define IPC_GPRS_FAIL_CAUSE_SERVICE_OPTION_OUT_OF_ORDER 0x000C +#define IPC_GPRS_FAIL_CAUSE_NSAPI_IN_USE 0x000D /* * Structures */ -struct ipc_gprs_define_pdp_context { +struct ipc_gprs_define_pdp_context_data { unsigned char enable; unsigned char cid; - unsigned char unk; + unsigned char magic; unsigned char apn[124]; } __attribute__((__packed__)); -struct ipc_gprs_pdp_context_set { +struct ipc_gprs_pdp_context_request_set_data { unsigned char enable; unsigned char cid; - unsigned char unk0[4]; + unsigned char magic[4]; unsigned char username[32]; unsigned char password[32]; - unsigned char unk1[32]; - unsigned char unk2; + unsigned char unknown1[32]; + unsigned char unknown2; } __attribute__((__packed__)); -struct ipc_gprs_pdp_context_get_desc { +struct ipc_gprs_pdp_context_request_get_entry { unsigned char cid; - unsigned char state; + unsigned char status; // IPC_GPRS_STATUS } __attribute__((__packed__)); -struct ipc_gprs_pdp_context_get { - unsigned char unk; - struct ipc_gprs_pdp_context_get_desc desc[IPC_GPRS_PDP_CONTEXT_GET_DESC_COUNT]; +struct ipc_gprs_pdp_context_request_get_data { + unsigned char unknown; + struct ipc_gprs_pdp_context_request_get_entry entries[3]; } __attribute__((__packed__)); -struct ipc_gprs_ip_configuration { +struct ipc_gprs_ip_configuration_data { unsigned char cid; unsigned char field_flag; - unsigned char unk1; + unsigned char unknown1; unsigned char ip[4]; unsigned char dns1[4]; unsigned char dns2[4]; unsigned char gateway[4]; unsigned char subnet_mask[4]; - unsigned char unk2[4]; -} __attribute__((__packed__)); - -struct ipc_gprs_call_status { - unsigned char cid; - unsigned char state; - unsigned short fail_cause; + unsigned char unknown2[4]; } __attribute__((__packed__)); -struct ipc_gprs_hsdpa_status { - unsigned char reg_state; +struct ipc_gprs_hsdpa_status_data { + unsigned char status; } __attribute__((__packed__)); -struct ipc_gprs_ps { - unsigned char unk[2]; -} __attribute__((__packed__)); - -struct ipc_gprs_current_session_data_counter { +struct ipc_gprs_current_session_data_counter_data { unsigned char cid; unsigned int rx_count; unsigned int tx_count; } __attribute__((__packed__)); -struct ipc_gprs_port_list { - unsigned char unk[804]; +struct ipc_gprs_call_status_data { + unsigned char cid; + unsigned char status; + unsigned short fail_cause; // IPC_GPRS_FAIL_CAUSE +} __attribute__((__packed__)); + +struct ipc_gprs_port_list_data { + unsigned char magic[804]; } __attribute__((__packed__)); /* * Helpers */ -void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message); -void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message, +void ipc_gprs_port_list_setup(struct ipc_gprs_port_list_data *message); +void ipc_gprs_pdp_context_request_set_setup(struct ipc_gprs_pdp_context_request_set_data *message, unsigned char cid, int enable, char *username, char *password); -void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message, +void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context_data *message, unsigned char cid, int enable, char *apn); #endif diff --git a/include/misc.h b/include/misc.h index f3fee2f..78e993b 100644 --- a/include/misc.h +++ b/include/misc.h @@ -47,21 +47,21 @@ * Structures */ -struct ipc_misc_me_version { - unsigned char unk; - char sw_version[32]; - char hw_version[32]; +struct ipc_misc_me_version_data { + unsigned char unknown; + char software_version[32]; + char hardware_version[32]; char cal_date[32]; char misc[32]; } __attribute__((__packed__)); -struct ipc_misc_me_sn { - unsigned char type; // IPC_MISC_ME_SN_SERIAL_NUM* +struct ipc_misc_me_sn_data { + unsigned char type; // IPC_MISC_ME_SN_SERIAL_NUM unsigned char length; char data[32]; } __attribute__((__packed__)); -struct ipc_misc_time_info { +struct ipc_misc_time_info_data { unsigned char tz_valid, daylight_valid; unsigned char year, mon, day; unsigned char hour, min, sec; diff --git a/include/net.h b/include/net.h index 274c891..2a49493 100644 --- a/include/net.h +++ b/include/net.h @@ -3,7 +3,7 @@ * * Copyright (C) 2010-2011 Joerie de Gram * Copyright (C) 2011 Simon Busch - * Copyright (C) 2011-2013 Paul Kocialkowski + * Copyright (C) 2011-2014 Paul Kocialkowski * * libsamsung-ipc is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,99 +46,92 @@ * Values */ -#define IPC_NET_PLMN_STATUS_AVAILABLE 0x02 -#define IPC_NET_PLMN_STATUS_CURRENT 0x03 -#define IPC_NET_PLMN_STATUS_FORBIDDEN 0x04 - #define IPC_NET_PLMN_SEL_MANUAL 0x03 #define IPC_NET_PLMN_SEL_AUTO 0x02 -#define IPC_NET_REGISTRATION_STATE_NONE 0x01 -#define IPC_NET_REGISTRATION_STATE_HOME 0x02 -#define IPC_NET_REGISTRATION_STATE_SEARCHING 0x03 -#define IPC_NET_REGISTRATION_STATE_EMERGENCY 0x04 -#define IPC_NET_REGISTRATION_STATE_UNKNOWN 0x05 -#define IPC_NET_REGISTRATION_STATE_ROAMING 0x06 +#define IPC_NET_MODE_SEL_GSM_UMTS 0x01 +#define IPC_NET_MODE_SEL_GSM_ONLY 0x02 +#define IPC_NET_MODE_SEL_UMTS_ONLY 0x03 -#define IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN 0xff +#define IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN 0xFF #define IPC_NET_ACCESS_TECHNOLOGY_GSM 0x00 #define IPC_NET_ACCESS_TECHNOLOGY_GSM2 0x01 #define IPC_NET_ACCESS_TECHNOLOGY_GPRS 0x02 #define IPC_NET_ACCESS_TECHNOLOGY_EDGE 0x03 #define IPC_NET_ACCESS_TECHNOLOGY_UMTS 0x04 +#define IPC_NET_PLMN_STATUS_AVAILABLE 0x02 +#define IPC_NET_PLMN_STATUS_CURRENT 0x03 +#define IPC_NET_PLMN_STATUS_FORBIDDEN 0x04 + #define IPC_NET_SERVICE_DOMAIN_GSM 0x02 #define IPC_NET_SERVICE_DOMAIN_GPRS 0x03 -#define IPC_NET_MODE_SEL_GSM_UMTS 0x01 -#define IPC_NET_MODE_SEL_GSM_ONLY 0x02 -#define IPC_NET_MODE_SEL_UMTS_ONLY 0x03 +#define IPC_NET_REGISTRATION_STATUS_NONE 0x01 +#define IPC_NET_REGISTRATION_STATUS_HOME 0x02 +#define IPC_NET_REGISTRATION_STATUS_SEARCHING 0x03 +#define IPC_NET_REGISTRATION_STATUS_EMERGENCY 0x04 +#define IPC_NET_REGISTRATION_STATUS_UNKNOWN 0x05 +#define IPC_NET_REGISTRATION_STATUS_ROAMING 0x06 /* * Structures */ -struct ipc_net_regist_get { - /* ignore, ipc_net_regist_get_setup will do for you */ - unsigned char net; - /* IPC_NET_SERVICE_DOMAIN_.. */ - unsigned char domain; +struct ipc_net_plmn_sel_response_data { + unsigned char plmn_sel; // IPC_NET_PLMN_SEL } __attribute__((__packed__)); -struct ipc_net_regist_response { - /* IPC_NET_ACCESS_TECHNOLOGY_... */ - unsigned char act; - /* IPC_NET_SERVICE_DOMAIN_... */ - unsigned char domain; - /* IPC_NET_REGISTRATION_STATE_... */ - unsigned char reg_state; - unsigned char edge; - unsigned short lac; - unsigned int cid; - char rej_cause; +struct ipc_net_plmn_sel_request_data { + unsigned char mode_sel; // IPC_NET_MODE_SEL + char plmn[6]; + unsigned char act; // IPC_NET_ACCESS_TECHNOLOGY } __attribute__((__packed__)); -struct ipc_net_current_plmn_response { - char unk0; - unsigned char slevel; - char unk1; +struct ipc_net_current_plmn_data { + unsigned char unknown[3]; char plmn[5]; - unsigned char type; // IPC_NET_SERVICE_TYPE_... ? + unsigned char type; unsigned short lac; } __attribute__((__packed__)); -struct ipc_net_plmn_entry { - unsigned char status; // IPC_NET_PLMN_STATUS_... - char plmn[6]; - unsigned char type; - char unk[2]; +struct ipc_net_plmn_list_header { + unsigned char count; } __attribute__((__packed__)); -struct ipc_net_plmn_entries { - unsigned char num; +struct ipc_net_plmn_list_entry { + unsigned char status; // IPC_NET_PLMN_STATUS + char plmn[6]; + unsigned char type; + unsigned char unknown[2]; } __attribute__((__packed__)); -struct ipc_net_mode_sel { - unsigned char mode_sel; +struct ipc_net_regist_request_data { + unsigned char act; // IPC_NET_ACCESS_TECHNOLOGY + unsigned char domain; // IPC_NET_SERVICE_DOMAIN } __attribute__((__packed__)); -struct ipc_net_plmn_sel_get { - unsigned char plmn_sel; +struct ipc_net_regist_response_data { + unsigned char act; // IPC_NET_ACCESS_TECHNOLOGY + unsigned char domain; // IPC_NET_SERVICE_DOMAIN + unsigned char status; // IPC_NET_REGISTRATION_STATUS + unsigned char edge; + unsigned short lac; + unsigned int cid; + unsigned char fail_cause; } __attribute__((__packed__)); -struct ipc_net_plmn_sel_set { - unsigned char mode; - char plmn[6]; // 5 plmn bytes + 1 '#' byte - unsigned char act; // IPC_NET_ACCESS_TECHNOLOGY_... +struct ipc_net_mode_sel_data { + unsigned char mode_sel; // IPC_NET_MODE_SEL } __attribute__((__packed__)); /* * Helpers */ -void ipc_net_regist_get_setup(struct ipc_net_regist_get *message, +void ipc_net_regist_setup(struct ipc_net_regist_request_data *message, unsigned char domain); -void ipc_net_plmn_sel_set_setup(struct ipc_net_plmn_sel_set *message, +void ipc_net_plmn_sel_set_setup(struct ipc_net_plmn_sel_request_data *message, unsigned char mode, char *plmn, unsigned char act); #endif diff --git a/include/protocol.h b/include/protocol.h index a841ee3..1de64df 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -26,14 +26,14 @@ * Commands */ -/* AP -> Baseband */ +/* Requests */ #define IPC_TYPE_EXEC 0x01 #define IPC_TYPE_GET 0x02 #define IPC_TYPE_SET 0x03 #define IPC_TYPE_CFRM 0x04 #define IPC_TYPE_EVENT 0x05 -/* Baseband -> AP */ +/* Responses */ #define IPC_TYPE_INDI 0x01 #define IPC_TYPE_RESP 0x02 #define IPC_TYPE_NOTI 0x03 diff --git a/include/pwr.h b/include/pwr.h index 2b6e8ac..2b7f278 100644 --- a/include/pwr.h +++ b/include/pwr.h @@ -43,12 +43,6 @@ #define IPC_PWR_PHONE_STATE_LPM 0x0001 #define IPC_PWR_PHONE_STATE_NORMAL 0x0202 -/* - * Macros - */ - -#define IPC_PWR_R(f) (f & 0xff) - #endif // vim:ts=4:sw=4:expandtab diff --git a/include/rfs.h b/include/rfs.h index 625c075..3b8971b 100644 --- a/include/rfs.h +++ b/include/rfs.h @@ -49,12 +49,23 @@ * Structures */ -struct ipc_rfs_io { +struct ipc_rfs_nv_read_item_data { unsigned int offset; unsigned int length; } __attribute__((__packed__)); -struct ipc_rfs_io_confirm { +struct ipc_rfs_nv_read_item_confirm_header { + unsigned char confirm; + unsigned int offset; + unsigned int length; +} __attribute__((__packed__)); + +struct ipc_rfs_nv_write_item_header { + unsigned int offset; + unsigned int length; +} __attribute__((__packed__)); + +struct ipc_rfs_nv_write_item_confirm_data { unsigned char confirm; unsigned int offset; unsigned int length; diff --git a/include/sec.h b/include/sec.h index 74e1ff8..692e7ad 100644 --- a/include/sec.h +++ b/include/sec.h @@ -41,7 +41,6 @@ * Values */ -/* SIM status */ #define IPC_SEC_SIM_STATUS_READY 0x00 #define IPC_SEC_SIM_STATUS_SIM_LOCK_REQUIRED 0x01 #define IPC_SEC_SIM_STATUS_INSIDE_PF_ERROR 0x02 @@ -56,141 +55,125 @@ #define IPC_SEC_SIM_STATUS_INIT_COMPLETE 0x82 #define IPC_SEC_SIM_STATUS_PB_INIT_COMPLETE 0x83 -/* SIM/Network facility types */ -#define IPC_SEC_FACILITY_TYPE_SC 0x03 -#define IPC_SEC_FACILITY_TYPE_FD 0x04 -#define IPC_SEC_FACILITY_TYPE_PN 0x05 -#define IPC_SEC_FACILITY_TYPE_PU 0x06 -#define IPC_SEC_FACILITY_TYPE_PP 0x07 -#define IPC_SEC_FACILITY_TYPE_PC 0x08 - -/* SIM card (SC) facility lock types */ #define IPC_SEC_FACILITY_LOCK_TYPE_SC_UNLOCKED 0x00 #define IPC_SEC_FACILITY_LOCK_TYPE_SC_PIN1_REQ 0x01 #define IPC_SEC_FACILITY_LOCK_TYPE_SC_PUK_REQ 0x02 #define IPC_SEC_FACILITY_LOCK_TYPE_SC_CARD_BLOCKED 0x05 -/* PIN type */ #define IPC_SEC_PIN_TYPE_PIN1 0x03 #define IPC_SEC_PIN_TYPE_PIN2 0x09 -/* Type of the used SIM card */ -#define IPC_SEC_SIM_CARD_TYPE_UNKNOWN 0x00 -#define IPC_SEC_SIM_CARD_TYPE_SIM 0x01 -#define IPC_SEC_SIM_CARD_TYPE_USIM 0x02 +#define IPC_SEC_FACILITY_TYPE_SC 0x03 +#define IPC_SEC_FACILITY_TYPE_FD 0x04 +#define IPC_SEC_FACILITY_TYPE_PN 0x05 +#define IPC_SEC_FACILITY_TYPE_PU 0x06 +#define IPC_SEC_FACILITY_TYPE_PP 0x07 +#define IPC_SEC_FACILITY_TYPE_PC 0x08 -/* Possible RSIM commads (see TS 27.00.1 8.18) */ -#define IPC_SEC_RSIM_COMMAND_READ_BINARY 0xb0 -#define IPC_SEC_RSIM_COMMAND_READ_RECORD 0xb2 -#define IPC_SEC_RSIM_COMMAND_GET_RESPONSE 0xc0 -#define IPC_SEC_RSIM_COMMAND_UPDATE_BINARY 0xd6 -#define IPC_SEC_RSIM_COMMAND_UPDATE_RECORD 0xdc -#define IPC_SEC_RSIM_COMMAND_STATUS 0xf2 -#define IPC_SEC_RSIM_COMMAND_RETRIEVE_DATA 0xcb -#define IPC_SEC_RSIM_COMMAND_SET_DATA 0xdb +#define IPC_SEC_RSIM_COMMAND_READ_BINARY 0xB0 +#define IPC_SEC_RSIM_COMMAND_READ_RECORD 0xB2 +#define IPC_SEC_RSIM_COMMAND_GET_RESPONSE 0xC0 +#define IPC_SEC_RSIM_COMMAND_UPDATE_BINARY 0xD6 +#define IPC_SEC_RSIM_COMMAND_UPDATE_RECORD 0xDC +#define IPC_SEC_RSIM_COMMAND_STATUS 0xF2 +#define IPC_SEC_RSIM_COMMAND_RETRIEVE_DATA 0xCB +#define IPC_SEC_RSIM_COMMAND_SET_DATA 0xDB #define IPC_SEC_RSIM_FILE_STRUCTURE_TRANSPARENT 0x83 #define IPC_SEC_RSIM_FILE_STRUCTURE_LINEAR_FIXED 0x00 +#define IPC_SEC_SIM_CARD_TYPE_UNKNOWN 0x00 +#define IPC_SEC_SIM_CARD_TYPE_SIM 0x01 +#define IPC_SEC_SIM_CARD_TYPE_USIM 0x02 + /* * Structures */ -struct ipc_sec_sim_status_response { - /* IPC_SEC_SIM_STATUS_... */ - unsigned char status; - /* IPC_SEC_FACILITY_LOCK_TYPE_... */ - unsigned char facility_lock; +struct ipc_sec_sim_status_response_data { + unsigned char status; // IPC_SEC_SIM_STATUS + unsigned char facility_lock; // IPC_SEC_FACILITY_LOCK_TYPE } __attribute__((__packed__)); -struct ipc_sec_pin_status_set { - /* IPC_SEC_SIM_STATUS_... */ - unsigned char type; - unsigned char length1; - unsigned char length2; +struct ipc_sec_sim_status_request_data { + unsigned char type; // IPC_SEC_PIN_TYPE + unsigned char pin1_length; + unsigned char pin2_length; unsigned char pin1[8]; unsigned char pin2[8]; } __attribute__((__packed__)); -struct ipc_sec_phone_lock_set { - /* IPC_SEC_SIM_STATUS_... */ - unsigned char type; - unsigned char lock; /* 1: lock, 0: unlock */ - unsigned char length; +struct ipc_sec_phone_lock_request_set_data { + unsigned char facility_type; // IPC_SEC_FACILITY_TYPE + unsigned char active; + unsigned char password_length; unsigned char password[39]; } __attribute__((__packed__)); -struct ipc_sec_phone_lock_get { - /* IPC_SEC_FACILITY_TYPE_... */ - unsigned char facility; +struct ipc_sec_phone_lock_request_get_data { + unsigned char facility_type; // IPC_SEC_FACILITY_TYPE } __attribute__((__packed__)); -struct ipc_sec_phone_lock_response { - /* IPC_SEC_FACILITY_TYPE_... */ - unsigned char facility; - unsigned char status; /* 1: active, 0: not active */ +struct ipc_sec_phone_lock_response_data { + unsigned char facility_type; // IPC_SEC_FACILITY_TYPE + unsigned char active; } __attribute__((__packed__)); -struct ipc_sec_change_locking_pw_set { - /* IPC_SEC_FACILITY_TYPE_... */ - unsigned char facility; - unsigned char length_old; - unsigned char length_new; +struct ipc_sec_change_locking_pw_data { + unsigned char facility_type; // IPC_SEC_FACILITY_TYPE + unsigned char password_old_length; + unsigned char password_new_length; unsigned char password_old[39]; unsigned char password_new[39]; } __attribute__((__packed__)); -struct ipc_sec_rsim_access_get { - /* IPC_SEC_RSIM_COMMAND_... */ - unsigned char command; - unsigned short fileid; +struct ipc_sec_rsim_access_request_data { + unsigned char command; // IPC_SEC_RSIM_COMMAND + unsigned short file_id; unsigned char p1, p2, p3; } __attribute__((__packed__)); -struct ipc_sec_rsim_access_response { +struct ipc_sec_rsim_access_response_header { unsigned char sw1, sw2; - unsigned char len; + unsigned char length; } __attribute__((__packed__)); -// This is the data structure for SIM ICC type != 1 -struct ipc_sec_rsim_access_response_data { - unsigned char unk1[3]; +struct ipc_sec_rsim_access_usim_response_header { + unsigned char unknown1[3]; unsigned char offset; - unsigned char unk2[2]; - unsigned char file_structure; - unsigned char record_length; + unsigned char unknown2[2]; + unsigned char file_structure; // IPC_SEC_RSIM_FILE_STRUCTURE + unsigned char length; } __attribute__((__packed__)); -struct ipc_sec_lock_info_get { - unsigned char unk0; /* needs to be "1" */ - /* IPC_SEC_PIN_TYPE_... */ - unsigned char pin_type; +struct ipc_sec_sim_icc_type { + unsigned char type; // IPC_SEC_SIM_CARD_TYPE } __attribute__((__packed__)); -struct ipc_sec_lock_info_response { - unsigned char num; - /* IPC_SEC_PIN_TYPE_... */ - unsigned char type; - unsigned char key; - unsigned char attempts; +struct ipc_sec_lock_info_request_data { + unsigned char magic; + unsigned char type; // IPC_SEC_PIN_TYPE } __attribute__((__packed__)); -struct ipc_sec_sim_icc_type { - unsigned char type; +struct ipc_sec_lock_info_response_data { + unsigned char unknown; + unsigned char type; // IPC_SEC_PIN_TYPE + unsigned char key; + unsigned char retry_count; } __attribute__((__packed__)); /* * Helpers */ -void ipc_sec_pin_status_set_setup(struct ipc_sec_pin_status_set *message, +void ipc_sec_sim_status_setup(struct ipc_sec_sim_status_request_data *message, unsigned char pin_type, char *pin1, char *pin2); -void ipc_sec_lock_info_get_setup(struct ipc_sec_lock_info_get *message, +void ipc_sec_lock_info_setup(struct ipc_sec_lock_info_request_data *message, unsigned char pin_type); -void ipc_sec_phone_lock_set_setup(struct ipc_sec_phone_lock_set *message, +void ipc_sec_phone_lock_request_set_setup(struct ipc_sec_phone_lock_request_set_data *message, int pin_type, int enable, char *passwd); char *ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response); -void ipc_sec_change_locking_pw_set_setup(struct ipc_sec_change_locking_pw_set *message, +void ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *message, int type, char *passwd_old, char *passwd_new); #endif diff --git a/include/sms.h b/include/sms.h index 9295372..f92683d 100644 --- a/include/sms.h +++ b/include/sms.h @@ -49,18 +49,18 @@ * Values */ +#define IPC_SMS_TYPE_POINT_TO_POINT 0x01 +#define IPC_SMS_TYPE_STATUS_REPORT 0x02 +#define IPC_SMS_TYPE_OUTGOING 0x02 + +#define IPC_SMS_MSG_TYPE_MULTIPLE 0x01 +#define IPC_SMS_MSG_TYPE_SINGLE 0x02 + #define IPC_SMS_ACK_NO_ERROR 0x0000 #define IPC_SMS_ACK_PDA_FULL_ERROR 0x8080 #define IPC_SMS_ACK_MALFORMED_REQ_ERROR 0x8061 #define IPC_SMS_ACK_UNSPEC_ERROR 0x806F -#define IPC_SMS_MSG_MULTIPLE 0x01 -#define IPC_SMS_MSG_SINGLE 0x02 - -#define IPC_SMS_TYPE_POINT_TO_POINT 0x01 -#define IPC_SMS_TYPE_STATUS_REPORT 0x02 -#define IPC_SMS_TYPE_OUTGOING 0x02 - #define IPC_SMS_STATUS_REC_UNREAD 0x01 #define IPC_SMS_STATUS_REC_READ 0x02 #define IPC_SMS_STATUS_STO_UNSENT 0x03 @@ -70,65 +70,59 @@ * Structures */ -/* - * This is followed by: - * smsc_string (variable length, 1st byte is length) - * pdu (variable length) - */ -struct ipc_sms_send_msg_request { - unsigned char type; - unsigned char msg_type; - unsigned char unk; +struct ipc_sms_send_msg_request_header { + unsigned char type; // IPC_SMS_TYPE + unsigned char msg_type; // IPC_SMS_MSG_TYPE + unsigned char unknown; unsigned char length; - unsigned char smsc_len; } __attribute__((__packed__)); -struct ipc_sms_send_msg_response { - unsigned char type; - unsigned short error; - unsigned char msg_tpid; - unsigned char unk; +struct ipc_sms_send_msg_response_data { + unsigned char type; // IPC_SMS_TYPE + unsigned short ack; // IPC_SMS_ACK + unsigned char id; + unsigned char unknown; } __attribute__((__packed__)); -struct ipc_sms_incoming_msg { - unsigned char msg_type; - unsigned char type; +struct ipc_sms_incoming_msg_header { + unsigned char msg_type; // IPC_SMS_MSG_TYPE + unsigned char type; // IPC_SMS_TYPE unsigned short sim_index; - unsigned char msg_tpid; + unsigned char id; unsigned char length; } __attribute__((__packed__)); -struct ipc_sms_deliver_report_request { - unsigned char type; - unsigned short error; - unsigned char msg_tpid; - unsigned char unk; +struct ipc_sms_deliver_report_request_data { + unsigned char type; // IPC_SMS_TYPE + unsigned short ack; // IPC_SMS_ACK + unsigned char id; + unsigned char unknown; } __attribute__((__packed__)); -struct ipc_sms_deliver_report_response { - unsigned short error; +struct ipc_sms_deliver_report_response_data { + unsigned short ack; // IPC_SMS_ACK } __attribute__((__packed__)); struct ipc_sms_del_msg_request_data { - unsigned char unknown; // This is usually set to 0x02 + unsigned char magic; unsigned short index; } __attribute__((__packed__)); struct ipc_sms_del_msg_response_data { - unsigned char unknown; // This is usually set to 0x02 + unsigned char magic; unsigned short error; unsigned short index; } __attribute__((__packed__)); struct ipc_sms_save_msg_request_data { - unsigned char unknown; // This is usually set to 0x02 - unsigned short index; // This is usually set to 0x0B - unsigned char status; - unsigned char length; // Total SMSC+PDU length + unsigned char magic; + unsigned short index; + unsigned char status; // IPC_SMS_STATUS + unsigned char length; } __attribute__((__packed__)); struct ipc_sms_save_msg_response_data { - unsigned char unknown; // This is usually set to 0x02 + unsigned char magic; unsigned short error; unsigned short index; } __attribute__((__packed__)); @@ -137,8 +131,8 @@ struct ipc_sms_save_msg_response_data { * Helpers */ -unsigned char *ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request *msg, - char *smsc, unsigned char *pdu, int length); +unsigned char *ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request_header *msg, char *smsc, + unsigned char *pdu, int pdu_length); #endif diff --git a/include/snd.h b/include/snd.h index ff3a0b1..970fe68 100644 --- a/include/snd.h +++ b/include/snd.h @@ -57,7 +57,7 @@ * Structures */ -struct ipc_snd_spkr_volume_ctrl { +struct ipc_snd_spkr_volume_ctrl_data { unsigned char type; unsigned char volume; } __attribute__((__packed__)); diff --git a/include/ss.h b/include/ss.h index 3fd9dfd..67c78e1 100644 --- a/include/ss.h +++ b/include/ss.h @@ -45,16 +45,15 @@ #define IPC_SS_USSD_NO_ACTION_REQUIRE 0x01 #define IPC_SS_USSD_ACTION_REQUIRE 0x02 #define IPC_SS_USSD_TERMINATED_BY_NET 0x03 -#define IPC_SS_USSD_OTHER_CLIENT 0x04 //guess -#define IPC_SS_USSD_NOT_SUPPORT 0x05 //guess -#define IPC_SS_USSD_TIME_OUT 0x06 //guess +#define IPC_SS_USSD_OTHER_CLIENT 0x04 +#define IPC_SS_USSD_NOT_SUPPORT 0x05 +#define IPC_SS_USSD_TIME_OUT 0x06 /* * Structures */ -/* This is followed by the encoded (according to the dcs) bytes of the USSD message */ -struct ipc_ss_ussd { +struct ipc_ss_ussd_header { unsigned char state; unsigned char dcs; unsigned char length; diff --git a/include/svc.h b/include/svc.h index 9247d2e..718886f 100644 --- a/include/svc.h +++ b/include/svc.h @@ -87,13 +87,13 @@ */ struct ipc_svc_enter_data { - unsigned char mode; - unsigned char type; + unsigned char mode; // IPC_SVC_MODE + unsigned char type; // IPC_SVC_TYPE unsigned char unknown; } __attribute__((__packed__)); struct ipc_svc_end_data { - unsigned char mode; + unsigned char mode; // IPC_SVC_MODE } __attribute__((__packed__)); struct ipc_svc_pro_keycode_data { @@ -115,7 +115,7 @@ struct ipc_svc_display_screen_data { } __attribute__((__packed__)); struct ipc_svc_change_svc_mode_data { - unsigned char mode; + unsigned char mode; // IPC_SVC_MODE } __attribute__((__packed__)); #endif diff --git a/samsung-ipc/call.c b/samsung-ipc/call.c index 2c29d3d..c5c0c21 100644 --- a/samsung-ipc/call.c +++ b/samsung-ipc/call.c @@ -25,7 +25,7 @@ #define OUTGOING_NUMBER_MAX_LENGTH 86 -void ipc_call_outgoing_setup(struct ipc_call_outgoing *message, unsigned char type, +void ipc_call_outgoing_setup(struct ipc_call_outgoing_data *message, unsigned char type, unsigned char identity, unsigned char prefix, char *number) { int length; @@ -37,12 +37,12 @@ void ipc_call_outgoing_setup(struct ipc_call_outgoing *message, unsigned char ty if (length > OUTGOING_NUMBER_MAX_LENGTH) length = OUTGOING_NUMBER_MAX_LENGTH; - memset(message, 0, sizeof(struct ipc_call_outgoing)); + memset(message, 0, sizeof(struct ipc_call_outgoing_data)); message->type = type; message->identity = identity; message->prefix = prefix; - message->length = length; + message->number_length = length; strncpy((char *) message->number, number, length); } @@ -71,7 +71,7 @@ struct ipc_call_list_entry* ipc_call_list_response_get_entry(struct ipc_message_ for (n = 0; n < num + 1; n++) { entry = (struct ipc_call_list_entry *) (response->data + pos); - pos += (unsigned int) (sizeof(struct ipc_call_list_entry) + entry->number_len); + pos += (unsigned int) (sizeof(struct ipc_call_list_entry) + entry->number_length); } return entry; @@ -93,7 +93,7 @@ char *ipc_call_list_response_get_entry_number(struct ipc_message_info *response, for (n = 0; n < num + 1; n++) { if (entry != NULL) - pos += entry->number_len; + pos += entry->number_length; entry = (struct ipc_call_list_entry *) (response->data + pos); pos += (unsigned int) sizeof(struct ipc_call_list_entry); @@ -102,17 +102,17 @@ char *ipc_call_list_response_get_entry_number(struct ipc_message_info *response, if (entry == NULL || (unsigned char *) (response->data + pos) == NULL) return NULL; - number = (char *) malloc(sizeof(char) * entry->number_len); - strncpy(number, (char *) (response->data + pos), entry->number_len); + number = (char *) malloc(sizeof(char) * entry->number_length); + strncpy(number, (char *) (response->data + pos), entry->number_length); return number; } -unsigned char *ipc_call_cont_dtmf_burst_pack(struct ipc_call_cont_dtmf *message, +unsigned char *ipc_call_cont_dtmf_burst_pack(struct ipc_call_cont_dtmf_data *message, unsigned char *burst, int burst_len) { unsigned char *data = NULL; - int data_len = sizeof(struct ipc_call_cont_dtmf) + burst_len; + int data_len = sizeof(struct ipc_call_cont_dtmf_data) + burst_len; if (message == NULL || burst == NULL || burst_len <= 0) return NULL; @@ -120,8 +120,8 @@ unsigned char *ipc_call_cont_dtmf_burst_pack(struct ipc_call_cont_dtmf *message, data = (unsigned char *) malloc(sizeof(unsigned char) * data_len); memset(data, 0, data_len); - memcpy(data, message, sizeof(struct ipc_call_cont_dtmf)); - memcpy(data + sizeof(struct ipc_call_cont_dtmf), burst, burst_len); + memcpy(data, message, sizeof(struct ipc_call_cont_dtmf_data)); + memcpy(data + sizeof(struct ipc_call_cont_dtmf_data), burst, burst_len); return data; } diff --git a/samsung-ipc/gen.c b/samsung-ipc/gen.c index e2bc300..6db041b 100644 --- a/samsung-ipc/gen.c +++ b/samsung-ipc/gen.c @@ -21,7 +21,7 @@ #include -int ipc_gen_phone_res_check(struct ipc_gen_phone_res *res) +int ipc_gen_phone_res_check(struct ipc_gen_phone_res_data *res) { if (res == NULL) return -1; diff --git a/samsung-ipc/gprs.c b/samsung-ipc/gprs.c index b73c8f7..7c14df9 100644 --- a/samsung-ipc/gprs.c +++ b/samsung-ipc/gprs.c @@ -22,7 +22,7 @@ #include -void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message) +void ipc_gprs_port_list_setup(struct ipc_gprs_port_list_data *message) { // FIXME: These are only known-to-work values used on most devices unsigned char bytes[] = { @@ -32,41 +32,41 @@ void ipc_gprs_port_list_setup(struct ipc_gprs_port_list *message) if (message == NULL) return; - memset(message, 0, sizeof(struct ipc_gprs_port_list)); + memset(message, 0, sizeof(struct ipc_gprs_port_list_data)); - memcpy(message->unk, bytes, sizeof(bytes)); + memcpy(message->magic, bytes, sizeof(bytes)); } -void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context *message, +void ipc_gprs_define_pdp_context_setup(struct ipc_gprs_define_pdp_context_data *message, unsigned char cid, int enable, char *apn) { if (message == NULL) return; - memset(message, 0, sizeof(struct ipc_gprs_define_pdp_context)); + memset(message, 0, sizeof(struct ipc_gprs_define_pdp_context_data)); message->enable = enable ? 1 : 0; message->cid = cid; - message->unk = 0x2; + message->magic = 0x2; strncpy((char *) message->apn, apn, 124); } -void ipc_gprs_pdp_context_setup(struct ipc_gprs_pdp_context_set *message, +void ipc_gprs_pdp_context_request_set_setup(struct ipc_gprs_pdp_context_request_set_data *message, unsigned char cid, int enable, char *username, char *password) { if (message == NULL) return; - memset(message, 0, sizeof(struct ipc_gprs_pdp_context_set)); + memset(message, 0, sizeof(struct ipc_gprs_pdp_context_request_set_data)); message->enable = enable ? 1 : 0; message->cid = cid; if (enable && username != NULL && password != NULL) { - message->unk0[2] = 0x13; - message->unk2 = 0x1; + message->magic[2] = 0x13; + message->unknown2 = 0x1; strncpy((char *) message->username, username, 32); strncpy((char *) message->password, password, 32); } diff --git a/samsung-ipc/net.c b/samsung-ipc/net.c index 2a340a0..e67f909 100644 --- a/samsung-ipc/net.c +++ b/samsung-ipc/net.c @@ -22,15 +22,14 @@ #include -void ipc_net_regist_get_setup(struct ipc_net_regist_get *message, +void ipc_net_regist_setup(struct ipc_net_regist_request_data *message, unsigned char domain) { - /* FIXME: could that be IPC_NET_ACCESS_TECHNOLOGY_... (act) ? */ - message->net = 0xff; + message->act = IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN; message->domain = domain; } -void ipc_net_plmn_sel_set_setup(struct ipc_net_plmn_sel_set *message, +void ipc_net_plmn_sel_set_setup(struct ipc_net_plmn_sel_request_data *message, unsigned char mode, char *plmn, unsigned char act) { int message_plmn_len; @@ -42,11 +41,11 @@ void ipc_net_plmn_sel_set_setup(struct ipc_net_plmn_sel_set *message, message_plmn_len = sizeof(message->plmn); - memset(message, 0, sizeof(struct ipc_net_plmn_sel_set)); + memset(message, 0, sizeof(struct ipc_net_plmn_sel_request_data)); if (mode == IPC_NET_PLMN_SEL_AUTO) { - message->mode = IPC_NET_PLMN_SEL_AUTO; + message->mode_sel = IPC_NET_PLMN_SEL_AUTO; message->act = IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN; } else if (mode == IPC_NET_PLMN_SEL_MANUAL) @@ -63,7 +62,7 @@ void ipc_net_plmn_sel_set_setup(struct ipc_net_plmn_sel_set *message, if (plmn_len < message_plmn_len) memset((void *) (message->plmn + plmn_len), '#', message_plmn_len - plmn_len); - message->mode = IPC_NET_PLMN_SEL_MANUAL; + message->mode_sel = IPC_NET_PLMN_SEL_MANUAL; message->act = act; } } diff --git a/samsung-ipc/rfs.c b/samsung-ipc/rfs.c index 38eea11..0607abe 100644 --- a/samsung-ipc/rfs.c +++ b/samsung-ipc/rfs.c @@ -834,8 +834,8 @@ int nv_data_write(struct ipc_client *client, int offset, int length, char *buf) void ipc_rfs_send_io_confirm_for_nv_read_item(struct ipc_client *client, struct ipc_message_info *info) { - struct ipc_rfs_io *rfs_io = (struct ipc_rfs_io *) info->data; - struct ipc_rfs_io_confirm *rfs_io_conf; + struct ipc_rfs_nv_read_item_data *rfs_io = (struct ipc_rfs_nv_read_item_data *) info->data; + struct ipc_rfs_nv_read_item_confirm_header *rfs_io_conf; void *rfs_data; int rc; @@ -845,9 +845,9 @@ void ipc_rfs_send_io_confirm_for_nv_read_item(struct ipc_client *client, return; } - rfs_io_conf = malloc(rfs_io->length + sizeof(struct ipc_rfs_io_confirm)); - memset(rfs_io_conf, 0, rfs_io->length + sizeof(struct ipc_rfs_io_confirm)); - rfs_data = rfs_io_conf + sizeof(struct ipc_rfs_io_confirm); + rfs_io_conf = malloc(rfs_io->length + sizeof(struct ipc_rfs_nv_read_item_confirm_header)); + memset(rfs_io_conf, 0, rfs_io->length + sizeof(struct ipc_rfs_nv_read_item_confirm_header)); + rfs_data = rfs_io_conf + sizeof(struct ipc_rfs_nv_read_item_confirm_header); ipc_client_log(client, "Asked to read 0x%x bytes at offset 0x%x", rfs_io->length, rfs_io->offset); rc = nv_data_read(client, rfs_io->offset, rfs_io->length, rfs_data); @@ -863,15 +863,15 @@ void ipc_rfs_send_io_confirm_for_nv_read_item(struct ipc_client *client, rfs_io_conf->length = rfs_io->length; ipc_client_send(client, IPC_RFS_NV_READ_ITEM, 0, (unsigned char *) rfs_io_conf, - rfs_io->length + sizeof(struct ipc_rfs_io_confirm), info->aseq); + rfs_io->length + sizeof(struct ipc_rfs_nv_read_item_confirm_header), info->aseq); free(rfs_io_conf); } void ipc_rfs_send_io_confirm_for_nv_write_item(struct ipc_client *client, struct ipc_message_info *info) { - struct ipc_rfs_io *rfs_io = (struct ipc_rfs_io *) info->data; - struct ipc_rfs_io_confirm *rfs_io_conf; + struct ipc_rfs_nv_read_item_confirm_header *rfs_io = (struct ipc_rfs_nv_read_item_confirm_header *) info->data; + struct ipc_rfs_nv_write_item_confirm_data *rfs_io_conf; void *rfs_data; int rc; @@ -881,7 +881,7 @@ void ipc_rfs_send_io_confirm_for_nv_write_item(struct ipc_client *client, return; } - rfs_data = info->data + sizeof(struct ipc_rfs_io); + rfs_data = info->data + sizeof(struct ipc_rfs_nv_read_item_confirm_header); #ifdef DEBUG ipc_client_log(client, "Write rfs_data dump:"); @@ -892,13 +892,13 @@ void ipc_rfs_send_io_confirm_for_nv_write_item(struct ipc_client *client, rc = nv_data_write(client, rfs_io->offset, rfs_io->length, rfs_data); ipc_client_log(client, "Sending RFS IO Confirm message (rc is %d)", rc); - rfs_io_conf = (struct ipc_rfs_io_confirm*) malloc(sizeof(struct ipc_rfs_io_confirm)); + rfs_io_conf = (struct ipc_rfs_nv_write_item_confirm_data *) malloc(sizeof(struct ipc_rfs_nv_write_item_confirm_data)); rfs_io_conf->confirm = rc < 0 ? 0 : 1; rfs_io_conf->offset = rfs_io->offset; rfs_io_conf->length = rfs_io->length; ipc_client_send(client, IPC_RFS_NV_WRITE_ITEM, 0, (unsigned char *) rfs_io_conf, - sizeof(struct ipc_rfs_io_confirm), info->aseq); + sizeof(struct ipc_rfs_nv_write_item_confirm_data), info->aseq); free(rfs_io_conf); } diff --git a/samsung-ipc/sec.c b/samsung-ipc/sec.c index 7fa9a42..76584e8 100644 --- a/samsung-ipc/sec.c +++ b/samsung-ipc/sec.c @@ -23,52 +23,52 @@ #include -void ipc_sec_pin_status_set_setup(struct ipc_sec_pin_status_set *message, +void ipc_sec_sim_status_setup(struct ipc_sec_sim_status_request_data *message, unsigned char pin_type, char *pin1, char *pin2) { if (message == NULL) return; - memset(message, 0, sizeof(struct ipc_sec_pin_status_set)); + memset(message, 0, sizeof(struct ipc_sec_sim_status_request_data)); message->type = pin_type; if (pin1 != NULL) { strncpy((char *) message->pin1, pin1, 8); - message->length1 = strlen(pin1); + message->pin1_length = strlen(pin1); } if (pin2 != NULL) { strncpy((char *) message->pin2, pin2, 8); - message->length2 = strlen(pin2); + message->pin2_length = strlen(pin2); } } -void ipc_sec_lock_info_get_setup(struct ipc_sec_lock_info_get *message, +void ipc_sec_lock_info_setup(struct ipc_sec_lock_info_request_data *message, unsigned char pin_type) { if (message == NULL) return; - message->unk0 = 1; - message->pin_type = pin_type; + message->magic = 1; + message->type = pin_type; } char *ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *response) { int n = 0; - int offset = (int) sizeof(struct ipc_sec_rsim_access_response); + int offset = (int) sizeof(struct ipc_sec_rsim_access_response_header); int size = 0; if (response == NULL) return NULL; - struct ipc_sec_rsim_access_response *rsimresp = (struct ipc_sec_rsim_access_response*) response->data; - char *file_data = (char *) malloc(sizeof(char) * rsimresp->len); + struct ipc_sec_rsim_access_response_header *rsimresp = (struct ipc_sec_rsim_access_response_header*) response->data; + char *file_data = (char *) malloc(sizeof(char) * rsimresp->length); - for (n = 0; n < rsimresp->len; n++) + for (n = 0; n < rsimresp->length; n++) { if (response->data[offset + n] == 0x0) continue; @@ -80,40 +80,40 @@ char *ipc_sec_rsim_access_response_get_file_data(struct ipc_message_info *respon } } - if (size < rsimresp->len) + if (size < rsimresp->length) file_data = (char *) realloc(file_data, sizeof(char) * size); return file_data; } -void ipc_sec_phone_lock_set_setup(struct ipc_sec_phone_lock_set *message, +void ipc_sec_phone_lock_request_set_setup(struct ipc_sec_phone_lock_request_set_data *message, int pin_type, int enable, char *passwd) { - message->type = pin_type; - message->lock = enable ? 1 : 0; + message->facility_type = pin_type; + message->active = enable ? 1 : 0; if (passwd != NULL) { strncpy((char *) message->password, passwd, 39); - message->length = strlen(passwd); + message->password_length = strlen(passwd); } } -void ipc_sec_change_locking_pw_set_setup(struct ipc_sec_change_locking_pw_set *message, +void ipc_sec_change_locking_pw_setup(struct ipc_sec_change_locking_pw_data *message, int type, char *passwd_old, char *passwd_new) { - message->facility = type; + message->facility_type = type; if (passwd_old != NULL) { strncpy((char *) message->password_old, passwd_old, 39); - message->length_old = strlen(passwd_old); + message->password_old_length = strlen(passwd_old); } if (passwd_new != NULL) { strncpy((char *) message->password_new, passwd_new, 39); - message->length_new = strlen(passwd_new); + message->password_new_length = strlen(passwd_new); } } diff --git a/samsung-ipc/sms.c b/samsung-ipc/sms.c index d837881..047754e 100644 --- a/samsung-ipc/sms.c +++ b/samsung-ipc/sms.c @@ -22,7 +22,7 @@ #include -unsigned char *ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request *msg, char *smsc, +unsigned char *ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request_header *msg, char *smsc, unsigned char *pdu, int pdu_length) { unsigned char *data = NULL, *p = NULL; @@ -32,13 +32,13 @@ unsigned char *ipc_sms_send_msg_pack(struct ipc_sms_send_msg_request *msg, char return NULL; smsc_len = strlen(smsc); - data_length = smsc_len + pdu_length + sizeof(struct ipc_sms_send_msg_request); + data_length = smsc_len + pdu_length + sizeof(struct ipc_sms_send_msg_request_header); data = (unsigned char *) malloc(sizeof(unsigned char) * data_length); memset(data, 0, data_length); p = data; - memcpy(p, msg, sizeof(struct ipc_sms_send_msg_request)); - p += sizeof(struct ipc_sms_send_msg_request); + memcpy(p, msg, sizeof(struct ipc_sms_send_msg_request_header)); + p += sizeof(struct ipc_sms_send_msg_request_header); memcpy(p, (char *) (smsc + 1), smsc_len); p += smsc_len; memcpy(p, pdu, pdu_length); diff --git a/tools/modemctrl.c b/tools/modemctrl.c index df68b56..d8a9007 100644 --- a/tools/modemctrl.c +++ b/tools/modemctrl.c @@ -86,20 +86,20 @@ void modem_snd_audio_path_ctrl(struct ipc_client *client) void modem_exec_call_out(struct ipc_client *client, char *num) { - struct ipc_call_outgoing call_out; + struct ipc_call_outgoing_data call_out; modem_snd_no_mic_mute(client); - memset(&call_out, 0, sizeof(struct ipc_call_outgoing)); + memset(&call_out, 0, sizeof(struct ipc_call_outgoing_data)); call_out.type = IPC_CALL_TYPE_VOICE; call_out.identity = IPC_CALL_IDENTITY_DEFAULT; - call_out.length=strlen(num); + call_out.number_length=strlen(num); /* 0x21 = +33 */ call_out.prefix=IPC_CALL_PREFIX_NONE; //0x21;//IPC_CALL_PREFIX_NONE; - memcpy(call_out.number, num, call_out.length); + memcpy(call_out.number, num, call_out.number_length); - ipc_client_send(client, IPC_CALL_OUTGOING, IPC_TYPE_EXEC, (void *) &call_out, sizeof(struct ipc_call_outgoing), seq_get()); + ipc_client_send(client, IPC_CALL_OUTGOING, IPC_TYPE_EXEC, (void *) &call_out, sizeof(struct ipc_call_outgoing_data), seq_get()); out_call = 1; @@ -137,18 +137,18 @@ void modem_set_sms_device_ready(struct ipc_client *client) void modem_set_sec_pin_status(struct ipc_client *client, char *pin1, char *pin2) { - struct ipc_sec_pin_status_set pin_status; - struct ipc_sec_lock_info_get lock_info_req; + struct ipc_sec_sim_status_request_data pin_status; + struct ipc_sec_lock_info_request_data lock_info_req; printf("[I] Sending PIN1 unlock request\n"); - ipc_sec_pin_status_set_setup(&pin_status, IPC_SEC_PIN_TYPE_PIN1, pin1, pin2); + ipc_sec_sim_status_setup(&pin_status, IPC_SEC_PIN_TYPE_PIN1, pin1, pin2); ipc_client_send(client, IPC_SEC_SIM_STATUS, IPC_TYPE_SET, (void *) &pin_status, sizeof(pin_status), seq_get()); } void modem_response_sec(struct ipc_client *client, struct ipc_message_info *resp) { - struct ipc_sec_sim_status_response *sim_status; + struct ipc_sec_sim_status_response_data *sim_status; unsigned char type; int status; char *data; @@ -230,7 +230,7 @@ void modem_response_sms(struct ipc_client *client, struct ipc_message_info *resp void modem_response_call(struct ipc_client *client, struct ipc_message_info *resp) { - struct ipc_call_status *stat; + struct ipc_call_status_data *stat; switch(IPC_COMMAND(resp)) { @@ -248,29 +248,29 @@ void modem_response_call(struct ipc_client *client, struct ipc_message_info *res modem_get_call_list(client); break; case IPC_CALL_STATUS: - stat = (struct ipc_call_status *)resp->data; + stat = (struct ipc_call_status_data *)resp->data; - if(stat->state == IPC_CALL_STATE_DIALING) + if(stat->status == IPC_CALL_STATUS_DIALING) { printf("[I] Sending clock ctrl and restore alsa\n"); modem_snd_clock_ctrl(client); // system("alsa_ctl -f /data/alsa_state_modem restore"); - printf("[I] CALL STATE DIALING!!!\n"); + printf("[I] CALL STATUS DIALING!!!\n"); modem_snd_spkr_volume_ctrl(client); modem_snd_audio_path_ctrl(client); modem_get_call_list(client); } - if(stat->state == IPC_CALL_STATE_CONNECTED) + if(stat->status == IPC_CALL_STATUS_CONNECTED) { - printf("[I] CALL STATE CONNECTED!!!\n"); + printf("[I] CALL STATUS CONNECTED!!!\n"); modem_snd_no_mic_mute(client); } - if(stat->state == IPC_CALL_STATE_RELEASED) + if(stat->status == IPC_CALL_STATUS_RELEASED) { - printf("[I] CALL STATE RELEASED!!!\n"); + printf("[I] CALL STATUS RELEASED!!!\n"); modem_snd_no_mic_mute(client); } break; @@ -310,7 +310,7 @@ void modem_response_pwr(struct ipc_client *client, struct ipc_message_info *resp void modem_response_net(struct ipc_client *client, struct ipc_message_info *resp) { - struct ipc_net_regist_response *regi; + struct ipc_net_regist_response_data *regi; struct ipc_net_plmn_entry *plmn; char mnc[6]; @@ -318,7 +318,7 @@ void modem_response_net(struct ipc_client *client, struct ipc_message_info *resp { case IPC_NET_REGIST: regi = (struct ipc_net_regist_response*) resp->data; - if(regi->reg_state == IPC_NET_REGISTRATION_STATE_HOME) + if(regi->status == IPC_NET_REGISTRATION_STATUS_HOME) { printf("[I] Registered with network successfully!\n"); -- cgit v1.1