mirror of git://git.sysmocom.de/ofono
gril: Remove g_ril_request_setup_data_call
This commit is contained in:
parent
2dbd1ce771
commit
82f72d288b
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue