diff options
Diffstat (limited to 'samsung-ril.h')
-rw-r--r-- | samsung-ril.h | 716 |
1 files changed, 333 insertions, 383 deletions
diff --git a/samsung-ril.h b/samsung-ril.h index a154218..2879782 100644 --- a/samsung-ril.h +++ b/samsung-ril.h @@ -2,7 +2,7 @@ * This file is part of Samsung-RIL. * * 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> * * Samsung-RIL is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,54 +21,58 @@ #ifndef _SAMSUNG_RIL_H_ #define _SAMSUNG_RIL_H_ -#include <errno.h> +#include <stdlib.h> #include <string.h> #include <pthread.h> -#include <utils/Log.h> #include <telephony/ril.h> #include <samsung-ipc.h> +#include <samsung-ril-socket.h> -#include "ipc.h" -#include "srs.h" +#include <ipc.h> +#include <srs.h> +#include <utils.h> /* - * Defines + * Values + */ + +#define RIL_VERSION_STRING "Samsung-RIL" + +#define RIL_CLIENT_RETRY_COUNT 5 +#define RIL_CLIENT_RETRY_DELAY 50000 + +/* + * Macros */ #ifdef ALOGI -#define RIL_LOGI ALOGI +#define RIL_LOGI ALOGI #else -#define RIL_LOGI LOGI +#define RIL_LOGI LOGI #endif #ifdef ALOGD -#define RIL_LOGD ALOGD +#define RIL_LOGD ALOGD #else -#define RIL_LOGD LOGD +#define RIL_LOGD LOGD #endif #ifdef ALOGE -#define RIL_LOGE ALOGE +#define RIL_LOGE ALOGE #else -#define RIL_LOGE LOGE +#define RIL_LOGE LOGE #endif -#define RIL_VERSION_STRING "Samsung RIL" - -#define RIL_LOCK() pthread_mutex_lock(&ril_data.mutex) -#define RIL_UNLOCK() pthread_mutex_unlock(&ril_data.mutex) -#define RIL_CLIENT_LOCK(client) pthread_mutex_lock(&(client->mutex)) -#define RIL_CLIENT_UNLOCK(client) pthread_mutex_unlock(&(client->mutex)) - -#define RIL_TOKEN_DATA_WAITING (RIL_Token) 0xff -#define RIL_TOKEN_NULL (RIL_Token) 0x00 - -#define RIL_SMS_TPID 0xff -#define RIL_SMS_NUMBER "0123456789" - -#define RIL_CLIENT_MAX_TRIES 7 +#define RIL_LOCK() pthread_mutex_lock(&ril_data->mutex) +#define RIL_UNLOCK() pthread_mutex_unlock(&ril_data->mutex) +#define RIL_REQUEST_LOCK() pthread_mutex_lock(&ril_data->request_mutex) +#define RIL_REQUEST_UNLOCK() pthread_mutex_unlock(&ril_data->request_mutex) +#define RIL_REQUEST_LOOP_LOCK() pthread_mutex_lock(&ril_data->request_loop_mutex) +#define RIL_REQUEST_LOOP_UNLOCK() pthread_mutex_unlock(&ril_data->request_loop_mutex) +#define RIL_CLIENT_LOCK(client) pthread_mutex_lock(&client->mutex) +#define RIL_CLIENT_UNLOCK(client) pthread_mutex_unlock(&client->mutex) /* * RIL client @@ -76,431 +80,377 @@ struct ril_client; -struct ril_client_funcs { +enum { + RIL_CLIENT_IPC_FMT, + RIL_CLIENT_IPC_RFS, + RIL_CLIENT_SRS, +}; + +struct ril_client_handlers { int (*create)(struct ril_client *client); int (*destroy)(struct ril_client *client); - int (*read_loop)(struct ril_client *client); + int (*open)(struct ril_client *client); + int (*close)(struct ril_client *client); + int (*loop)(struct ril_client *client); }; -typedef enum { - RIL_CLIENT_NULL = 0, - RIL_CLIENT_CREATED = 1, - RIL_CLIENT_READY = 2, - RIL_CLIENT_DESTROYED = 3, - RIL_CLIENT_ERROR = 4, -} ril_client_state; +struct ril_client_callbacks { + int (*request_register)(struct ril_client *client, int request, RIL_Token token); + int (*request_unregister)(struct ril_client *client, int request, RIL_Token token); + int (*flush)(struct ril_client *client); +}; struct ril_client { - struct ril_client_funcs funcs; - ril_client_state state; + int id; + char *name; + int critical; + struct ril_client_handlers *handlers; + struct ril_client_callbacks *callbacks; + int failures; + int available; void *data; pthread_t thread; pthread_mutex_t mutex; }; -struct ril_client *ril_client_new(struct ril_client_funcs *client_funcs); -int ril_client_free(struct ril_client *client); +extern struct ril_client *ril_clients[]; +extern unsigned int ril_clients_count; + +extern struct ipc_dispatch_handler ipc_fmt_dispatch_handlers[]; +extern unsigned int ipc_fmt_dispatch_handlers_count; +extern struct ipc_dispatch_handler ipc_rfs_dispatch_handlers[]; +extern unsigned int ipc_rfs_dispatch_handlers_count; +extern struct srs_dispatch_handler srs_dispatch_handlers[]; +extern unsigned int srs_dispatch_handlers_count; + +struct ril_client *ril_client_find_id(int id); int ril_client_create(struct ril_client *client); int ril_client_destroy(struct ril_client *client); -int ril_client_thread_start(struct ril_client *client); +int ril_client_open(struct ril_client *client); +int ril_client_close(struct ril_client *client); +int ril_client_loop(struct ril_client *client); +int ril_client_request_register(struct ril_client *client, int request, + RIL_Token token); +int ril_client_request_unregister(struct ril_client *client, int request, + RIL_Token token); +int ril_client_flush(struct ril_client *client); /* - * RIL requests + * RIL request */ -struct ril_request_info { +enum { + RIL_REQUEST_PENDING, + RIL_REQUEST_HANDLED, + RIL_REQUEST_UNHANDLED, + RIL_REQUEST_COMPLETED, +}; + +struct ril_request_handler { + int request; + int (*handler)(void *data, size_t size, RIL_Token token); +}; + +struct ril_request { + int request; + void *data; + size_t size; RIL_Token token; - int id; - int canceled; + + int status; }; -int ril_request_id_get(void); -int ril_request_id_set(int id); -int ril_request_register(RIL_Token t, int id); -void ril_request_unregister(struct ril_request_info *request); -struct ril_request_info *ril_request_info_find_id(int id); -struct ril_request_info *ril_request_info_find_token(RIL_Token t); -int ril_request_set_canceled(RIL_Token t, int canceled); -int ril_request_get_canceled(RIL_Token t); -RIL_Token ril_request_get_token(int id); -int ril_request_get_id(RIL_Token t); - -void ril_request_complete(RIL_Token t, RIL_Errno e, void *data, size_t length); -void ril_request_unsolicited(int request, void *data, size_t length); -void ril_request_timed_callback(RIL_TimedCallback callback, void *data, const struct timeval *time); +extern struct ril_request_handler ril_request_handlers[]; +extern unsigned int ril_request_handlers_count; + +int ril_request_register(int request, void *data, size_t size, RIL_Token token); +int ril_request_unregister(struct ril_request *request); +int ril_request_flush(void); +struct ril_request *ril_request_find(void); +struct ril_request *ril_request_find_request_status(int request, int status); +struct ril_request *ril_request_find_request(int request); +struct ril_request *ril_request_find_token(RIL_Token token); +struct ril_request *ril_request_find_status(int status); +int ril_request_complete(RIL_Token token, RIL_Errno error, void *data, + size_t size); +int ril_request_unsolicited(int request, void *data, size_t size); +int ril_request_timed_callback(RIL_TimedCallback callback, void *data, + const struct timeval *time); + +/* + * RIL request data + */ + +struct ril_request_data { + int request; + void *data; + size_t size; +}; + +int ril_request_data_register(int request, void *data, size_t size); +int ril_request_data_unregister(struct ril_request_data *request_data); +int ril_request_data_flush(void); +struct ril_request_data *ril_request_data_find_request(int request); +int ril_request_data_free(int request); +int ril_request_data_set(int request, void *data, size_t size); +int ril_request_data_set_uniq(int request, void *data, size_t size); +size_t ril_request_data_size_get(int request); +void *ril_request_data_get(int request); /* * RIL radio state */ -int ril_radio_state_complete(RIL_RadioState radio_state, RIL_Token token); -void ril_radio_state_update(RIL_RadioState radio_state); +int ril_radio_state_update(RIL_RadioState radio_state); +int ril_radio_state_check(RIL_RadioState radio_state); /* - * RIL tokens + * RIL data */ -struct ril_tokens { - RIL_Token radio_power; - RIL_Token pin_status; - RIL_Token get_imei; - RIL_Token get_imeisv; - RIL_Token baseband_version; +struct ril_data { + const struct RIL_Env *env; + + RIL_RadioState radio_state; + char *sim_pin; - RIL_Token registration_state; - RIL_Token gprs_registration_state; - RIL_Token operator; + struct list_head *requests; + struct list_head *requests_data; + + struct list_head *data_connections; - RIL_Token outgoing_sms; - RIL_Token sim_io; + pthread_mutex_t mutex; + + pthread_t request_thread; + pthread_mutex_t request_mutex; + pthread_mutex_t request_loop_mutex; }; -void ril_tokens_check(void); +extern struct ril_data *ril_data; + +int ril_data_create(void); +int ril_data_destroy(void); /* - * RIL state + * Power */ -typedef enum { - SIM_STATE_ABSENT = 0, - SIM_STATE_NOT_READY = 1, - SIM_STATE_READY = 2, - SIM_STATE_PIN = 3, - SIM_STATE_PUK = 4, - SIM_STATE_BLOCKED = 5, - SIM_STATE_NETWORK_PERSO = 6, - SIM_STATE_NETWORK_SUBSET_PERSO = 7, - SIM_STATE_CORPORATE_PERSO = 8, - SIM_STATE_SERVICE_PROVIDER_PERSO = 9, -} ril_sim_state; - -struct ril_state { - RIL_RadioState radio_state; - ril_sim_state sim_state; +int ipc_pwr_phone_pwr_up(struct ipc_message *message); +int ipc_pwr_phone_reset(struct ipc_message *message); +int ipc_pwr_phone_state(struct ipc_message *message); +int ril_request_radio_power(void *data, size_t size, RIL_Token token); - struct ipc_sec_sim_status_response sim_pin_status; - struct ipc_sec_sim_icc_type sim_icc_type; +/* + * Call + */ - struct ipc_net_regist_response netinfo; - struct ipc_net_regist_response gprs_netinfo; - struct ipc_net_current_plmn_response plmndata; +int ril_request_dial(void *data, size_t size, RIL_Token token); +int ipc_call_incoming(struct ipc_message *message); +int ril_request_hangup(void *data, size_t size, RIL_Token token); +int ril_request_answer(void *data, size_t size, RIL_Token token); +int ipc_call_status(struct ipc_message *message); +int ril_request_last_call_fail_cause(void *data, size_t size, RIL_Token token); +int ipc_call_list(struct ipc_message *message); +int ril_request_get_current_calls(void *data, size_t size, RIL_Token token); +int ipc_call_cont_dtmf_callback(struct ipc_message *message); +int ipc_call_burst_dtmf(struct ipc_message *message); +int ril_request_dtmf_complete(unsigned char aseq, char tone); +int ril_request_dtmf(void *data, size_t size, RIL_Token token); +int ril_request_dtmf_start_complete(unsigned char aseq, char tone); +int ril_request_dtmf_start(void *data, size_t size, RIL_Token token); +int ril_request_dtmf_stop_complete(unsigned char aseq, int callback); +int ril_request_dtmf_stop(void *data, size_t size, RIL_Token token); - struct ipc_call_status call_status; +/* + * SMS + */ - int gprs_last_failed_cid; +int ipc_sms_send_msg(struct ipc_message *message); +int ril_request_send_sms_complete(unsigned char seq, const void *smsc, + size_t smsc_size, const void *pdu, size_t pdu_size); +int ril_request_send_sms(void *data, size_t size, RIL_Token token); +int ipc_sms_incoming_msg(struct ipc_message *message); +int ipc_sms_save_msg(struct ipc_message *message); +int ril_request_write_sms_to_sim(void *data, size_t size, RIL_Token token); +int ipc_sms_del_msg(struct ipc_message *message); +int ril_request_delete_sms_on_sim(void *data, size_t size, RIL_Token token); +int ipc_sms_deliver_report(struct ipc_message *message); +int ril_request_sms_acknowledge(void *data, size_t size, RIL_Token token); +int ipc_sms_svc_center_addr(struct ipc_message *message); - unsigned char dtmf_tone; - unsigned char ussd_state; +/* + * SIM + */ - unsigned char sms_incoming_msg_tpid; - unsigned char ril_sms_tpid; -}; +int ipc_sec_pin_status_callback(struct ipc_message *message); +int ipc_sec_pin_status(struct ipc_message *message); +int ril_request_get_sim_status(void *data, size_t size, RIL_Token token); +int ipc_sec_phone_lock(struct ipc_message *message); +int ril_request_query_facility_lock(void *data, size_t size, RIL_Token token); +int ipc_sec_callback(struct ipc_message *message); +int ril_request_set_facility_lock(void *data, size_t size, RIL_Token token); +int ril_request_enter_sim_pin(void *data, size_t size, RIL_Token token); +int ril_request_enter_sim_puk(void *data, size_t size, RIL_Token token); +int ril_request_enter_sim_pin2(void *data, size_t size, RIL_Token token); +int ril_request_enter_sim_puk2(void *data, size_t size, RIL_Token token); +int ril_request_change_sim_pin(void *data, size_t size, RIL_Token token); +int ril_request_change_sim_pin2(void *data, size_t size, RIL_Token token); +int ipc_sec_rsim_access(struct ipc_message *message); +int ril_request_sim_io(void *data, size_t size, RIL_Token token); +int ipc_sec_sim_icc_type(struct ipc_message *message); +int ipc_sec_lock_infomation(struct ipc_message *message); /* - * RIL data + * Network */ -struct ril_data { - struct RIL_Env *env; - - struct ril_state state; - struct ril_tokens tokens; - struct ril_oem_hook_svc_session *oem_hook_svc_session; - struct list_head *gprs_connections; - struct list_head *incoming_sms; - struct list_head *outgoing_sms; - struct list_head *sim_io; - struct list_head *generic_responses; - struct list_head *requests; - int request_id; - - struct ril_client *ipc_fmt_client; - struct ril_client *ipc_rfs_client; - struct ril_client *srs_client; +int ipc_disp_icon_info(struct ipc_message *message); +int ril_request_signal_strength(void *data, size_t size, RIL_Token token); +int ipc_disp_rssi_info(struct ipc_message *message); +int ipc_net_plmn_sel(struct ipc_message *message); +int ril_request_query_network_selection_mode(void *data, size_t size, + RIL_Token token); +int ipc_net_plmn_sel_callback(struct ipc_message *message); +int ril_request_set_network_selection_automatic(void *data, size_t size, + RIL_Token token); +int ril_request_set_network_selection_manual(void *data, size_t size, + RIL_Token token); +int ipc_net_serving_network(struct ipc_message *message); +int ril_request_operator(void *data, size_t size, RIL_Token token); +int ipc_net_plmn_list(struct ipc_message *message); +int ril_request_query_available_networks(void *data, size_t size, + RIL_Token token); +int ipc_net_regist(struct ipc_message *message); +#if RIL_VERSION >= 6 +int ril_request_voice_registration_state(void *data, size_t size, + RIL_Token token); +#else +int ril_request_registration_state(void *data, size_t size, RIL_Token token); +#endif +#if RIL_VERSION >= 6 +int ril_request_data_registration_state(void *data, size_t size, + RIL_Token token); +#else +int ril_request_gprs_registration_state(void *data, size_t size, + RIL_Token token); +#endif +int ipc_net_mode_sel(struct ipc_message *message); +int ril_request_get_preferred_network_type(void *data, size_t size, + RIL_Token token); +int ril_request_set_preferred_network_type(void *data, size_t size, + RIL_Token token); - pthread_mutex_t mutex; -}; +/* + * Sound + */ -extern struct ril_data ril_data; +int srs_snd_set_call_volume(struct srs_message *message); +int ril_request_set_mute(void *data, size_t size, RIL_Token token); +int srs_snd_set_call_audio_path(struct srs_message *message); +int srs_snd_set_call_clock_sync(struct srs_message *message); /* - * Dispatch functions + * Misc */ -void ipc_fmt_dispatch(struct ipc_message_info *info); -void ipc_rfs_dispatch(struct ipc_message_info *info); -void srs_dispatch(struct srs_message *message); +int ipc_misc_me_version(struct ipc_message *message); +int ril_request_baseband_version(void *data, size_t size, RIL_Token token); +int ipc_misc_me_imsi(struct ipc_message *message); +int ril_request_get_imsi(void *data, size_t size, RIL_Token token); +int ipc_misc_me_sn(struct ipc_message *message); +int ril_request_get_imei(void *data, size_t size, RIL_Token token); +int ril_request_get_imeisv(void *data, size_t size, RIL_Token token); +int ipc_misc_time_info(struct ipc_message *message); +int ril_request_screen_state(void *data, size_t size, RIL_Token token); -/* GEN */ +/* + * OEM + */ -struct ipc_gen_phone_res_expect_info { - unsigned char aseq; - unsigned short command; - void (*func)(struct ipc_message_info *info); - int complete; - int abort; -}; +int ipc_svc_display_screen(struct ipc_message *message); +int ril_request_oem_hook_raw(void *data, size_t size, RIL_Token token); -int ipc_gen_phone_res_expect_register(unsigned char aseq, unsigned short command, - void (*func)(struct ipc_message_info *info), int complete, int abort); -void ipc_gen_phone_res_expect_unregister(struct ipc_gen_phone_res_expect_info *expect); -struct ipc_gen_phone_res_expect_info *ipc_gen_phone_res_expect_find_aseq(unsigned char aseq); -int ipc_gen_phone_res_expect_to_func(unsigned char aseq, unsigned short command, - void (*func)(struct ipc_message_info *info)); -int ipc_gen_phone_res_expect_to_complete(unsigned char aseq, unsigned short command); -int ipc_gen_phone_res_expect_to_abort(unsigned char aseq, unsigned short command); - -void ipc_gen_phone_res(struct ipc_message_info *info); - -/* PWR */ - -void ipc_pwr_phone_pwr_up(void); -void ipc_pwr_phone_reset(void); -void ipc_pwr_phone_state(struct ipc_message_info *info); -void ril_request_radio_power(RIL_Token t, void *data, int length); - -/* DISP */ - -void ril_request_signal_strength(RIL_Token t); -void ipc_disp_icon_info(struct ipc_message_info *info); -void ipc_disp_rssi_info(struct ipc_message_info *info); - -/* MISC */ - -void ril_request_get_imei(RIL_Token t); -void ril_request_get_imeisv(RIL_Token t); -void ipc_misc_me_sn(struct ipc_message_info *info); -void ril_request_baseband_version(RIL_Token t); -void ipc_misc_me_version(struct ipc_message_info *info); -void ril_request_get_imsi(RIL_Token t); -void ipc_misc_me_imsi(struct ipc_message_info *info); -void ipc_misc_time_info(struct ipc_message_info *info); - -/* SAT */ -void ril_request_report_stk_service_is_running(RIL_Token t); -void ipc_sat_proactive_cmd(struct ipc_message_info *info); -void ril_request_stk_send_terminal_response(RIL_Token t, void *data, size_t length); -void ril_request_stk_send_envelope_command(RIL_Token t, void *data, size_t length); -void ipc_sat_envelope_cmd(struct ipc_message_info *info); - -/* SS */ - -void ril_request_send_ussd(RIL_Token t, void *data, size_t datalen); -void ril_request_cancel_ussd(RIL_Token t, void *data, size_t datalen); -void ipc_ss_ussd(struct ipc_message_info *info); - -/* SEC */ - -struct ril_request_sim_io_info { - unsigned char command; - unsigned short fileid; - unsigned char p1; - unsigned char p2; - unsigned char p3; - void *data; - int length; +/* + * Data + */ - int waiting; +struct ril_data_connection { + unsigned int cid; RIL_Token token; -}; -void ril_state_update(ril_sim_state status); -void ipc_sec_sim_status(struct ipc_message_info *info); -void ril_request_get_sim_status(RIL_Token t); -void ipc_sec_sim_icc_type(struct ipc_message_info *info); -void ril_request_sim_io_next(void); -void ril_request_sim_io_complete(RIL_Token t, unsigned char command, unsigned short fileid, - unsigned char p1, unsigned char p2, unsigned char p3, void *data, int length); -void ril_request_sim_io(RIL_Token t, void *data, int length); -void ipc_sec_rsim_access(struct ipc_message_info *info); -void ipc_sec_sim_status_complete(struct ipc_message_info *info); -void ipc_sec_lock_info(struct ipc_message_info *info); -void ril_request_enter_sim_pin(RIL_Token t, void *data, size_t length); -void ril_request_change_sim_pin(RIL_Token t, void *data, size_t length); -void ril_request_enter_sim_puk(RIL_Token t, void *data, size_t length); -void ril_request_query_facility_lock(RIL_Token t, void *data, size_t length); -void ipc_sec_phone_lock(struct ipc_message_info *info); -void ipc_sec_phone_lock_complete(struct ipc_message_info *info); -void ril_request_set_facility_lock(RIL_Token t, void *data, size_t length); - -/* SVC */ - -typedef enum { - RIL_OEM_HOOK_TAG_SVC = 1, -} RIL_OEMHookTag; - -typedef enum { - RIL_OEM_COMMAND_SVC_ENTER_MODE = 1, - RIL_OEM_COMMAND_SVC_END_MODE = 2, - RIL_OEM_COMMAND_SVC_KEY = 3, -} RIL_OEMCommandSvc; - -typedef struct { - unsigned char tag; - unsigned char command; - unsigned short length; -} RIL_OEMHookHeader; - -typedef struct { - unsigned char mode; - unsigned char type; - unsigned char query; -} RIL_OEMHookSvcEnterMode; - -typedef struct { - unsigned char mode; -} RIL_OEMHookSvcEndMode; - -typedef struct { - unsigned char key; - unsigned char query; -} RIL_OEMHookSvcKey; - -struct ril_oem_hook_svc_session { - RIL_Token token; - void *display_screen; - size_t display_screen_length; + int enabled; + int attached; + + char *apn; + char *username; + char *password; + + char *iface; + char *ip; + char *gateway; + char *subnet_mask; + char *dns1; + char *dns2; }; -void ipc_svc_display_screen(struct ipc_message_info *info); -void ril_request_oem_hook_raw(RIL_Token t, void *data, int length); - -/* NET */ - -void ril_plmn_split(char *plmn_data, char **plmn, unsigned int *mcc, unsigned int *mnc); -void ril_plmn_string(char *plmn_data, char *response[3]); -unsigned char ril_plmn_act_get(char *plmn_data); -void ril_request_operator(RIL_Token t); -void ipc_net_current_plmn(struct ipc_message_info *message); -#if RIL_VERSION >= 6 -void ril_request_voice_registration_state(RIL_Token t); -void ril_request_data_registration_state(RIL_Token t); -#else -void ril_request_registration_state(RIL_Token t); -void ril_request_gprs_registration_state(RIL_Token t); -#endif -void ipc_net_regist(struct ipc_message_info *message); -void ril_request_query_available_networks(RIL_Token t); -void ipc_net_plmn_list(struct ipc_message_info *info); -void ril_request_get_preferred_network_type(RIL_Token t); -void ril_request_set_preferred_network_type(RIL_Token t, void *data, size_t length); -void ipc_net_mode_sel(struct ipc_message_info *info); -void ril_request_query_network_selection_mode(RIL_Token t); -void ipc_net_plmn_sel(struct ipc_message_info *info); -void ril_request_set_network_selection_automatic(RIL_Token t); -void ril_request_set_network_selection_manual(RIL_Token t, void *data, size_t length); - -/* SMS */ - -struct ipc_sms_incoming_msg_info { - char *pdu; - int length; - - unsigned char type; - unsigned char tpid; -}; +int ril_data_connection_register(unsigned int cid, char *apn, char *username, + char *password, char *iface); +int ril_data_connection_unregister(struct ril_data_connection *data_connection); +int ril_data_connection_flush(void); +struct ril_data_connection *ril_data_connection_find_cid(unsigned int cid); +struct ril_data_connection *ril_data_connection_find_token(RIL_Token token); +struct ril_data_connection *ril_data_connection_start(char *apn, char *username, + char *password); +int ril_data_connection_stop(struct ril_data_connection *data_connection); +int ril_data_connection_enable(struct ril_data_connection *data_connection); +int ril_data_connection_disable(struct ril_data_connection *data_connection); +int ipc_gprs_define_pdp_context_callback(struct ipc_message *message); +int ril_request_setup_data_call(void *data, size_t size, RIL_Token token); +int ipc_gprs_ps(struct ipc_message *message); +int ipc_gprs_pdp_context(struct ipc_message *message); +int ril_request_data_call_list(void *data, size_t size, RIL_Token token); +int ipc_gprs_pdp_context_callback(struct ipc_message *message); +int ril_request_deactivate_data_call(void *data, size_t size, RIL_Token token); +int ipc_gprs_ip_configuration(struct ipc_message *message); +int ipc_gprs_hsdpa_status(struct ipc_message *message); +int ipc_gprs_call_status(struct ipc_message *message); +int ril_request_last_data_call_fail_cause(void *data, size_t size, + RIL_Token token); -struct ril_request_send_sms_info { - char *pdu; - int pdu_length; - unsigned char *smsc; - int smsc_length; +/* + * RFS + */ - RIL_Token token; -}; +int ipc_rfs_nv_read_item(struct ipc_message *message); +int ipc_rfs_nv_write_item(struct ipc_message *message); -int ril_request_send_sms_register(char *pdu, int pdu_length, unsigned char *smsc, int smsc_length, RIL_Token t); -void ril_request_send_sms_unregister(struct ril_request_send_sms_info *send_sms); -struct ril_request_send_sms_info *ril_request_send_sms_info_find(void); -struct ril_request_send_sms_info *ril_request_send_sms_info_find_token(RIL_Token t); - -void ril_request_send_sms_next(void); -void ril_request_send_sms_complete(RIL_Token t, char *pdu, int pdu_length, unsigned char *smsc, int smsc_length); -void ril_request_send_sms(RIL_Token t, void *data, size_t length); -void ril_request_send_sms_expect_more(RIL_Token t, void *data, size_t length); -void ipc_sms_svc_center_addr(struct ipc_message_info *info); -void ipc_sms_send_msg_complete(struct ipc_message_info *info); -void ipc_sms_send_msg(struct ipc_message_info *info); - -int ipc_sms_incoming_msg_register(char *pdu, int length, unsigned char type, unsigned char tpid); -void ipc_sms_incoming_msg_unregister(struct ipc_sms_incoming_msg_info *incoming_msg); -struct ipc_sms_incoming_msg_info *ipc_sms_incoming_msg_info_find(void); - -void ipc_sms_incoming_msg_complete(char *pdu, int length, unsigned char type, unsigned char tpid); -void ipc_sms_incoming_msg(struct ipc_message_info *info); -void ril_request_sms_acknowledge(RIL_Token t, void *data, size_t length); -void ipc_sms_deliver_report(struct ipc_message_info *info); - -void ril_request_write_sms_to_sim(RIL_Token token, void *data, size_t size); -void ipc_sms_save_msg(struct ipc_message_info *info); -void ril_request_delete_sms_on_sim(RIL_Token token, void *data, size_t size); -void ipc_sms_del_msg(struct ipc_message_info *info); - -int ril_sms_send(char *number, char *message); - -void ipc_sms_device_ready(struct ipc_message_info *info); - -/* Call */ - -void ipc_call_incoming(struct ipc_message_info *info); -void ipc_call_status(struct ipc_message_info *info); -void ril_request_dial(RIL_Token t, void *data, size_t length); -void ril_request_get_current_calls(RIL_Token t); -void ipc_call_list(struct ipc_message_info *info); -void ril_request_hangup(RIL_Token t); -void ril_request_answer(RIL_Token t); -void ril_request_last_call_fail_cause(RIL_Token t); -void ril_request_dtmf(RIL_Token t, void *data, int length); -void ipc_call_burst_dtmf(struct ipc_message_info *info); -void ril_request_dtmf_start(RIL_Token t, void *data, int length); -void ril_request_dtmf_stop(RIL_Token t); - -/* SND */ - -void ril_request_set_mute(RIL_Token t, void *data, int length); -void srs_snd_set_call_clock_sync(struct srs_message *message); -void srs_snd_set_call_volume(struct srs_message *message); -void srs_snd_set_call_audio_path(struct srs_message *message); - -/* GPRS */ - -struct ril_gprs_connection { - int cid; - int enabled; -#if RIL_VERSION >= 6 - RIL_DataCallFailCause fail_cause; -#else - RIL_LastDataCallActivateFailCause fail_cause; -#endif - char *interface; +/* + * GEN + */ - RIL_Token token; - struct ipc_gprs_pdp_context_set context; - struct ipc_gprs_define_pdp_context define_context; - struct ipc_gprs_ip_configuration ip_configuration; +struct ipc_gen_phone_res_expect { + unsigned char aseq; + unsigned short command; + int (*callback)(struct ipc_message *message); + int complete; + int abort; }; -int ril_gprs_connection_register(int cid); -void ril_gprs_connection_unregister(struct ril_gprs_connection *gprs_connection); -struct ril_gprs_connection *ril_gprs_connection_find_cid(int cid); -struct ril_gprs_connection *ril_gprs_connection_find_token(RIL_Token t); -struct ril_gprs_connection *ril_gprs_connection_start(void); -void ril_gprs_connection_stop(struct ril_gprs_connection *gprs_connection); - -void ril_request_setup_data_call(RIL_Token t, void *data, int length); -void ril_request_deactivate_data_call(RIL_Token t, void *data, int length); -void ipc_gprs_ip_configuration(struct ipc_message_info *info); -void ipc_gprs_call_status(struct ipc_message_info *info); -void ril_request_last_data_call_fail_cause(RIL_Token t); -void ipc_gprs_pdp_context(struct ipc_message_info *info); -void ril_unsol_data_call_list_changed(void); -void ril_request_data_call_list(RIL_Token t); - -/* RFS */ - -void ipc_rfs_nv_read_item(struct ipc_message_info *info); -void ipc_rfs_nv_write_item(struct ipc_message_info *info); +int ipc_gen_phone_res_expect_register(struct ril_client *client, + unsigned char aseq, unsigned short command, + int (*callback)(struct ipc_message *message), + int complete, int abort); +int ipc_gen_phone_res_expect_unregister(struct ril_client *client, + struct ipc_gen_phone_res_expect *expect); +int ipc_gen_phone_res_expect_flush(struct ril_client *client); +struct ipc_gen_phone_res_expect *ipc_gen_phone_res_expect_find_aseq(struct ril_client *client, + unsigned char aseq); +int ipc_gen_phone_res_expect_callback(unsigned char aseq, unsigned short command, + int (*callback)(struct ipc_message *message)); +int ipc_gen_phone_res_expect_complete(unsigned char aseq, unsigned short command); +int ipc_gen_phone_res_expect_abort(unsigned char aseq, unsigned short command); +int ipc_gen_phone_res(struct ipc_message *message); #endif |