diff options
author | Paul Kocialkowski <contact@paulk.fr> | 2014-02-06 20:26:30 +0100 |
---|---|---|
committer | Paul Kocialkowski <contact@paulk.fr> | 2014-02-06 20:26:30 +0100 |
commit | 0b3a6b4838e4ba55c79387bf7314e6dffb33bf42 (patch) | |
tree | 66988f78393b8e83974f4798ef095cde3b32eb99 /include | |
parent | b2aaec58195f8ce135ba7debcef148998b8a3e71 (diff) | |
download | external_libsamsung-ipc-0b3a6b4838e4ba55c79387bf7314e6dffb33bf42.zip external_libsamsung-ipc-0b3a6b4838e4ba55c79387bf7314e6dffb33bf42.tar.gz external_libsamsung-ipc-0b3a6b4838e4ba55c79387bf7314e6dffb33bf42.tar.bz2 |
Follow consistent coding style in headers
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Diffstat (limited to 'include')
-rw-r--r-- | include/call.h | 81 | ||||
-rw-r--r-- | include/disp.h | 4 | ||||
-rw-r--r-- | include/gen.h | 4 | ||||
-rw-r--r-- | include/gprs.h | 92 | ||||
-rw-r--r-- | include/misc.h | 14 | ||||
-rw-r--r-- | include/net.h | 99 | ||||
-rw-r--r-- | include/protocol.h | 4 | ||||
-rw-r--r-- | include/pwr.h | 6 | ||||
-rw-r--r-- | include/rfs.h | 15 | ||||
-rw-r--r-- | include/sec.h | 141 | ||||
-rw-r--r-- | include/sms.h | 78 | ||||
-rw-r--r-- | include/snd.h | 2 | ||||
-rw-r--r-- | include/ss.h | 9 | ||||
-rw-r--r-- | include/svc.h | 8 |
14 files changed, 262 insertions, 295 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 <j.de.gram@gmail.com> - * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr> + * Copyright (C) 2011-2014 Paul Kocialkowski <contact@paulk.fr> * * 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 <morphis@gravedo.de> - * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr> + * Copyright (C) 2011-2014 Paul Kocialkowski <contact@paulk.fr> * * 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 <j.de.gram@gmail.com> * Copyright (C) 2011 Simon Busch <morphis@gravedo.de> - * Copyright (C) 2011-2013 Paul Kocialkowski <contact@paulk.fr> + * Copyright (C) 2011-2014 Paul Kocialkowski <contact@paulk.fr> * * 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 |