From 82f72d288bb5689343b3718b72d42399edabe8f9 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 30 Nov 2015 17:41:57 -0600 Subject: gril: Remove g_ril_request_setup_data_call --- gril/grilrequest.c | 134 ----------------------------------------------------- gril/grilrequest.h | 16 ------- 2 files changed, 150 deletions(-) diff --git a/gril/grilrequest.c b/gril/grilrequest.c index efe93f90..76355dea 100644 --- a/gril/grilrequest.c +++ b/gril/grilrequest.c @@ -41,15 +41,6 @@ #include "util.h" #include "common.h" -/* SETUP_DATA_CALL_PARAMS request parameters */ -#define SETUP_DATA_CALL_PARAMS 7 -#define DATA_PROFILE_DEFAULT_STR "0" -#define DATA_PROFILE_TETHERED_STR "1" -#define DATA_PROFILE_IMS_STR "2" -#define DATA_PROFILE_FOTA_STR "3" -#define DATA_PROFILE_CBS_STR "4" -#define DATA_PROFILE_OEM_BASE_STR "1000" -#define DATA_PROFILE_MTK_MMS_STR "1001" /* SETUP_DATA_CALL_PARAMS reply parameters */ #define MIN_DATA_CALL_REPLY_SIZE 36 @@ -67,131 +58,6 @@ error->error = 0; \ } while (0) -gboolean g_ril_request_setup_data_call(GRil *gril, - const struct req_setup_data_call *req, - struct parcel *rilp, - struct ofono_error *error) -{ - const gchar *protocol_str; - gchar *tech_str; - gchar *auth_str; - gchar *profile_str; - int num_param = SETUP_DATA_CALL_PARAMS; - - DBG(""); - - if (g_ril_vendor(gril) == OFONO_RIL_VENDOR_MTK) - num_param = SETUP_DATA_CALL_PARAMS + 1; - - /* - * Radio technology to use: 0-CDMA, 1-GSM/UMTS, 2... - * values > 2 are (RADIO_TECH + 2) - */ - if (req->tech < 1 || req->tech > (RADIO_TECH_GSM + 2)) { - ofono_error("%s: Invalid tech value: %d", - __func__, - req->tech); - goto error; - } - - /* - * TODO(OEM): This code doesn't currently support - * OEM data profiles. If a use case exist, then - * this code will need to be modified. - */ - switch (req->data_profile) { - case RIL_DATA_PROFILE_DEFAULT: - profile_str = DATA_PROFILE_DEFAULT_STR; - break; - case RIL_DATA_PROFILE_TETHERED: - profile_str = DATA_PROFILE_TETHERED_STR; - break; - case RIL_DATA_PROFILE_IMS: - profile_str = DATA_PROFILE_IMS_STR; - break; - case RIL_DATA_PROFILE_FOTA: - profile_str = DATA_PROFILE_FOTA_STR; - break; - case RIL_DATA_PROFILE_CBS: - profile_str = DATA_PROFILE_CBS_STR; - break; - case RIL_DATA_PROFILE_MTK_MMS: - if (g_ril_vendor(gril) == OFONO_RIL_VENDOR_MTK) { - profile_str = DATA_PROFILE_MTK_MMS_STR; - break; - } - default: - ofono_error("%s, invalid data_profile value: %d", - __func__, - req->data_profile); - goto error; - } - - if (req->apn == NULL) - goto error; - - if (req->auth_type > RIL_AUTH_BOTH) { - ofono_error("%s: Invalid auth type: %d", - __func__, - req->auth_type); - goto error; - } - - protocol_str = ril_ofono_protocol_to_ril_string(req->protocol); - if (protocol_str == NULL) { - ofono_error("%s: Invalid protocol: %d", - __func__, - req->protocol); - goto error; - } - - parcel_init(rilp); - - parcel_w_int32(rilp, num_param); - - tech_str = g_strdup_printf("%d", req->tech); - parcel_w_string(rilp, tech_str); - parcel_w_string(rilp, profile_str); - parcel_w_string(rilp, req->apn); - parcel_w_string(rilp, req->username); - parcel_w_string(rilp, req->password); - - auth_str = g_strdup_printf("%d", req->auth_type); - parcel_w_string(rilp, auth_str); - parcel_w_string(rilp, protocol_str); - - g_ril_append_print_buf(gril, - "(%s,%s,%s,%s,%s,%s,%s", - tech_str, - profile_str, - req->apn, - req->username, - req->password, - auth_str, - protocol_str); - - if (g_ril_vendor(gril) == OFONO_RIL_VENDOR_MTK) { - /* MTK request_cid parameter */ - char cid_str[MAX_CID_DIGITS + 1]; - - snprintf(cid_str, sizeof(cid_str), "%u", req->req_cid); - parcel_w_string(rilp, cid_str); - g_ril_append_print_buf(gril, "%s,%s", print_buf, cid_str); - } - - g_ril_append_print_buf(gril, "%s)", print_buf); - - g_free(tech_str); - g_free(auth_str); - - OFONO_NO_ERROR(error); - return TRUE; - -error: - OFONO_EINVAL(error); - return FALSE; -} - void g_ril_request_oem_hook_raw(GRil *gril, const void *payload, size_t length, struct parcel *rilp) { diff --git a/gril/grilrequest.h b/gril/grilrequest.h index 87dc4acc..8bd7fb4b 100644 --- a/gril/grilrequest.h +++ b/gril/grilrequest.h @@ -34,22 +34,6 @@ extern "C" { #endif -struct req_setup_data_call { - guint tech; - guint data_profile; - gchar *apn; - gchar *username; - gchar *password; - guint auth_type; - guint protocol; - unsigned req_cid; -}; - -gboolean g_ril_request_setup_data_call(GRil *gril, - const struct req_setup_data_call *req, - struct parcel *rilp, - struct ofono_error *error); - void g_ril_request_oem_hook_raw(GRil *gril, const void *payload, size_t length, struct parcel *rilp); -- cgit v1.2.3