diff options
author | PaulK <contact@paulk.fr> | 2011-11-22 21:50:42 +0100 |
---|---|---|
committer | PaulK <contact@paulk.fr> | 2011-11-22 21:50:42 +0100 |
commit | 233f0f23c75971de36d77605572c9df6b344ca73 (patch) | |
tree | 06598ad50aa97a30041d05ab9c0e8d13c797ea51 /sim.c | |
parent | 791fd3e4a946c05d6598f5054075515df6327b7d (diff) | |
download | hardware_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.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -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)); |