summaryrefslogtreecommitdiffstats
path: root/sim.c
diff options
context:
space:
mode:
authorPaulK <contact@paulk.fr>2011-11-22 21:50:42 +0100
committerPaulK <contact@paulk.fr>2011-11-22 21:50:42 +0100
commit233f0f23c75971de36d77605572c9df6b344ca73 (patch)
tree06598ad50aa97a30041d05ab9c0e8d13c797ea51 /sim.c
parent791fd3e4a946c05d6598f5054075515df6327b7d (diff)
downloadhardware_ril_samsung-ril-233f0f23c75971de36d77605572c9df6b344ca73.zip
hardware_ril_samsung-ril-233f0f23c75971de36d77605572c9df6b344ca73.tar.gz
hardware_ril_samsung-ril-233f0f23c75971de36d77605572c9df6b344ca73.tar.bz2
Modified samsung-ril to work on Nexus S.
Currently, the following is working: * (automatic) network registration (clean and stable) * SMS (no clean queue engine and no support for multiple message SMS) * SIM I/O * Other minor stuff And the following is left to do: * DATA (3G) * airplane to normal power mode * calls (including audio routing) * RFS messages handling (mostly to be done at IPC level) * Other minor stuff
Diffstat (limited to 'sim.c')
-rw-r--r--sim.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sim.c b/sim.c
index 4baa379..4bed491 100644
--- a/sim.c
+++ b/sim.c
@@ -17,6 +17,10 @@ extern struct ipc_client *ipc_client;
*/
void updateRadioState(SIM_Status status)
{
+ /* If power mode isn't at least normal, don't update RIL state */
+ if(radio.power_mode < POWER_MODE_NORMAL)
+ return;
+
switch(status) {
case SIM_READY:
radio.radio_state = RADIO_STATE_SIM_READY;
@@ -39,6 +43,7 @@ void updateRadioState(SIM_Status status)
break;
}
+ RadioTokensCheck();
RIL_onUnsolicitedResponse(RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED, NULL, 0);
}
@@ -58,6 +63,15 @@ void respondSimStatusChanged(RIL_Token t, void *data, int length)
{
struct ipc_sec_pin_status_noti *pin_status = (struct ipc_sec_pin_status_noti*)data;
+ /* Don't consider this if modem isn't in normal power mode. */
+ if(radio.power_mode < POWER_MODE_NORMAL)
+ return;
+
+ if(radio.power_mode == POWER_MODE_NORMAL && radio.tokens.radio_power != 0) {
+ RIL_onRequestComplete(radio.tokens.radio_power, RIL_E_SUCCESS, NULL, 0);
+ radio.tokens.radio_power = 0;
+ }
+
/* Determine SIM status */
switch(pin_status->type) {
case IPC_SEC_PIN_SIM_INITIALIZING:
@@ -340,11 +354,7 @@ void requestEnterSimPin(RIL_Token t, void *data, size_t datalen)
RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
}
- memset(&pin_status, 0, sizeof(pin_status));
-
- pin_status.type = IPC_SEC_PIN_TYPE_PIN1;
- pin_status.length1 = strlen(pin);
- memcpy(pin_status.pin1, pin, strlen(pin));
+ ipc_sec_pin_status_set_setup(&pin_status, IPC_SEC_PIN_TYPE_PIN1, pin, NULL);
ipc_client_send_set(IPC_SEC_PIN_STATUS, getRequestId(t), (unsigned char*)&pin_status, sizeof(pin_status));