diff options
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 200 |
1 files changed, 100 insertions, 100 deletions
@@ -198,9 +198,9 @@ void ipc2ril_gprs_reg_state_resp(struct ipc_net_regist_response *netinfo, char * */ void ril_tokens_net_set_data_waiting(void) { - ril_state.tokens.registration_state = RIL_TOKEN_DATA_WAITING; - ril_state.tokens.gprs_registration_state = RIL_TOKEN_DATA_WAITING; - ril_state.tokens.operator = RIL_TOKEN_DATA_WAITING; + ril_data.tokens.registration_state = RIL_TOKEN_DATA_WAITING; + ril_data.tokens.gprs_registration_state = RIL_TOKEN_DATA_WAITING; + ril_data.tokens.operator = RIL_TOKEN_DATA_WAITING; } /** @@ -208,7 +208,7 @@ void ril_tokens_net_set_data_waiting(void) */ int ril_tokens_net_get_data_waiting(void) { - return ril_state.tokens.registration_state == RIL_TOKEN_DATA_WAITING || ril_state.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING || ril_state.tokens.operator == RIL_TOKEN_DATA_WAITING; + return ril_data.tokens.registration_state == RIL_TOKEN_DATA_WAITING || ril_data.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING || ril_data.tokens.operator == RIL_TOKEN_DATA_WAITING; } /** @@ -217,9 +217,9 @@ int ril_tokens_net_get_data_waiting(void) void ril_tokens_net_state_dump(void) { LOGD("ril_tokens_net_state_dump:\n\ - \tril_state.tokens.registration_state = 0x%p\n\ - \tril_state.tokens.gprs_registration_state = 0x%p\n\ - \tril_state.tokens.operator = 0x%p\n", ril_state.tokens.registration_state, ril_state.tokens.gprs_registration_state, ril_state.tokens.operator); + \tril_data.tokens.registration_state = %p\n\ + \tril_data.tokens.gprs_registration_state = %p\n\ + \tril_data.tokens.operator = %p\n", ril_data.tokens.registration_state, ril_data.tokens.gprs_registration_state, ril_data.tokens.operator); } void ril_plmn_split(char *plmn_data, char **plmn, unsigned int *mcc, unsigned int *mnc) @@ -326,43 +326,43 @@ void ril_request_operator(RIL_Token t) size_t i; // IPC_NET_REGISTRATION_STATE_ROAMING is the biggest valid value - if(ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE || - ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_SEARCHING || - ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_UNKNOWN || - ril_state.netinfo.reg_state > IPC_NET_REGISTRATION_STATE_ROAMING) { - RIL_onRequestComplete(t, RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW, NULL, 0); + if(ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE || + ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_SEARCHING || + ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_UNKNOWN || + ril_data.state.netinfo.reg_state > IPC_NET_REGISTRATION_STATE_ROAMING) { + ril_request_complete(t, RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW, NULL, 0); - ril_state.tokens.operator = (RIL_Token) 0x00; + ril_data.tokens.operator = (RIL_Token) 0x00; return; } - if(ril_state.tokens.operator == RIL_TOKEN_DATA_WAITING) { + if(ril_data.tokens.operator == RIL_TOKEN_DATA_WAITING) { LOGD("Got RILJ request for UNSOL data"); /* Send back the data we got UNSOL */ - ril_plmn_string(ril_state.plmndata.plmn, response); + ril_plmn_string(ril_data.state.plmndata.plmn, response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { if(response[i] != NULL) free(response[i]); } - ril_state.tokens.operator = (RIL_Token) 0x00; - } else if(ril_state.tokens.operator == (RIL_Token) 0x00) { + ril_data.tokens.operator = (RIL_Token) 0x00; + } else if(ril_data.tokens.operator == (RIL_Token) 0x00) { LOGD("Got RILJ request for SOL data"); /* Request data to the modem */ - ril_state.tokens.operator = t; + ril_data.tokens.operator = t; - ipc_fmt_send_get(IPC_NET_CURRENT_PLMN, reqGetId(t)); + ipc_fmt_send_get(IPC_NET_CURRENT_PLMN, ril_request_get_id(t)); } else { LOGE("Another request is going on, returning UNSOL data"); /* Send back the data we got UNSOL */ - ril_plmn_string(ril_state.plmndata.plmn, response); + ril_plmn_string(ril_data.state.plmndata.plmn, response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { if(response[i] != NULL) @@ -384,7 +384,7 @@ void ril_request_operator(RIL_Token t) */ void ipc_net_current_plmn(struct ipc_message_info *message) { - RIL_Token t = reqGetToken(message->aseq); + RIL_Token t = ril_request_get_token(message->aseq); struct ipc_net_current_plmn_response *plmndata = (struct ipc_net_current_plmn_response *) message->data; char *response[3]; @@ -395,28 +395,28 @@ void ipc_net_current_plmn(struct ipc_message_info *message) LOGD("Got UNSOL Operator message"); // IPC_NET_REGISTRATION_STATE_ROAMING is the biggest valid value - if(ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE || - ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_SEARCHING || - ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_UNKNOWN || - ril_state.netinfo.reg_state > IPC_NET_REGISTRATION_STATE_ROAMING) { + if(ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE || + ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_SEARCHING || + ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_UNKNOWN || + ril_data.state.netinfo.reg_state > IPC_NET_REGISTRATION_STATE_ROAMING) { /* Better keeping it up to date */ - memcpy(&(ril_state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); + memcpy(&(ril_data.state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); return; } else { - if(ril_state.tokens.operator != (RIL_Token) 0x00 && ril_state.tokens.operator != RIL_TOKEN_DATA_WAITING) { + if(ril_data.tokens.operator != (RIL_Token) 0x00 && ril_data.tokens.operator != RIL_TOKEN_DATA_WAITING) { LOGE("Another Operator Req is in progress, skipping"); return; } - memcpy(&(ril_state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); + memcpy(&(ril_data.state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); /* we already told RILJ to get the new data but it wasn't done yet */ - if(ril_tokens_net_get_data_waiting() && ril_state.tokens.operator == RIL_TOKEN_DATA_WAITING) { + if(ril_tokens_net_get_data_waiting() && ril_data.tokens.operator == RIL_TOKEN_DATA_WAITING) { LOGD("Updating Operator data in background"); } else { ril_tokens_net_set_data_waiting(); - RIL_onUnsolicitedResponse(RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED, NULL, 0); + ril_request_unsolicited(RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED, NULL, 0); } } break; @@ -424,36 +424,36 @@ void ipc_net_current_plmn(struct ipc_message_info *message) LOGD("Got SOL Operator message"); // IPC_NET_REGISTRATION_STATE_ROAMING is the biggest valid value - if(ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE || - ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_SEARCHING || - ril_state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_UNKNOWN || - ril_state.netinfo.reg_state > IPC_NET_REGISTRATION_STATE_ROAMING) { + if(ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_NONE || + ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_SEARCHING || + ril_data.state.netinfo.reg_state == IPC_NET_REGISTRATION_STATE_UNKNOWN || + ril_data.state.netinfo.reg_state > IPC_NET_REGISTRATION_STATE_ROAMING) { /* Better keeping it up to date */ - memcpy(&(ril_state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); + memcpy(&(ril_data.state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); - RIL_onRequestComplete(t, RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW, NULL, 0); + ril_request_complete(t, RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW, NULL, 0); - if(ril_state.tokens.operator != RIL_TOKEN_DATA_WAITING) - ril_state.tokens.operator = (RIL_Token) 0x00; + if(ril_data.tokens.operator != RIL_TOKEN_DATA_WAITING) + ril_data.tokens.operator = (RIL_Token) 0x00; return; } else { - if(ril_state.tokens.operator != t) + if(ril_data.tokens.operator != t) LOGE("Operator tokens mismatch"); /* Better keeping it up to date */ - memcpy(&(ril_state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); + memcpy(&(ril_data.state.plmndata), plmndata, sizeof(struct ipc_net_current_plmn_response)); ril_plmn_string(plmndata->plmn, response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { if(response[i] != NULL) free(response[i]); } - if(ril_state.tokens.operator != RIL_TOKEN_DATA_WAITING) - ril_state.tokens.operator = (RIL_Token) 0x00; + if(ril_data.tokens.operator != RIL_TOKEN_DATA_WAITING) + ril_data.tokens.operator = (RIL_Token) 0x00; } break; default: @@ -478,36 +478,36 @@ void ril_request_registration_state(RIL_Token t) char *response[4]; int i; - if(ril_state.tokens.registration_state == RIL_TOKEN_DATA_WAITING) { + if(ril_data.tokens.registration_state == RIL_TOKEN_DATA_WAITING) { LOGD("Got RILJ request for UNSOL data"); /* Send back the data we got UNSOL */ - ipc2ril_reg_state_resp(&(ril_state.netinfo), response); + ipc2ril_reg_state_resp(&(ril_data.state.netinfo), response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); - for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { + for(i = 0; i < (int) (sizeof(response) / sizeof(char *)) ; i++) { if(response[i] != NULL) free(response[i]); } - ril_state.tokens.registration_state = (RIL_Token) 0x00; - } else if(ril_state.tokens.registration_state == (RIL_Token) 0x00) { + ril_data.tokens.registration_state = (RIL_Token) 0x00; + } else if(ril_data.tokens.registration_state == (RIL_Token) 0x00) { LOGD("Got RILJ request for SOL data"); /* Request data to the modem */ - ril_state.tokens.registration_state = t; + ril_data.tokens.registration_state = t; ipc_net_regist_get_setup(®ist_req, IPC_NET_SERVICE_DOMAIN_GSM); - ipc_fmt_send(IPC_NET_REGIST, IPC_TYPE_GET, (void *)®ist_req, sizeof(struct ipc_net_regist_get), reqGetId(t)); + ipc_fmt_send(IPC_NET_REGIST, IPC_TYPE_GET, (void *)®ist_req, sizeof(struct ipc_net_regist_get), ril_request_get_id(t)); } else { LOGE("Another request is going on, returning UNSOL data"); /* Send back the data we got UNSOL */ - ipc2ril_reg_state_resp(&(ril_state.netinfo), response); + ipc2ril_reg_state_resp(&(ril_data.state.netinfo), response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); - for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { + for(i = 0; i < (int) (sizeof(response) / sizeof(char *)) ; i++) { if(response[i] != NULL) free(response[i]); } @@ -530,35 +530,35 @@ void ril_request_gprs_registration_state(RIL_Token t) char *response[4]; size_t i; - if(ril_state.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING) { + if(ril_data.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING) { LOGD("Got RILJ request for UNSOL data"); /* Send back the data we got UNSOL */ - ipc2ril_gprs_reg_state_resp(&(ril_state.gprs_netinfo), response); + ipc2ril_gprs_reg_state_resp(&(ril_data.state.gprs_netinfo), response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { if(response[i] != NULL) free(response[i]); } - ril_state.tokens.gprs_registration_state = (RIL_Token) 0x00; - } else if(ril_state.tokens.gprs_registration_state == (RIL_Token) 0x00) { + ril_data.tokens.gprs_registration_state = (RIL_Token) 0x00; + } else if(ril_data.tokens.gprs_registration_state == (RIL_Token) 0x00) { LOGD("Got RILJ request for SOL data"); /* Request data to the modem */ - ril_state.tokens.gprs_registration_state = t; + ril_data.tokens.gprs_registration_state = t; ipc_net_regist_get_setup(®ist_req, IPC_NET_SERVICE_DOMAIN_GPRS); - ipc_fmt_send(IPC_NET_REGIST, IPC_TYPE_GET, (void *)®ist_req, sizeof(struct ipc_net_regist_get), reqGetId(t)); + ipc_fmt_send(IPC_NET_REGIST, IPC_TYPE_GET, (void *)®ist_req, sizeof(struct ipc_net_regist_get), ril_request_get_id(t)); } else { LOGE("Another request is going on, returning UNSOL data"); /* Send back the data we got UNSOL */ - ipc2ril_gprs_reg_state_resp(&(ril_state.gprs_netinfo), response); + ipc2ril_gprs_reg_state_resp(&(ril_data.state.gprs_netinfo), response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { if(response[i] != NULL) @@ -578,36 +578,36 @@ void ipc_net_regist_unsol(struct ipc_message_info *message) switch(netinfo->domain) { case IPC_NET_SERVICE_DOMAIN_GSM: - if(ril_state.tokens.registration_state != (RIL_Token) 0 && ril_state.tokens.registration_state != RIL_TOKEN_DATA_WAITING) { + if(ril_data.tokens.registration_state != (RIL_Token) 0 && ril_data.tokens.registration_state != RIL_TOKEN_DATA_WAITING) { LOGE("Another NetRegist Req is in progress, skipping"); return; } - memcpy(&(ril_state.netinfo), netinfo, sizeof(struct ipc_net_regist_response)); + memcpy(&(ril_data.state.netinfo), netinfo, sizeof(struct ipc_net_regist_response)); /* we already told RILJ to get the new data but it wasn't done yet */ - if(ril_tokens_net_get_data_waiting() && ril_state.tokens.registration_state == RIL_TOKEN_DATA_WAITING) { + if(ril_tokens_net_get_data_waiting() && ril_data.tokens.registration_state == RIL_TOKEN_DATA_WAITING) { LOGD("Updating NetRegist data in background"); } else { ril_tokens_net_set_data_waiting(); - RIL_onUnsolicitedResponse(RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED, NULL, 0); + ril_request_unsolicited(RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED, NULL, 0); } break; case IPC_NET_SERVICE_DOMAIN_GPRS: - if(ril_state.tokens.gprs_registration_state != (RIL_Token) 0 && ril_state.tokens.gprs_registration_state != RIL_TOKEN_DATA_WAITING) { + if(ril_data.tokens.gprs_registration_state != (RIL_Token) 0 && ril_data.tokens.gprs_registration_state != RIL_TOKEN_DATA_WAITING) { LOGE("Another GPRS NetRegist Req is in progress, skipping"); return; } - memcpy(&(ril_state.gprs_netinfo), netinfo, sizeof(struct ipc_net_regist_response)); + memcpy(&(ril_data.state.gprs_netinfo), netinfo, sizeof(struct ipc_net_regist_response)); /* we already told RILJ to get the new data but it wasn't done yet */ - if(ril_tokens_net_get_data_waiting() && ril_state.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING) { + if(ril_tokens_net_get_data_waiting() && ril_data.tokens.gprs_registration_state == RIL_TOKEN_DATA_WAITING) { LOGD("Updating GPRSNetRegist data in background"); } else { ril_tokens_net_set_data_waiting(); - RIL_onUnsolicitedResponse(RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED, NULL, 0); + ril_request_unsolicited(RIL_UNSOL_RESPONSE_NETWORK_STATE_CHANGED, NULL, 0); } break; default: @@ -624,47 +624,47 @@ void ipc_net_regist_sol(struct ipc_message_info *message) size_t i; struct ipc_net_regist_response *netinfo = (struct ipc_net_regist_response *) message->data; - RIL_Token t = reqGetToken(message->aseq); + RIL_Token t = ril_request_get_token(message->aseq); LOGD("Got SOL NetRegist message"); switch(netinfo->domain) { case IPC_NET_SERVICE_DOMAIN_GSM: - if(ril_state.tokens.registration_state != t) + if(ril_data.tokens.registration_state != t) LOGE("Registration state tokens mismatch"); /* Better keeping it up to date */ - memcpy(&(ril_state.netinfo), netinfo, sizeof(struct ipc_net_regist_response)); + memcpy(&(ril_data.state.netinfo), netinfo, sizeof(struct ipc_net_regist_response)); ipc2ril_reg_state_resp(netinfo, response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { if(response[i] != NULL) free(response[i]); } - if(ril_state.tokens.registration_state != RIL_TOKEN_DATA_WAITING) - ril_state.tokens.registration_state = (RIL_Token) 0x00; + if(ril_data.tokens.registration_state != RIL_TOKEN_DATA_WAITING) + ril_data.tokens.registration_state = (RIL_Token) 0x00; break; case IPC_NET_SERVICE_DOMAIN_GPRS: - if(ril_state.tokens.gprs_registration_state != t) + if(ril_data.tokens.gprs_registration_state != t) LOGE("GPRS registration state tokens mismatch"); /* Better keeping it up to date */ - memcpy(&(ril_state.gprs_netinfo), netinfo, sizeof(struct ipc_net_regist_response)); + memcpy(&(ril_data.state.gprs_netinfo), netinfo, sizeof(struct ipc_net_regist_response)); ipc2ril_gprs_reg_state_resp(netinfo, response); - RIL_onRequestComplete(t, RIL_E_SUCCESS, response, sizeof(response)); + ril_request_complete(t, RIL_E_SUCCESS, response, sizeof(response)); for(i = 0; i < sizeof(response) / sizeof(char *) ; i++) { if(response[i] != NULL) free(response[i]); } - if(ril_state.tokens.registration_state != RIL_TOKEN_DATA_WAITING) - ril_state.tokens.gprs_registration_state = (RIL_Token) 0x00; + if(ril_data.tokens.registration_state != RIL_TOKEN_DATA_WAITING) + ril_data.tokens.gprs_registration_state = (RIL_Token) 0x00; break; default: LOGE("%s: unhandled service domain: %d", __FUNCTION__, netinfo->domain); @@ -681,7 +681,7 @@ void ipc_net_regist_sol(struct ipc_message_info *message) void ipc_net_regist(struct ipc_message_info *message) { /* Don't consider this if modem isn't in normal power mode. */ - if(ril_state.power_mode < POWER_MODE_NORMAL) + if(ril_data.state.power_state != IPC_PWR_PHONE_STATE_NORMAL) return; switch(message->type) { @@ -705,7 +705,7 @@ void ipc_net_regist(struct ipc_message_info *message) */ void ril_request_query_available_networks(RIL_Token t) { - ipc_fmt_send_get(IPC_NET_PLMN_LIST, reqGetId(t)); + ipc_fmt_send_get(IPC_NET_PLMN_LIST, ril_request_get_id(t)); } /* FIXME: cleanup struct names & resp[] addressing */ @@ -756,7 +756,7 @@ void ipc_net_plmn_list(struct ipc_message_info *info) resp_ptr += 4; } - RIL_onRequestComplete(reqGetToken(info->aseq), RIL_E_SUCCESS, resp, (4 * sizeof(char*) * actual_size)); + ril_request_complete(ril_request_get_token(info->aseq), RIL_E_SUCCESS, resp, (4 * sizeof(char*) * actual_size)); /* FIXME: free individual strings */ free(resp); @@ -764,7 +764,7 @@ void ipc_net_plmn_list(struct ipc_message_info *info) void ril_request_get_preferred_network_type(RIL_Token t) { - ipc_fmt_send_get(IPC_NET_MODE_SEL, reqGetId(t)); + ipc_fmt_send_get(IPC_NET_MODE_SEL, ril_request_get_id(t)); } void ril_request_set_preferred_network_type(RIL_Token t, void *data, size_t datalen) @@ -774,9 +774,9 @@ void ril_request_set_preferred_network_type(RIL_Token t, void *data, size_t data mode_sel.mode_sel = ril2ipc_mode_sel(ril_mode); - ipc_gen_phone_res_expect_to_complete(reqGetId(t), IPC_NET_MODE_SEL); + ipc_gen_phone_res_expect_to_complete(ril_request_get_id(t), IPC_NET_MODE_SEL); - ipc_fmt_send(IPC_NET_MODE_SEL, IPC_TYPE_SET, &mode_sel, sizeof(mode_sel), reqGetId(t)); + ipc_fmt_send(IPC_NET_MODE_SEL, IPC_TYPE_SET, (void *) &mode_sel, sizeof(mode_sel), ril_request_get_id(t)); } void ipc_net_mode_sel(struct ipc_message_info *info) @@ -784,13 +784,13 @@ void ipc_net_mode_sel(struct ipc_message_info *info) struct ipc_net_mode_sel *mode_sel = (struct ipc_net_mode_sel *) info->data; int ril_mode = ipc2ril_mode_sel(mode_sel->mode_sel); - RIL_onRequestComplete(reqGetToken(info->aseq), RIL_E_SUCCESS, &ril_mode, sizeof(int)); + ril_request_complete(ril_request_get_token(info->aseq), RIL_E_SUCCESS, &ril_mode, sizeof(int)); } void ril_request_query_network_selection_mode(RIL_Token t) { - ipc_fmt_send_get(IPC_NET_PLMN_SEL, reqGetId(t)); + ipc_fmt_send_get(IPC_NET_PLMN_SEL, ril_request_get_id(t)); } void ipc_net_plmn_sel(struct ipc_message_info *info) @@ -806,7 +806,7 @@ void ipc_net_plmn_sel(struct ipc_message_info *info) plmn_sel = (struct ipc_net_plmn_sel_get *) info->data; ril_mode = ipc2ril_plmn_sel(plmn_sel->plmn_sel); - RIL_onRequestComplete(reqGetToken(info->aseq), + ril_request_complete(ril_request_get_token(info->aseq), RIL_E_SUCCESS, &ril_mode, sizeof(int)); } @@ -819,15 +819,15 @@ void ipc_net_plmn_sel_complete(struct ipc_message_info *info) if(rc < 0) { if((phone_res->code & 0x00ff) == 0x6f) { LOGE("Not authorized to register to this network!"); - RIL_onRequestComplete(reqGetToken(info->aseq), RIL_E_ILLEGAL_SIM_OR_ME, NULL, 0); + ril_request_complete(ril_request_get_token(info->aseq), RIL_E_ILLEGAL_SIM_OR_ME, NULL, 0); } else { LOGE("There was an error during operator selection!"); - RIL_onRequestComplete(reqGetToken(info->aseq), RIL_E_GENERIC_FAILURE, NULL, 0); + ril_request_complete(ril_request_get_token(info->aseq), RIL_E_GENERIC_FAILURE, NULL, 0); } return; } - RIL_onRequestComplete(reqGetToken(info->aseq), RIL_E_SUCCESS, NULL, 0); + ril_request_complete(ril_request_get_token(info->aseq), RIL_E_SUCCESS, NULL, 0); } void ril_request_set_network_selection_automatic(RIL_Token t) @@ -836,9 +836,9 @@ void ril_request_set_network_selection_automatic(RIL_Token t) ipc_net_plmn_sel_set_setup(&plmn_sel, IPC_NET_PLMN_SEL_AUTO, NULL, IPC_NET_ACCESS_TECHNOLOGY_UNKNOWN); - ipc_gen_phone_res_expect_to_func(reqGetId(t), IPC_NET_PLMN_SEL, ipc_net_plmn_sel_complete); + ipc_gen_phone_res_expect_to_func(ril_request_get_id(t), IPC_NET_PLMN_SEL, ipc_net_plmn_sel_complete); - ipc_fmt_send(IPC_NET_PLMN_SEL, IPC_TYPE_SET, &plmn_sel, sizeof(plmn_sel), reqGetId(t)); + ipc_fmt_send(IPC_NET_PLMN_SEL, IPC_TYPE_SET, (void *) &plmn_sel, sizeof(plmn_sel), ril_request_get_id(t)); } void ril_request_set_network_selection_manual(RIL_Token t, void *data, size_t datalen) @@ -848,7 +848,7 @@ void ril_request_set_network_selection_manual(RIL_Token t, void *data, size_t da // FIXME: We always assume UMTS capability ipc_net_plmn_sel_set_setup(&plmn_sel, IPC_NET_PLMN_SEL_MANUAL, data, IPC_NET_ACCESS_TECHNOLOGY_UMTS); - ipc_gen_phone_res_expect_to_func(reqGetId(t), IPC_NET_PLMN_SEL, ipc_net_plmn_sel_complete); + ipc_gen_phone_res_expect_to_func(ril_request_get_id(t), IPC_NET_PLMN_SEL, ipc_net_plmn_sel_complete); - ipc_fmt_send(IPC_NET_PLMN_SEL, IPC_TYPE_SET, &plmn_sel, sizeof(plmn_sel), reqGetId(t)); + ipc_fmt_send(IPC_NET_PLMN_SEL, IPC_TYPE_SET, (void *) &plmn_sel, sizeof(plmn_sel), ril_request_get_id(t)); } |