Changes of Revision 120
[-] [+] | Changed | _service:tar_git:ofono.changes |
[-] [+] | Changed | _service:tar_git:ofono.spec ^ |
[-] [+] | Changed | _service ^ |
@@ -2,6 +2,6 @@ <service name="tar_git"> <param name="url">https://git.monich.net/git/ofono.git</param> <param name="branch">master</param> - <param name="revision">40ec15a3</param> + <param name="revision">25c11d66</param> </service> </services> \ No newline at end of file | ||
[-] [+] | Deleted | _service:tar_git:ofono-1.26+git1.tar.bz2/ofono/doc/sim900-modem.txt ^ |
@@ -1,12 +0,0 @@ -SIM900 modem usage -=================== - -To enable SIM900 module support you need to put the following -udev rule into appropriate file in /{etc,lib}/udev/rules.d: - -KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900" - -On the i-Tetra tracking device, the SIM900 is accessed -via N_GSM mux device. We use ofono as SMS message -service and incoming voice calls service, so we -use /dev/gsmtty1 provided by N_GSM mux. | ||
[-] [+] | Deleted | _service:tar_git:ofono-1.26+git1.tar.bz2/upstream/doc/sim900-modem.txt ^ |
@@ -1,12 +0,0 @@ -SIM900 modem usage -=================== - -To enable SIM900 module support you need to put the following -udev rule into appropriate file in /{etc,lib}/udev/rules.d: - -KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900" - -On the i-Tetra tracking device, the SIM900 is accessed -via N_GSM mux device. We use ofono as SMS message -service and incoming voice calls service, so we -use /dev/gsmtty1 provided by N_GSM mux. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/ChangeLog ^ |
@@ -1,3 +1,8 @@ +ver 1.27: + Add support for handling SIMCom based SIM800 modems. + Add support for SIM lock state with xmm7xxx modems. + Add support for coexistence feature with xmm7xxx modems. + ver 1.26: Fix issue with AT callback handler and GPRS. Fix issue with handling EUTRAN SMS only states. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/configure.ac ^ |
@@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(ofono, 1.26) +AC_INIT(ofono, 1.27) AM_INIT_AUTOMAKE([foreign subdir-objects color-tests]) AC_CONFIG_HEADERS(config.h) | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/doc/intel-lte-coex-api.txt ^ |
@@ -0,0 +1,137 @@ +LTE Coexistence hierarchy +========================= + +Service org.ofono +Interface org.ofono.intel.LteCoexistence +Object path [variable prefix]/{modem0,modem1,...} + +Methods dict GetProperties() + + Returns all coexistence configuration properties. + + void SetProperty(string property, variant value) + + Changes the value of the specified property. Only + properties that are listed as Read-write are changeable. + On success a PropertyChanged signal will be emitted. + + Possible Errors: [service].Error.InProgress + [service].Error.InvalidArguments + [service].Error.Failed + + void RegisterAgent(object path) + + Registers an agent which will be called whenever the + modem initiates LTE Coexistence information. + + Possible Errors: [service].Error.InProgress + [service].Error.InvalidArguments + [service].Error.InvalidFormat + [service].Error.Failed + + void UnregisterAgent(object path) + + Unregisters an agent. + + Possible Errors: [service].Error.InvalidArguments + [service].Error.Failed + + a(a{sv}) GetPlmnHistory() + Requests for LTE Plmn history list stored in NVM to + retrieve geo location history like MobileNetworkCode, + MobileCountryCode, LteBandsFDD, LteBandsTDD, + ChannelBandwidth. + + Refer to the sections below for which property types + are available, their valid value ranges and + applicability to different cell types. + +Signals PropertyChanged(string property, variant value) + + This signal indicates a changed value of the given + property. + +Properties string Band [readwrite] + + Frequency band in which the modem is operating when + using "lte" mode. + + boolean BTActive [readwrite] + + Contains whether BT Coex is activated or not. + + boolean WLANActive [readwrite] + + Contains whether WLAN Coex is activated or not. + + string WLANBandwidth [readwrite] + + Contains the frequency WLAN Coex is activated on, when + "CoexWLANActive" is active. + + The possible values are: + - "20MHz" + - "40MHz" + - "80MHz" + +LTECoexistenceAgent Hierarchy [experimental] +============================= + +Service unique name +Interface org.ofono.intel.LteCoexistenceAgent +Object path freely definable + +Methods void ReceiveBluetoothNotification(array{byte} notification, + dict info) [noreply] + + Requests the agent to process Bluetooth related LTE + Coexistence information. The dictionary info contains + vector table with modem recommended Safe Tx/Rx band and + range information.The properties involved are + 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and + 'SafeVector'. + + Possible Errors: None + + void ReceiveWiFiNotification(array{byte} notification, + dict info) [noreply] + + Requests the agent to process WiFi related LTE + Coexistence information. The dictionary info contains + vector table with modem recommended SafeTx/Rx band and + range information. The properties involved are + 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and + 'SafeVector'. + + Possible Errors: None + + void Release() [noreply] + + Agent is being released, possibly because of oFono + terminating, Coex interface is being torn down or modem + off. No UnregisterAgent call is needed. + +LTE Plmn history params +======================= +uint16 MobileNetworkCode [readonly, optional] + + Contains the MNC of the cell. + +uint16 MobileCountryCode [readonly, optional] + + Contains the MCC of the cell. + +uint32 LteBandsFDD [readonly, optional] + + Contains the Lte FDD band. Valid range of values is 1 to 32 as per + 3GPP 36.101 Section 5.5. + +uint32 LteBandsTDD [readonly, optional] + + Contains the Lte TDD band. Valid range of values is 33 to 64 as per + 3GPP 36.101 Section 5.5. + +byte ChannelBandwidth [readonly, optional] + + Contains the Channel bandwidth. Valid range of values is 0 to 6 as per + 3GPP 36.101 Section 5.6. | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/doc/simcom-modem.txt ^ |
@@ -0,0 +1,22 @@ +SIM900 modem usage +=================== + +To enable SIM900 module support you need to put the following +udev rule into appropriate file in /{etc,lib}/udev/rules.d: + +KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900" + +On the i-Tetra tracking device, the SIM900 is accessed +via N_GSM mux device. We use ofono as SMS message +service and incoming voice calls service, so we +use /dev/gsmtty1 provided by N_GSM mux. + +SIM800 modem usage +================== + +When using sim800 modem, the udev rule is the same as the +sim900 rule : + +KERNEL=="ttyS3", ENV{OFONO_DRIVER}="sim900" + +Because the SIM800 and SIM900 code are the merged into one driver. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/drivers/qmimodem/gprs-context.c ^ |
@@ -88,6 +88,7 @@ char* straddr; char* apn; const char *dns[3] = { NULL, NULL, NULL }; + char dns_buf[2][INET_ADDRSTRLEN]; DBG(""); @@ -131,14 +132,14 @@ if (qmi_result_get_uint32(result, QMI_WDS_RESULT_PRIMARY_DNS, &ip_addr)) { addr.s_addr = htonl(ip_addr); - dns[0] = inet_ntoa(addr); + dns[0] = inet_ntop(AF_INET, &addr, dns_buf[0], sizeof(dns_buf[0])); DBG("Primary DNS: %s", dns[0]); } if (qmi_result_get_uint32(result, QMI_WDS_RESULT_SECONDARY_DNS, &ip_addr)) { addr.s_addr = htonl(ip_addr); - dns[1] = inet_ntoa(addr); + dns[1] = inet_ntop(AF_INET, &addr, dns_buf[1], sizeof(dns_buf[1])); DBG("Secondary DNS: %s", dns[1]); } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/include/netreg.h ^ |
@@ -3,7 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2008-2011 Intel Corporation. All rights reserved. - * Copyright (C) 2015-2021 Jolla Ltd. + * Copyright (C) 2015-2022 Jolla Ltd. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -32,7 +32,7 @@ struct ofono_modem; struct ofono_netreg; -enum ofono_netreg_status { +enum ofono_netreg_status { /* Since mer/1.24+git2 */ OFONO_NETREG_STATUS_NONE = -1, /* 27.007 Section 7.2 <stat> */ OFONO_NETREG_STATUS_NOT_REGISTERED = 0, @@ -41,9 +41,10 @@ OFONO_NETREG_STATUS_DENIED = 3, OFONO_NETREG_STATUS_UNKNOWN = 4, OFONO_NETREG_STATUS_ROAMING = 5, - OFONO_NETREG_STATUS_REGISTERED_SMS_EUTRAN = 6, - OFONO_NETREG_STATUS_ROAMING_SMS_EUTRAN = 7, -}; /* Since mer/1.24+git2 */ + /* Since mer/1.26+git1 */ + OFONO_NETREG_STATUS_REGISTERED_SMS_EUTRAN = 6, + OFONO_NETREG_STATUS_ROAMING_SMS_EUTRAN = 7 +}; /* 27.007 Section 7.3 <stat> */ enum ofono_operator_status { | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/plugins/sim900.c ^ |
@@ -24,6 +24,7 @@ #endif #include <errno.h> +#include <string.h> #include <stdlib.h> #include <glib.h> #include <gatchat.h> @@ -60,13 +61,66 @@ static const char *none_prefix[] = { NULL }; +enum type { + SIMCOM_UNKNOWN, + SIM800, + SIM900, +}; + struct sim900_data { GIOChannel *device; GAtMux *mux; GAtChat * dlcs[NUM_DLC]; guint frame_size; + enum type modem_type; }; +static void mux_ready_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_modem *modem = user_data; + struct sim900_data *data = ofono_modem_get_data(modem); + struct ofono_gprs *gprs = NULL; + struct ofono_gprs_context *gc; + + ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem", + data->dlcs[SMS_DLC]); + + gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]); + if (gprs == NULL) + return; + + gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM, + "atmodem", data->dlcs[GPRS_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); +} + +static void check_model(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct ofono_modem *modem = user_data; + GAtResultIter iter; + char const *model; + struct sim900_data *data = ofono_modem_get_data(modem); + + DBG(""); + + g_at_result_iter_init(&iter, result); + + while (g_at_result_iter_next(&iter, NULL)) { + if (!g_at_result_iter_next_unquoted_string(&iter, &model)) + continue; + + DBG("setting type %s", model); + + if (strstr(model, "SIM800")) + data->modem_type = SIM800; + else if (strstr(model, "SIM900")) + data->modem_type = SIM800; + else + data->modem_type = SIMCOM_UNKNOWN; + } +} + static int sim900_probe(struct ofono_modem *modem) { struct sim900_data *data; @@ -233,6 +287,14 @@ } } + if (data->modem_type == SIM800) { + for (i = 0; i<NUM_DLC; i++) { + g_at_chat_register(data->dlcs[i], "SMS Ready", + mux_ready_notify, FALSE, + modem, NULL); + } + } + ofono_modem_set_powered(modem, TRUE); return; @@ -294,6 +356,8 @@ return -EINVAL; g_at_chat_send(data->dlcs[SETUP_DLC], "ATE0", NULL, NULL, NULL, NULL); + g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CGMM", NULL, + check_model, modem, NULL); /* For obtain correct sms service number */ g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CSCS=\"GSM\"", NULL, @@ -353,18 +417,24 @@ DBG("%p", modem); - ofono_phonebook_create(modem, 0, "atmodem", data->dlcs[VOICE_DLC]); - ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem", + if (data->modem_type == SIM900) { + ofono_phonebook_create(modem, 0, "atmodem", + data->dlcs[VOICE_DLC]); + ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem", data->dlcs[SMS_DLC]); - gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]); - if (gprs == NULL) - return; - - gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM_SIM900, - "atmodem", data->dlcs[GPRS_DLC]); - if (gc) - ofono_gprs_add_context(gprs, gc); + gprs = ofono_gprs_create(modem, 0, "atmodem", + data->dlcs[GPRS_DLC]); + if (gprs == NULL) + return; + + gc = ofono_gprs_context_create(modem, + OFONO_VENDOR_SIMCOM_SIM900, + "atmodem", + data->dlcs[GPRS_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); + } } static void sim900_post_online(struct ofono_modem *modem) | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/plugins/xmm7xxx.c ^ |
@@ -57,16 +57,904 @@ #include <drivers/atmodem/atutil.h> #include <drivers/atmodem/vendor.h> +#include "ofono.h" +#include "gdbus.h" + +#define OFONO_COEX_INTERFACE OFONO_SERVICE ".intel.LteCoexistence" +#define OFONO_COEX_AGENT_INTERFACE OFONO_SERVICE ".intel.LteCoexistenceAgent" + +#define NET_BAND_LTE_INVALID 0 +#define NET_BAND_LTE_1 101 +#define NET_BAND_LTE_43 143 +#define BAND_LEN 20 +#define MAX_BT_SAFE_VECTOR 15 +#define MAX_WL_SAFE_VECTOR 13 + static const char *none_prefix[] = { NULL }; static const char *xsimstate_prefix[] = { "+XSIMSTATE:", NULL }; +static const char *xnvmplmn_prefix[] = { "+XNVMPLMN:", NULL }; + +struct bt_coex_info { + int safe_tx_min; + int safe_tx_max; + int safe_rx_min; + int safe_rx_max; + int safe_vector[MAX_BT_SAFE_VECTOR]; + int num_safe_vector; +}; + +struct wl_coex_info { + int safe_tx_min; + int safe_tx_max; + int safe_rx_min; + int safe_rx_max; + int safe_vector[MAX_BT_SAFE_VECTOR]; + int num_safe_vector; +}; + +struct coex_agent { + char *path; + char *bus; + guint disconnect_watch; + ofono_bool_t remove_on_terminate; + ofono_destroy_func removed_cb; + void *removed_data; + DBusMessage *msg; +}; struct xmm7xxx_data { GAtChat *chat; /* AT chat */ struct ofono_sim *sim; ofono_bool_t have_sim; ofono_bool_t sms_phonebook_added; + unsigned int netreg_watch; +}; + +/* Coex Implementation */ +enum wlan_bw { + WLAN_BW_UNSUPPORTED = -1, + WLAN_BW_20MHZ = 0, + WLAN_BW_40MHZ = 1, + WLAN_BW_80MHZ = 2, +}; + +struct plmn_hist { + unsigned short mnc; + unsigned short mcc; + unsigned long tdd; + unsigned long fdd; + unsigned char bw; +}; + +struct xmm7xxx_coex { + GAtChat *chat; + struct ofono_modem *modem; + + DBusMessage *pending; + ofono_bool_t bt_active; + ofono_bool_t wlan_active; + enum wlan_bw wlan_bw; + char *lte_band; + + ofono_bool_t pending_bt_active; + ofono_bool_t pending_wlan_active; + enum wlan_bw pending_wlan_bw; + + struct coex_agent *session_agent; +}; + +static ofono_bool_t coex_agent_matches(struct coex_agent *agent, + const char *path, const char *sender) +{ + return !strcmp(agent->path, path) && !strcmp(agent->bus, sender); +} + +static void coex_agent_set_removed_notify(struct coex_agent *agent, + ofono_destroy_func destroy, + void *user_data) +{ + agent->removed_cb = destroy; + agent->removed_data = user_data; +} + +static void coex_agent_send_noreply(struct coex_agent *agent, + const char *method) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + DBusMessage *message; + + message = dbus_message_new_method_call(agent->bus, agent->path, + OFONO_COEX_INTERFACE, + method); + if (message == NULL) + return; + + dbus_message_set_no_reply(message, TRUE); + g_dbus_send_message(conn, message); +} + +static void coex_agent_send_release(struct coex_agent *agent) +{ + coex_agent_send_noreply(agent, "Release"); +} + +static void coex_agent_free(struct coex_agent *agent) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + + if (agent->disconnect_watch) { + coex_agent_send_release(agent); + + g_dbus_remove_watch(conn, agent->disconnect_watch); + agent->disconnect_watch = 0; + } + + if (agent->removed_cb) + agent->removed_cb(agent->removed_data); + + g_free(agent->path); + g_free(agent->bus); + g_free(agent); +} + +static void coex_agent_disconnect_cb(DBusConnection *conn, void *user_data) +{ + struct coex_agent *agent = user_data; + + ofono_debug("Agent exited without calling Unregister"); + + agent->disconnect_watch = 0; + + coex_agent_free(agent); +} + +static struct coex_agent *coex_agent_new(const char *path, const char *sender, + ofono_bool_t remove_on_terminate) +{ + struct coex_agent *agent = g_try_new0(struct coex_agent, 1); + DBusConnection *conn = ofono_dbus_get_connection(); + + DBG(""); + if (agent == NULL) + return NULL; + + agent->path = g_strdup(path); + agent->bus = g_strdup(sender); + + agent->remove_on_terminate = remove_on_terminate; + + agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender, + coex_agent_disconnect_cb, + agent, NULL); + + return agent; +} + +static int coex_agent_coex_wlan_notify(struct coex_agent *agent, + const struct wl_coex_info wlan_info) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + DBusMessageIter wl_args, wl_dict, wl_array; + const dbus_int32_t *pwl_array = wlan_info.safe_vector; + dbus_int32_t value; + + agent->msg = dbus_message_new_method_call(agent->bus, agent->path, + OFONO_COEX_AGENT_INTERFACE, + "ReceiveWiFiNotification"); + if (agent->msg == NULL) + return -ENOMEM; + + dbus_message_iter_init_append(agent->msg, &wl_args); + + dbus_message_iter_open_container(&wl_args, DBUS_TYPE_ARRAY, + DBUS_TYPE_INT32_AS_STRING, &wl_array); + dbus_message_iter_append_fixed_array(&wl_array, DBUS_TYPE_INT32, + &pwl_array, MAX_WL_SAFE_VECTOR); + + dbus_message_iter_close_container(&wl_args, &wl_array); + + dbus_message_iter_open_container(&wl_args, DBUS_TYPE_ARRAY, + "{sv}", &wl_dict); + + value = wlan_info.safe_tx_min; + ofono_dbus_dict_append(&wl_dict, "SafeTxMin", DBUS_TYPE_UINT32, &value); + value = wlan_info.safe_tx_max; + ofono_dbus_dict_append(&wl_dict, "SafeTxMax", DBUS_TYPE_UINT32, &value); + value = wlan_info.safe_rx_min; + ofono_dbus_dict_append(&wl_dict, "SafeRxMin", DBUS_TYPE_UINT32, &value); + value = wlan_info.safe_rx_max; + ofono_dbus_dict_append(&wl_dict, "SafeRxMax", DBUS_TYPE_UINT32, &value); + value = wlan_info.num_safe_vector; + ofono_dbus_dict_append(&wl_dict, "NumSafeVector", + DBUS_TYPE_UINT32, &value); + + dbus_message_iter_close_container(&wl_args, &wl_dict); + dbus_message_set_no_reply(agent->msg, TRUE); + + if (dbus_connection_send(conn, agent->msg, NULL) == FALSE) + return -EIO; + + dbus_message_unref(agent->msg); + + return 0; +} + +static int coex_agent_coex_bt_notify(struct coex_agent *agent, + const struct bt_coex_info bt_info) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + DBusMessageIter bt_args, bt_dict, bt_array; + const dbus_int32_t *pbt_array = bt_info.safe_vector; + int len = MAX_BT_SAFE_VECTOR; + dbus_int32_t value; + + agent->msg = dbus_message_new_method_call(agent->bus, agent->path, + OFONO_COEX_AGENT_INTERFACE, + "ReceiveBTNotification"); + + if (agent->msg == NULL) + return -ENOMEM; + + pbt_array = bt_info.safe_vector; + + dbus_message_iter_init_append(agent->msg, &bt_args); + + dbus_message_iter_open_container(&bt_args, DBUS_TYPE_ARRAY, + DBUS_TYPE_INT32_AS_STRING, &bt_array); + + dbus_message_iter_append_fixed_array(&bt_array, DBUS_TYPE_INT32, + &pbt_array, len); + + dbus_message_iter_close_container(&bt_args, &bt_array); + + dbus_message_iter_open_container(&bt_args, + DBUS_TYPE_ARRAY, "{sv}", &bt_dict); + + value = bt_info.safe_tx_min; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeTxMin", DBUS_TYPE_UINT32, &value); + + value = bt_info.safe_tx_max; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeTxMax", DBUS_TYPE_UINT32, &value); + + value = bt_info.safe_rx_min; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeRxMin", DBUS_TYPE_UINT32, &value); + + value = bt_info.safe_rx_max; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeRxMax", DBUS_TYPE_UINT32, &value); + + value = bt_info.num_safe_vector; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "NumSafeVector", + DBUS_TYPE_UINT32, &value); + + dbus_message_iter_close_container(&bt_args, &bt_dict); + + if (dbus_connection_send(conn, agent->msg, NULL) == FALSE) + return -EIO; + + dbus_message_unref(agent->msg); + + return 0; +} + +static gboolean coex_wlan_bw_from_string(const char *str, + enum wlan_bw *band) +{ + if (g_str_equal(str, "20")) { + *band = WLAN_BW_20MHZ; + return TRUE; + } else if (g_str_equal(str, "40")) { + *band = WLAN_BW_40MHZ; + return TRUE; + } else if (g_str_equal(str, "80")) { + *band = WLAN_BW_80MHZ; + return TRUE; + } else + *band = WLAN_BW_UNSUPPORTED; + + return FALSE; +} + +static const char *wlan_bw_to_string(int band) +{ + switch (band) { + case WLAN_BW_20MHZ: + return "20MHz"; + case WLAN_BW_40MHZ: + return "40MHz"; + case WLAN_BW_80MHZ: + return "80MHz"; + case WLAN_BW_UNSUPPORTED: + return "UnSupported"; + } + + return ""; +} + +static void xmm_get_band_string(int lte_band, char *band) +{ + int band_lte; + + band_lte = lte_band - NET_BAND_LTE_1 + 1; + + if (lte_band >= NET_BAND_LTE_1 && lte_band <= NET_BAND_LTE_43) + sprintf(band, "BAND_LTE_%d", band_lte); + else + sprintf(band, "INVALID"); +} + +static DBusMessage *coex_get_properties(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + DBusMessage *reply; + DBusMessageIter iter; + DBusMessageIter dict; + dbus_bool_t value; + const char *band = NULL; + + reply = dbus_message_new_method_return(msg); + if (reply == NULL) + return NULL; + + dbus_message_iter_init_append(reply, &iter); + + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, + OFONO_PROPERTIES_ARRAY_SIGNATURE, + &dict); + + value = coex->bt_active; + ofono_dbus_dict_append(&dict, "BTActive", + DBUS_TYPE_BOOLEAN, &value); + + value = coex->wlan_active; + ofono_dbus_dict_append(&dict, "WLANActive", + DBUS_TYPE_BOOLEAN, &value); + + band = wlan_bw_to_string(coex->wlan_bw); + ofono_dbus_dict_append(&dict, "WLANBandwidth", + DBUS_TYPE_STRING, &band); + + band = coex->lte_band; + ofono_dbus_dict_append(&dict, "Band", DBUS_TYPE_STRING, &band); + + dbus_message_iter_close_container(&iter, &dict); + + return reply; +} + +static void coex_set_params_cb(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + DBusMessage *reply; + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(coex->modem); + + DBG("ok %d", ok); + + if (!ok) { + coex->pending_bt_active = coex->bt_active; + coex->pending_wlan_active = coex->wlan_active; + coex->pending_wlan_bw = coex->wlan_bw; + reply = __ofono_error_failed(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); + return; + } + + reply = dbus_message_new_method_return(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); + + if (coex->bt_active != coex->pending_bt_active) { + coex->bt_active = coex->pending_bt_active; + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, "BTActive", + DBUS_TYPE_BOOLEAN, &coex->bt_active); + } + + if (coex->wlan_active != coex->pending_wlan_active) { + coex->wlan_active = coex->pending_wlan_active; + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, "WLANActive", + DBUS_TYPE_BOOLEAN, &coex->wlan_active); + } + + if (coex->wlan_bw != coex->pending_wlan_bw) { + const char *str_band = wlan_bw_to_string(coex->wlan_bw); + + coex->wlan_bw = coex->pending_wlan_bw; + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, "WLANBandwidth", + DBUS_TYPE_STRING, &str_band); + } +} + +static void coex_set_params(struct xmm7xxx_coex *coex, ofono_bool_t bt_active, + ofono_bool_t wlan_active, int wlan_bw) +{ + char buf[64]; + DBusMessage *reply; + + DBG(""); + sprintf(buf, "AT+XNRTCWS=65535,%u,%u,%u", (int)wlan_active, + wlan_bw, bt_active); + + if (g_at_chat_send(coex->chat, buf, none_prefix, + coex_set_params_cb, coex, NULL) > 0) + return; + + coex->pending_bt_active = coex->bt_active; + coex->pending_wlan_active = coex->wlan_active; + coex->pending_wlan_bw = coex->wlan_bw; + reply = __ofono_error_failed(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); +} + +static DBusMessage *coex_set_property(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + DBusMessageIter iter; + DBusMessageIter var; + const char *property; + dbus_bool_t value; + + if (coex->pending) + return __ofono_error_busy(msg); + + if (!dbus_message_iter_init(msg, &iter)) + return __ofono_error_invalid_args(msg); + + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&iter, &property); + dbus_message_iter_next(&iter); + + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_recurse(&iter, &var); + + if (!strcmp(property, "BTActive")) { + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&var, &value); + + if (coex->bt_active == (ofono_bool_t) value) + return dbus_message_new_method_return(msg); + + coex->pending_bt_active = value; + coex->pending = dbus_message_ref(msg); + + coex_set_params(coex, value, coex->wlan_active, coex->wlan_bw); + return NULL; + } else if (!strcmp(property, "WLANActive")) { + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&var, &value); + + if (coex->wlan_active == (ofono_bool_t) value) + return dbus_message_new_method_return(msg); + + coex->pending_wlan_active = value; + coex->pending = dbus_message_ref(msg); + + coex_set_params(coex, coex->bt_active, value, coex->wlan_bw); + return NULL; + } else if (g_strcmp0(property, "WLANBandwidth") == 0) { + const char *value; + enum wlan_bw band; + + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_STRING) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&var, &value); + if (coex_wlan_bw_from_string(value, &band) == FALSE) + return __ofono_error_invalid_args(msg); + + if (coex->wlan_bw == band) + return dbus_message_new_method_return(msg); + + coex->pending_wlan_bw = band; + coex->pending = dbus_message_ref(msg); + + coex_set_params(coex, coex->bt_active, coex->wlan_active, band); + return NULL; + } else { + return __ofono_error_invalid_args(msg); + } + + return dbus_message_new_method_return(msg); +} + +static void coex_default_agent_notify(gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + + g_at_chat_send(coex->chat, "AT+XNRTCWS=0", none_prefix, + NULL, NULL, NULL); + + coex->session_agent = NULL; +} + +static DBusMessage *coex_register_agent(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + const char *agent_path; + + if (coex->session_agent) { + DBG("Coexistence agent already registered"); + return __ofono_error_busy(msg); + } + + if (dbus_message_get_args(msg, NULL, + DBUS_TYPE_OBJECT_PATH, &agent_path, + DBUS_TYPE_INVALID) == FALSE) + return __ofono_error_invalid_args(msg); + + if (!dbus_validate_path(agent_path, NULL)) + return __ofono_error_invalid_format(msg); + + coex->session_agent = coex_agent_new(agent_path, + dbus_message_get_sender(msg), + FALSE); + + if (coex->session_agent == NULL) + return __ofono_error_failed(msg); + + coex_agent_set_removed_notify(coex->session_agent, + coex_default_agent_notify, coex); + + return dbus_message_new_method_return(msg); +} + +static DBusMessage *coex_unregister_agent(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + const char *agent_path; + const char *agent_bus = dbus_message_get_sender(msg); + + if (dbus_message_get_args(msg, NULL, + DBUS_TYPE_OBJECT_PATH, &agent_path, + DBUS_TYPE_INVALID) == FALSE) + return __ofono_error_invalid_args(msg); + + if (coex->session_agent == NULL) + return __ofono_error_failed(msg); + + if (!coex_agent_matches(coex->session_agent, agent_path, agent_bus)) + return __ofono_error_failed(msg); + + coex_agent_send_release(coex->session_agent); + coex_agent_free(coex->session_agent); + + g_at_chat_send(coex->chat, "AT+XNRTCWS=0", none_prefix, + NULL, NULL, NULL); + + return dbus_message_new_method_return(msg); +} + +static void append_plmn_properties(struct plmn_hist *list, + DBusMessageIter *dict) +{ + ofono_dbus_dict_append(dict, "MobileCountryCode", + DBUS_TYPE_UINT16, &list->mcc); + ofono_dbus_dict_append(dict, "MobileNetworkCode", + DBUS_TYPE_UINT16, &list->mnc); + ofono_dbus_dict_append(dict, "LteBandsFDD", + DBUS_TYPE_UINT32, &list->fdd); + ofono_dbus_dict_append(dict, "LteBandsTDD", + DBUS_TYPE_UINT32, &list->tdd); + ofono_dbus_dict_append(dict, "ChannelBandwidth", + DBUS_TYPE_UINT32, &list->bw); +} + +static void append_plmn_history_struct_list(struct plmn_hist *list, + DBusMessageIter *arr) +{ + DBusMessageIter iter; + DBusMessageIter dict; + + dbus_message_iter_open_container(arr, DBUS_TYPE_STRUCT, NULL, &iter); + + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, + OFONO_PROPERTIES_ARRAY_SIGNATURE, + &dict); + + append_plmn_properties(list, &dict); + + dbus_message_iter_close_container(&iter, &dict); + + dbus_message_iter_close_container(arr, &iter); +} + +static void coex_get_plmn_history_cb(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + struct plmn_hist *list = NULL; + GAtResultIter iter; + int list_size = 0, count; + DBusMessage *reply; + DBusMessageIter itr, arr; + int value; + + DBG("ok %d", ok); + + if (!ok) { + __ofono_dbus_pending_reply(&coex->pending, + __ofono_error_failed(coex->pending)); + return; + } + + g_at_result_iter_init(&iter, result); + + while (g_at_result_iter_next(&iter, "+XNVMPLMN:")) { + if (!list_size) + list = g_new0(struct plmn_hist, ++list_size); + else + list = g_renew(struct plmn_hist, list, ++list_size); + + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].mcc = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].mnc = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].fdd = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].tdd = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].bw = value; + + DBG("list_size = %d", list_size); + } + + reply = dbus_message_new_method_return(coex->pending); + dbus_message_iter_init_append(reply, &itr); + + dbus_message_iter_open_container(&itr, DBUS_TYPE_ARRAY, + DBUS_STRUCT_BEGIN_CHAR_AS_STRING + DBUS_TYPE_ARRAY_AS_STRING + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING + DBUS_STRUCT_END_CHAR_AS_STRING, + &arr); + + for (count = 0; count < list_size; count++) + append_plmn_history_struct_list(list, &arr); + + dbus_message_iter_close_container(&itr, &arr); + + reply = dbus_message_new_method_return(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); + + g_free(list); +} + +static DBusMessage *coex_get_plmn_history(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + + if (coex->pending) + return __ofono_error_busy(msg); + + if (!g_at_chat_send(coex->chat, "AT+XNVMPLMN=2,2", xnvmplmn_prefix, + coex_get_plmn_history_cb, coex, NULL)) + return __ofono_error_failed(msg); + + coex->pending = dbus_message_ref(msg); + return NULL; +} + +static const GDBusMethodTable coex_methods[] = { + { GDBUS_METHOD("GetProperties", + NULL, GDBUS_ARGS({ "properties", "a{sv}" }), + coex_get_properties) }, + { GDBUS_METHOD("SetProperty", + GDBUS_ARGS({ "property", "s" }, { "value", "v" }), + NULL, coex_set_property) }, + { GDBUS_METHOD("RegisterAgent", + GDBUS_ARGS({ "path", "o" }), NULL, + coex_register_agent) }, + { GDBUS_METHOD("UnregisterAgent", + GDBUS_ARGS({ "path", "o" }), NULL, + coex_unregister_agent) }, + { GDBUS_ASYNC_METHOD("GetPlmnHistory", + NULL, GDBUS_ARGS({ "plmnhistory", "a(a{sv})" }), + coex_get_plmn_history) }, + { } }; +static const GDBusSignalTable coex_signals[] = { + { GDBUS_SIGNAL("PropertyChanged", + GDBUS_ARGS({ "name", "s" }, { "value", "v" })) }, + { } +}; + +static void xmm_coex_w_notify(GAtResult *result, gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + GAtResultIter iter; + int count; + struct wl_coex_info wlan; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+XNRTCWSW:")) + return; + + g_at_result_iter_next_number(&iter, &wlan.safe_rx_min); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.safe_rx_max); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.safe_tx_min); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.safe_tx_max); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.num_safe_vector); + + for (count = 0; count < wlan.num_safe_vector; count++) + g_at_result_iter_next_number(&iter, &wlan.safe_vector[count]); + + DBG("WLAN notification"); + + if (coex->session_agent) + coex_agent_coex_wlan_notify(coex->session_agent, wlan); +} + +static void xmm_coex_b_notify(GAtResult *result, gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + GAtResultIter iter; + struct bt_coex_info bt; + int count; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+XNRTCWSB:")) + return; + + g_at_result_iter_next_number(&iter, &bt.safe_rx_min); + g_at_result_iter_next_number(&iter, &bt.safe_rx_max); + g_at_result_iter_next_number(&iter, &bt.safe_tx_min); + g_at_result_iter_next_number(&iter, &bt.safe_tx_max); + g_at_result_iter_next_number(&iter, &bt.num_safe_vector); + + for (count = 0; count < bt.num_safe_vector; count++) + g_at_result_iter_next_number(&iter, &bt.safe_vector[count]); + + DBG("BT notification"); + + if (coex->session_agent) + coex_agent_coex_bt_notify(coex->session_agent, bt); +} + +static void xmm_lte_band_notify(GAtResult *result, gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + GAtResultIter iter; + int lte_band; + char band[BAND_LEN]; + const char *path = ofono_modem_get_path(coex->modem); + DBusConnection *conn = ofono_dbus_get_connection(); + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+XCCINFO:")) + return; + + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + + if (!g_at_result_iter_next_number(&iter, <e_band)) + return; + + xmm_get_band_string(lte_band, band); + DBG("band %s", band); + + if (!strcmp(band, coex->lte_band)) + return; + + g_free(coex->lte_band); + coex->lte_band = g_strdup(band); + + if (coex->lte_band == NULL) + return; + + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, + "Band", DBUS_TYPE_STRING, &coex->lte_band); +} + +static void coex_cleanup(void *data) +{ + struct xmm7xxx_coex *coex = data; + + if (coex->pending) + __ofono_dbus_pending_reply(&coex->pending, + __ofono_error_canceled(coex->pending)); + + if (coex->session_agent) { + coex_agent_free(coex->session_agent); + + g_at_chat_send(coex->chat, "AT+XNRTCWS=0", none_prefix, + NULL, NULL, NULL); + } + + g_free(coex->lte_band); + g_free(coex); +} + +static int xmm_coex_enable(struct ofono_modem *modem, void *data) +{ + struct xmm7xxx_coex *coex = g_new0(struct xmm7xxx_coex, 1); + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + + DBG("coex enable"); + + coex->chat = data; + coex->modem = modem; + coex->bt_active = 0; + coex->wlan_active = 0; + coex->wlan_bw = WLAN_BW_20MHZ; + coex->lte_band = g_strdup("INVALID"); + coex->session_agent = NULL; + + if (!g_at_chat_send(coex->chat, "AT+XCCINFO=1", none_prefix, + NULL, NULL, NULL)) + goto out; + + if (!g_at_chat_send(coex->chat, "AT+XNRTCWS=7", none_prefix, + NULL, NULL, NULL)) + goto out; + + if (!g_dbus_register_interface(conn, path, OFONO_COEX_INTERFACE, + coex_methods, + coex_signals, + NULL, coex, coex_cleanup)) { + ofono_error("Could not register %s interface under %s", + OFONO_COEX_INTERFACE, path); + goto out; + } + + ofono_modem_add_interface(modem, OFONO_COEX_INTERFACE); + + g_at_chat_register(coex->chat, "+XNRTCWSW:", xmm_coex_w_notify, + FALSE, coex, NULL); + g_at_chat_register(coex->chat, "+XNRTCWSB:", xmm_coex_b_notify, + FALSE, coex, NULL); + g_at_chat_register(coex->chat, "+XCCINFO:", xmm_lte_band_notify, + FALSE, coex, NULL); + return 0; + +out: + g_free(coex->lte_band); + g_free(coex); + return -EIO; +} + +/* Coex Implementation Ends*/ + static void xmm7xxx_debug(const char *str, void *user_data) { const char *prefix = user_data; @@ -129,6 +1017,12 @@ data->sms_phonebook_added = FALSE; } break; + case 1: /* SIM inserted, PIN verification needed */ + if (data->have_sim == FALSE) { + ofono_sim_inserted_notify(data->sim, TRUE); + data->have_sim = TRUE; + } + break; case 2: /* SIM inserted, PIN verification not needed - READY */ case 3: /* SIM inserted, PIN verified - READY */ case 7: /* SIM inserted, SMS and phonebook - READY */ @@ -236,6 +1130,29 @@ xsimstate_query_cb, modem, NULL); } +static void netreg_watch(struct ofono_atom *atom, + enum ofono_atom_watch_condition cond, + void *data) +{ + struct ofono_modem *modem = data; + struct xmm7xxx_data *modem_data = ofono_modem_get_data(modem); + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + + if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) { + if (g_dbus_unregister_interface(conn, path, + OFONO_COEX_INTERFACE)) + ofono_modem_remove_interface(modem, + OFONO_COEX_INTERFACE); + return; + } + + if (cond == OFONO_ATOM_WATCH_CONDITION_REGISTERED) { + xmm_coex_enable(modem, modem_data->chat); + return; + } +} + static int xmm7xxx_enable(struct ofono_modem *modem) { struct xmm7xxx_data *data = ofono_modem_get_data(modem); @@ -257,6 +1174,10 @@ g_at_chat_send(data->chat, "AT+CFUN=4", none_prefix, cfun_enable_cb, modem, NULL); + data->netreg_watch = __ofono_modem_add_atom_watch(modem, + OFONO_ATOM_TYPE_NETREG, + netreg_watch, modem, NULL); + return -EINPROGRESS; } @@ -287,6 +1208,11 @@ g_at_chat_send(data->chat, "AT+CFUN=0", none_prefix, cfun_disable_cb, modem, NULL); + if (data->netreg_watch) { + __ofono_modem_remove_atom_watch(modem, data->netreg_watch); + data->netreg_watch = 0; + } + return -EINPROGRESS; } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/src/ofono.conf ^ |
@@ -29,6 +29,7 @@ <allow send_interface="org.ofono.HandsfreeAudioAgent"/> <allow send_interface="org.ofono.VoiceCallAgent"/> <allow send_interface="org.ofono.NetworkMonitorAgent"/> + <allow send_interface="org.ofono.intel.LteCoexistenceAgent"/> </policy> <policy at_console="true"> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/ofono/test/change-pin ^ |
@@ -10,7 +10,7 @@ pin_type = sys.argv[2] old_pin = sys.argv[3] new_pin = sys.argv[4] -elif len(sys.argv) == 3: +elif len(sys.argv) == 4: manager = dbus.Interface(bus.get_object('org.ofono', '/'), 'org.ofono.Manager') modems = manager.GetModems() | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/.gitignore ^ |
@@ -22,8 +22,7 @@ missing stamp-h1 autom4te.cache -test-driver -test-suite.log +ell ofono.pc include/ofono @@ -48,9 +47,11 @@ unit/test-rilmodem-cs unit/test-rilmodem-gprs unit/test-rilmodem-sms +unit/test-mbim unit/test-*.log unit/test-*.trs -unit/test-mbim +test-driver +test-suite.log tools/huawei-audio tools/auto-enable | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/AUTHORS ^ |
@@ -137,3 +137,5 @@ Florent Beillonnet <florent.beillonnet@gmail.com> Martin Hundebøll <martin@geanix.com> Julien Tournier <tournier.julien@gmail.com> +Nandini Rebello <nandini.rebello@intel.com> +Giacinto Cifelli <gciofono@gmail.com> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/ChangeLog ^ |
@@ -1,3 +1,21 @@ +ver 1.27: + Add support for handling SIMCom based SIM800 modems. + Add support for SIM lock state with xmm7xxx modems. + Add support for coexistence feature with xmm7xxx modems. + +ver 1.26: + Fix issue with AT callback handler and GPRS. + Fix issue with handling EUTRAN SMS only states. + Fix issue with handling MBIM strings on big endian. + Fix issue with missing char and SMS national language. + Fix issue with unsolicited notifications of +CGAUTH/+CGDCONT. + Add support for setting "none" authentication method. + Add support for SMS and phonebook with xmm7xxx modems. + Add support for voice features and Gemalto modems. + Add support for Bengali and Gujrati SMS alphabets. + Add support for 8 additional languages for GSM 7 bit + Add support for using internal Embedded Linux library. + ver 1.25: Fix issue with handling GPRS context release. Fix issue with GPRS context shutdown and Huawei modems. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/Makefile.am ^ |
@@ -3,6 +3,56 @@ noinst_LTLIBRARIES = +if EXTERNAL_ELL +ell_cflags = @ELL_CFLAGS@ +ell_ldadd = @ELL_LIBS@ +ell_dependencies = +ell_built_sources = +else +ell_cflags = +ell_ldadd = ell/libell-internal.la +ell_dependencies = $(ell_ldadd) +ell_built_sources = ell/internal ell/ell.h + +noinst_LTLIBRARIES += ell/libell-internal.la + +ell_headers = ell/util.h \ + ell/test.h \ + ell/strv.h \ + ell/utf8.h \ + ell/queue.h \ + ell/main.h \ + ell/idle.h \ + ell/signal.h \ + ell/timeout.h \ + ell/io.h \ + ell/log.h \ + ell/checksum.h \ + ell/random.h \ + ell/uuid.h \ + ell/file.h + +ell_sources = ell/private.h \ + ell/missing.h \ + ell/util.c \ + ell/test.c \ + ell/strv.c \ + ell/utf8.c \ + ell/queue.c \ + ell/main.c \ + ell/idle.c \ + ell/signal.c \ + ell/timeout.c \ + ell/io.c \ + ell/log.c \ + ell/checksum.c \ + ell/random.c \ + ell/uuid.c \ + ell/file.c + +ell_libell_internal_la_SOURCES = $(ell_headers) $(ell_sources) +endif + pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \ include/dbus.h include/modem.h include/types.h \ include/call-barring.h include/call-forwarding.h \ @@ -243,6 +293,32 @@ builtin_sources += plugins/gobi.c endif +if MBIMMODEM +mbim_sources = drivers/mbimmodem/mbim.h \ + drivers/mbimmodem/mbim.c \ + drivers/mbimmodem/mbim-private.h \ + drivers/mbimmodem/mbim-desc.h \ + drivers/mbimmodem/mbim-desc.c \ + drivers/mbimmodem/mbim-message.h \ + drivers/mbimmodem/mbim-message.c + +builtin_modules += mbimmodem +builtin_sources += $(mbim_sources) \ + drivers/mbimmodem/util.h \ + drivers/mbimmodem/util.c \ + drivers/mbimmodem/mbimmodem.h \ + drivers/mbimmodem/mbimmodem.c \ + drivers/mbimmodem/devinfo.c \ + drivers/mbimmodem/sim.c \ + drivers/mbimmodem/network-registration.c \ + drivers/mbimmodem/sms.c \ + drivers/mbimmodem/gprs.c \ + drivers/mbimmodem/gprs-context.c + +builtin_modules += mbim +builtin_sources += plugins/mbim.c +endif + if ATMODEM builtin_modules += atmodem builtin_sources += drivers/atmodem/atmodem.h \ @@ -397,14 +473,16 @@ builtin_sources += drivers/atmodem/atutil.h \ drivers/gemaltomodem/gemaltomodem.h \ drivers/gemaltomodem/gemaltomodem.c \ - drivers/gemaltomodem/location-reporting.c + drivers/gemaltomodem/location-reporting.c \ + drivers/gemaltomodem/voicecall.c builtin_modules += xmm7modem builtin_sources += drivers/atmodem/atutil.h \ drivers/xmm7modem/xmm7modem.h \ drivers/xmm7modem/xmm7modem.c \ drivers/xmm7modem/radio-settings.c \ - drivers/xmm7modem/ims.c + drivers/xmm7modem/ims.c \ + drivers/xmm7modem/netmon.c if PHONESIM builtin_modules += phonesim @@ -608,36 +686,6 @@ builtin_modules += allowed_apns builtin_sources += plugins/allowed-apns.c -if ELL -builtin_cflags += @ELL_CFLAGS@ -builtin_libadd += @ELL_LIBS@ - -if MBIMMODEM -mbim_sources = drivers/mbimmodem/mbim.h \ - drivers/mbimmodem/mbim.c \ - drivers/mbimmodem/mbim-desc.h \ - drivers/mbimmodem/mbim-desc.c \ - drivers/mbimmodem/mbim-message.h \ - drivers/mbimmodem/mbim-message.c - -builtin_modules += mbimmodem -builtin_sources += $(mbim_sources) \ - drivers/mbimmodem/util.h \ - drivers/mbimmodem/util.c \ - drivers/mbimmodem/mbimmodem.h \ - drivers/mbimmodem/mbimmodem.c \ - drivers/mbimmodem/devinfo.c \ - drivers/mbimmodem/sim.c \ - drivers/mbimmodem/network-registration.c \ - drivers/mbimmodem/sms.c \ - drivers/mbimmodem/gprs.c \ - drivers/mbimmodem/gprs-context.c - -builtin_modules += mbim -builtin_sources += plugins/mbim.c -endif -endif - sbin_PROGRAMS = src/ofonod src_ofonod_SOURCES = $(builtin_sources) $(gatchat_sources) src/ofono.ver \ @@ -669,13 +717,15 @@ src/netmon.c src/lte.c src/ims.c \ src/netmonagent.c src/netmonagent.h -src_ofonod_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \ +src_ofonod_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) $(ell_ldadd) \ @GLIB_LIBS@ @DBUS_LIBS@ -ldl src_ofonod_LDFLAGS = -Wl,--export-dynamic \ -Wl,--version-script=$(srcdir)/src/ofono.ver -BUILT_SOURCES = $(local_headers) src/builtin.h +src_ofonod_DEPENDENCIES = $(ell_dependencies) + +BUILT_SOURCES = $(local_headers) $(ell_built_sources) src/builtin.h CLEANFILES = $(BUILT_SOURCES) $(rules_DATA) @@ -687,7 +737,7 @@ build_plugindir = $(plugindir) endif -AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(builtin_cflags) \ +AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(ell_cflags) $(builtin_cflags) \ -DOFONO_PLUGIN_BUILTIN \ -DPLUGINDIR=\""$(build_plugindir)"\" @@ -825,7 +875,8 @@ test/test-serving-cell-info \ test/ims-register \ test/ims-unregister \ - test/list-applications + test/list-applications \ + test/set-sms-alphabet if TEST @@ -844,18 +895,12 @@ unit_tests = unit/test-common unit/test-util unit/test-idmap \ unit/test-simutil unit/test-stkutil \ unit/test-sms unit/test-cdmasms \ + unit/test-mbim \ unit/test-rilmodem-cs \ unit/test-rilmodem-sms \ unit/test-rilmodem-cb \ unit/test-rilmodem-gprs -if ELL -if MBIMMODEM -unit_tests += unit/test-mbim -endif -endif - - noinst_PROGRAMS = $(unit_tests) \ unit/test-sms-root unit/test-mux unit/test-caif @@ -946,7 +991,7 @@ unit_test_mbim_SOURCES = unit/test-mbim.c \ drivers/mbimmodem/mbim-message.c \ drivers/mbimmodem/mbim.c -unit_test_mbim_LDADD = @ELL_LIBS@ +unit_test_mbim_LDADD = $(ell_ldadd) unit_objects += $(unit_test_mbim_OBJECTS) TESTS = $(unit_tests) @@ -1047,5 +1092,22 @@ $(AM_V_at)$(MKDIR_P) include/ofono $(AM_V_GEN)$(LN_S) $< $@ +ell/internal: Makefile + $(AM_V_at)$(MKDIR_P) ell + $(AM_V_GEN)for f in $(ell_headers) $(ell_sources) ; do \ + if [ ! -f $$f ] ; then \ + $(LN_S) -t ell -f $(abs_srcdir)/../ell/$$f ; \ + fi \ + done > $@ + +ell/ell.h: Makefile + $(AM_V_at)echo -n > $@ + $(AM_V_GEN)for f in $(ell_headers) ; do \ + echo "#include <$$f>" >> $@ ; \ + done + +maintainer-clean-local: + -rm -rf ell + clean-local: @$(RM) -rf include/ofono | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/README ^ |
@@ -22,12 +22,42 @@ make && make install +Embedded Linux library +====================== + +In order to compile the daemon and utilities the development version of +Embedded Linux library is required to be present. The development +repositories can be found here: + + git://git.kernel.org/pub/scm/libs/ell/ell.git + https://kernel.googlesource.com/pub/scm/libs/ell/ell.git + +The build systems requires that the Embedded Linux library source code +is available on the same top level directory as the source code: + + . + |--- ell + | |--- ell + | `--- unit + `--- ofono + |--- src + `--- tools + +It is not required to build or install Embedded Linux library. The build +will happen when building the Wireless daemon and it will then be linked +internally. + +When using --enable-external-ell build option, it is not required that the +Embedded Linux library source code is available in the top level directory. + + Kernel Dependencies =================== In order to have the PPP stack working in oFono you need to enable CONFIG_TUN (Universal TUN/TAP device driver support) in your kernel .config. + Information =========== | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/configure.ac ^ |
@@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT(ofono, 1.25) +AC_INIT(ofono, 1.27) AM_INIT_AUTOMAKE([foreign subdir-objects color-tests]) AC_CONFIG_HEADERS(config.h) @@ -160,6 +160,11 @@ [enable_qmimodem=${enableval}]) AM_CONDITIONAL(QMIMODEM, test "${enable_qmimodem}" != "no") +AC_ARG_ENABLE(mbimmodem, AC_HELP_STRING([--disable-mbimmodem], + [disable MBIM modem support]), + [enable_mbimmodem=${enableval}]) +AM_CONDITIONAL(MBIMMODEM, test "${enable_mbimmodem}" != "no") + AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth], [disable BlueZ 4 and BlueZ 5 plugins support]), [enable_bluetooth=${enableval}]) @@ -207,24 +212,16 @@ [enable_upower=${enableval}]) AM_CONDITIONAL(UPOWER, test "${enable_power}" != "no") -AC_ARG_ENABLE(mbimmodem, AC_HELP_STRING([--enable-mbimmodem], - [enable MBIM based modem support]), - [enable_mbimmodem=${enableval}]) - -AC_ARG_ENABLE(ell, AC_HELP_STRING([--enable-ell], - [enable support for ell]), - [enable_ell=${enableval}]) - -if (test "${enable_ell}" = "yes"); then - AC_DEFINE(HAVE_ELL, 1, [Defined if Ell is enabled]) - PKG_CHECK_MODULES(ELL, ell >= 0.2, dummy=yes, - AC_MSG_ERROR(ell library >= 0.2 is required)) +AC_ARG_ENABLE([external_ell], AC_HELP_STRING([--enable-external-ell], + [enable external Embedded Linux library]), + [enable_external_ell=${enableval}]) +if (test "${enable_external_ell}" = "yes"); then + PKG_CHECK_MODULES(ELL, ell >= 0.12, dummy=yes, + AC_MSG_ERROR(Embedded Linux library >= 0.12 is required)) AC_SUBST(ELL_CFLAGS) AC_SUBST(ELL_LIBS) fi - -AM_CONDITIONAL(MBIMMODEM, test "${enable_ell}" != "no" && test "${enable_mbimmodem}" = "yes") -AM_CONDITIONAL(ELL, test "${enable_ell}" != "no") +AM_CONDITIONAL(EXTERNAL_ELL, test "${enable_external_ell}" = "yes") AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles], [do not install configuration and data files]), | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/common-patterns.txt ^ |
@@ -0,0 +1,164 @@ +Every project has its own recursive patterns, and oFono is not an exception. +This document describes the most common ones found in the code. + +Typical flow for atom <-> atom driver operations +================================================ +Most of the time, the core atom for a given request calls a function in +the atom driver, which generally executes some commands against the modem, +and can then return the results to the core. + +For example: + +dbus call: lte/SetProperty(DefaultAPN) + | + v +core: check APN validity, call the modem atom for execution in the modem + | + v +atom driver: schedules 'AT+CGDCONT=0,"IP","MyNiceAPN"' for execution + | +[ break in the flow: the functions return back to the core, the dbus request ] +[ is not answered at this time ] + ... +[GLibMain event loop schedules the command, it is sent to the modem and the ] +[ modem's reply is obtained ] + | + v +atom driver: a callback function, optionally provided when AT command was +scheduled is now called + | + v +core: atom driver core callback function is now called. This was passed from +the core as an argument, earlier, when the atom driver operation was invoked, +along with some context data (opaque info for the atom driver containing core +atom owned data) + | + v +the core can now answer the dbus message + + +In the code, it looks like this: + +//core call: +static DBusMessage *lte_set_property(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct ofono_lte *lte = data; + + /* + * a block of code here processes the msg and fills the + * lte->pending_info structure + */ + + lte->driver->set_default_attach_info(lte, <e->pending_info, + lte_set_default_attach_info_cb, lte); + + return NULL; +} +// lte_set_default_attach_info_cb is the core callback function, +// the lte structure is the parameter that it takes + +//atom: +static void at_lte_set_default_attach_info(const struct ofono_lte *lte, + const struct ofono_lte_default_attach_info *info, + ofono_lte_cb_t cb, void *data) +{ + struct lte_driver_data *ldd = ofono_lte_get_data(lte); + + // next line creates a structure for the in-atom callback + struct cb_data *cbd = cb_data_new(cb, data); + + if (g_at_chat_send(ldd->chat, "AT", NULL, + at_lte_set_default_attach_info_cb, + cbd, g_free) > 0) + return; + + g_free(cbd); + CALLBACK_WITH_FAILURE(cb, data); +} +// here the structure is allocate dynamically, and since it is quite common, +// the function g_at_chat_send accepts the last 3 parameters: +// - in-atom callback function +// - in-atom callback data +// - destroy function for dynamically-allocated callback data +// NOTE: if g_at_chat_send fails, it does not free the memory, so it must be +// done after the call. +// Note also the callback to the core directly here if the g_at_chat_send fails. + +//atom callback: + +static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct cb_data *cbd = user_data; + + if (result == NULL) { + CALLBACK_WITH_FAILURE(cbd->cb, cbd->data); + return; + } + + decode_at_error(&error, g_at_result_final_response(result)); + cbd->cb(&error, cbd->data); +} +// note that here cbd must not be released, it will be done by the GAtChat +// after invoking the callback (at_lte_set_default_attach_info_cb) +// note also that the core function will be executed before cbd is released, +// so the last line of the code is ok. + + +Use of the cb_data in AT command based atom drivers +=================================================== + +the cb_data can be used by creating the structure with cb_data_new, +and then there are two possibilities: +- use it in a single callback function, and destroy it with a call to + g_free. + Example: + - calling function: + struct cb_data *cbd = cb_data_new(cb, data); + if (g_at_chat_send(chat, buf, NULL, at_cgatt_cb, cbd, g_free) > 0) + return; + g_free(cbd); + - called function (here at_cgatt_cb): + static void at_cgatt_cb(gboolean ok, GAtResult *result, + gpointer user_data) + { + struct cb_data *cbd = user_data; + ofono_gprs_cb_t cb = cbd->cb; + struct ofono_error error; + + decode_at_error(&error, + g_at_result_final_response(result)); + + cb(&error, cbd->data); + } + note the absence of explicit g_free(cbd); + +- pass it through a train of callback functions, adding a reference at + each pass cb_data_ref, and removing it with cb_data_unref. + the use of cb_data_ref would replace a new object creation, while the + use of cb_data_unref the use of g_free. + Example: + - calling function: + struct cb_data *cbd = cb_data_new(cb, data); + // no cb_ref at the creation + if (g_at_chat_send(chat, buf, NULL, + at_lte_set_default_attach_info_cb, + cbd, cb_data_unref) > 0) + goto end; + cb_data_unref(cbd); + - called function 1 (at_lte_set_default_attach_info_cb): + static void at_lte_set_default_attach_info_cb(gboolean ok, + GAtResult *result, gpointer user_data) + { + struct cb_data *cbd = user_data; + + cbd = cb_data_ref(cbd); + if (g_at_chat_send(chat, buf, NULL, + at_cgatt_cb, cbd, cb_data_unref) > 0) + return; + cb_data_unref(cbd); + } + - called function 2 (at_cgatt_cb): + like above. no call to g_free or cb_data_unref. The terminal function + doesn't need to know about the reference scheme. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/connman-api.txt ^ |
@@ -192,7 +192,8 @@ string AuthenticationMethod [readwrite] Holds the PPP authentication method to use. Valid - values are "pap" and "chap". Defaults to "chap". + values are "pap", "chap" and "none". + Defaults to "chap". string Username [readwrite] | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/intel-lte-coex-api.txt ^ |
@@ -0,0 +1,137 @@ +LTE Coexistence hierarchy +========================= + +Service org.ofono +Interface org.ofono.intel.LteCoexistence +Object path [variable prefix]/{modem0,modem1,...} + +Methods dict GetProperties() + + Returns all coexistence configuration properties. + + void SetProperty(string property, variant value) + + Changes the value of the specified property. Only + properties that are listed as Read-write are changeable. + On success a PropertyChanged signal will be emitted. + + Possible Errors: [service].Error.InProgress + [service].Error.InvalidArguments + [service].Error.Failed + + void RegisterAgent(object path) + + Registers an agent which will be called whenever the + modem initiates LTE Coexistence information. + + Possible Errors: [service].Error.InProgress + [service].Error.InvalidArguments + [service].Error.InvalidFormat + [service].Error.Failed + + void UnregisterAgent(object path) + + Unregisters an agent. + + Possible Errors: [service].Error.InvalidArguments + [service].Error.Failed + + a(a{sv}) GetPlmnHistory() + Requests for LTE Plmn history list stored in NVM to + retrieve geo location history like MobileNetworkCode, + MobileCountryCode, LteBandsFDD, LteBandsTDD, + ChannelBandwidth. + + Refer to the sections below for which property types + are available, their valid value ranges and + applicability to different cell types. + +Signals PropertyChanged(string property, variant value) + + This signal indicates a changed value of the given + property. + +Properties string Band [readwrite] + + Frequency band in which the modem is operating when + using "lte" mode. + + boolean BTActive [readwrite] + + Contains whether BT Coex is activated or not. + + boolean WLANActive [readwrite] + + Contains whether WLAN Coex is activated or not. + + string WLANBandwidth [readwrite] + + Contains the frequency WLAN Coex is activated on, when + "CoexWLANActive" is active. + + The possible values are: + - "20MHz" + - "40MHz" + - "80MHz" + +LTECoexistenceAgent Hierarchy [experimental] +============================= + +Service unique name +Interface org.ofono.intel.LteCoexistenceAgent +Object path freely definable + +Methods void ReceiveBluetoothNotification(array{byte} notification, + dict info) [noreply] + + Requests the agent to process Bluetooth related LTE + Coexistence information. The dictionary info contains + vector table with modem recommended Safe Tx/Rx band and + range information.The properties involved are + 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and + 'SafeVector'. + + Possible Errors: None + + void ReceiveWiFiNotification(array{byte} notification, + dict info) [noreply] + + Requests the agent to process WiFi related LTE + Coexistence information. The dictionary info contains + vector table with modem recommended SafeTx/Rx band and + range information. The properties involved are + 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and + 'SafeVector'. + + Possible Errors: None + + void Release() [noreply] + + Agent is being released, possibly because of oFono + terminating, Coex interface is being torn down or modem + off. No UnregisterAgent call is needed. + +LTE Plmn history params +======================= +uint16 MobileNetworkCode [readonly, optional] + + Contains the MNC of the cell. + +uint16 MobileCountryCode [readonly, optional] + + Contains the MCC of the cell. + +uint32 LteBandsFDD [readonly, optional] + + Contains the Lte FDD band. Valid range of values is 1 to 32 as per + 3GPP 36.101 Section 5.5. + +uint32 LteBandsTDD [readonly, optional] + + Contains the Lte TDD band. Valid range of values is 33 to 64 as per + 3GPP 36.101 Section 5.5. + +byte ChannelBandwidth [readonly, optional] + + Contains the Channel bandwidth. Valid range of values is 0 to 6 as per + 3GPP 36.101 Section 5.6. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/lte-api.txt ^ |
@@ -33,3 +33,39 @@ Setting this property to an empty string clears the default APN from the modem. + + string Protocol [readwrite, experimental] + + Holds the protocol for this context. Valid values + are: "ip", "ipv6" and "dual". Default value is "ip". + + string AuthenticationMethod [readwrite, experimental] + + Sets the Method used for the authentication + for the default APN. + + Available values are "none", "pap" and "chap". + Default is "none". + + If the AuthenticationMethod is set to 'none', + no authentication is performed for the default attach + APN. Username and Password properties are ignored, + even if containing a valid value. If Username or + Password are empty, AuthenticationMethod is implicitly + assumed to be set to 'none'. + + If the default APN supports authentication and it + fails, then it is up to the network how to proceed. + In general LTE access is denied and the modem can + fallback to a legacy technology if capable and another + radio technology is available. + + string Username [readwrite, experimental] + + Holds the username to be used for authentication + purposes. + + string Password [readwrite, experimental] + + Holds the password to be used for authentication + purposes. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/messagemanager-api.txt ^ |
@@ -104,6 +104,16 @@ "turkish" - Turkish alphabet "spanish" - Spanish alphabet "portuguese" - Portuguese alphabet + "bengali" - Bengali alphabet + "gujarati" - Gujarati alphabet + "hindi" - Hindi alphabet + "kannada" - Kannada alphabet + "malayalam" - Malayalam alphabet + "oriya" - Oriya alphabet + "punjabi"- Punjabi alphabet + "tamil" - Tamil alphabet + "telugu" - Telugu alphabet + "urdu" - Urdu alphabet The standard, language-specific alphabets are defined in 3GPP TS23.038, Annex A. By default, oFono uses | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/network-api.txt ^ |
@@ -77,7 +77,9 @@ string Status [readonly] - The current registration status of a modem. + The current registration status of a modem. In case + technology is 'lte', 'registered' and 'roaming' may + not necessarily mean voice calling available. The possible values are: "unregistered" Not registered to any network | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/simcom-modem.txt ^ |
@@ -0,0 +1,22 @@ +SIM900 modem usage +=================== + +To enable SIM900 module support you need to put the following +udev rule into appropriate file in /{etc,lib}/udev/rules.d: + +KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900" + +On the i-Tetra tracking device, the SIM900 is accessed +via N_GSM mux device. We use ofono as SMS message +service and incoming voice calls service, so we +use /dev/gsmtty1 provided by N_GSM mux. + +SIM800 modem usage +================== + +When using sim800 modem, the udev rule is the same as the +sim900 rule : + +KERNEL=="ttyS3", ENV{OFONO_DRIVER}="sim900" + +Because the SIM800 and SIM900 code are the merged into one driver. | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/atutil.c ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2008-2011 Intel Corporation. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -654,3 +655,45 @@ return ret; } + +int at_util_gprs_auth_method_to_auth_prot( + enum ofono_gprs_auth_method auth_method) +{ + switch (auth_method) { + case OFONO_GPRS_AUTH_METHOD_PAP: + return 1; + case OFONO_GPRS_AUTH_METHOD_CHAP: + return 2; + case OFONO_GPRS_AUTH_METHOD_NONE: + return 0; + } + + return 0; +} + +const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto) +{ + switch (proto) { + case OFONO_GPRS_PROTO_IPV6: + return "IPV6"; + case OFONO_GPRS_PROTO_IPV4V6: + return "IPV4V6"; + break; + case OFONO_GPRS_PROTO_IP: + return "IP"; + } + + return NULL; +} + +char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto, + const char *apn) +{ + const char *pdp_type = at_util_gprs_proto_to_pdp_type(proto); + + if (!apn) + return g_strdup_printf("AT+CGDCONT=%u", cid); + + return g_strdup_printf("AT+CGDCONT=%u,\"%s\",\"%s\"", cid, pdp_type, + apn); +} | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/atutil.h ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2008-2011 Intel Corporation. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -86,7 +87,24 @@ int at_util_get_ipv4_address_and_netmask(const char *addrnetmask, char *address, char *netmask); +int at_util_gprs_auth_method_to_auth_prot( + enum ofono_gprs_auth_method auth_method); + +const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto); + +/* + * at_util_get_cgdcont_command + * if the apn pointer is NULL, the context will be removed: the resulting + * string will be like: AT+CGDCONT=7 + * but if apn pointer is not NULL and the string is empty, then + * this function will create a normal context with empty apn, like: + * AT+CGDCONT=4,"IPV6","" + */ +char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto, + const char *apn); + struct cb_data { + gint ref_count; void *cb; void *data; void *user; @@ -97,12 +115,29 @@ struct cb_data *ret; ret = g_new0(struct cb_data, 1); + ret->ref_count = 1; ret->cb = cb; ret->data = data; return ret; } +static inline struct cb_data *cb_data_ref(struct cb_data *cbd) +{ + cbd->ref_count++; + return cbd; +} + +static inline void cb_data_unref(gpointer user_data) +{ + struct cb_data *cbd = user_data; + + if (--cbd->ref_count) + return; + + g_free(cbd); +} + static inline int at_util_convert_signal_strength(int strength) { int result; | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-barring.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -212,7 +211,7 @@ ofono_call_barring_set_data(cb, NULL); } -static struct ofono_call_barring_driver driver = { +static const struct ofono_call_barring_driver driver = { .name = "atmodem", .probe = at_call_barring_probe, .remove = at_call_barring_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-forwarding.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -264,7 +263,7 @@ ofono_call_forwarding_set_data(cf, NULL); } -static struct ofono_call_forwarding_driver driver = { +static const struct ofono_call_forwarding_driver driver = { .name = "atmodem", .probe = at_ccfc_probe, .remove = at_ccfc_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-meter.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -331,7 +330,7 @@ ofono_call_meter_set_data(cm, NULL); } -static struct ofono_call_meter_driver driver = { +static const struct ofono_call_meter_driver driver = { .name = "atmodem", .probe = at_caoc_probe, .remove = at_caoc_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -398,7 +397,7 @@ ofono_call_settings_set_data(cs, NULL); } -static struct ofono_call_settings_driver driver = { +static const struct ofono_call_settings_driver driver = { .name = "atmodem", .probe = at_call_settings_probe, .remove = at_call_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-volume.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> @@ -207,7 +206,7 @@ g_free(cvd); } -static struct ofono_call_volume_driver driver = { +static const struct ofono_call_volume_driver driver = { .name = "atmodem", .probe = at_call_volume_probe, .remove = at_call_volume_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/cbs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> @@ -304,7 +303,7 @@ g_free(data); } -static struct ofono_cbs_driver driver = { +static const struct ofono_cbs_driver driver = { .name = "atmodem", .probe = at_cbs_probe, .remove = at_cbs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/devinfo.c ^ |
@@ -153,7 +153,7 @@ g_at_chat_unref(chat); } -static struct ofono_devinfo_driver driver = { +static const struct ofono_devinfo_driver driver = { .name = "atmodem", .probe = at_devinfo_probe, .remove = at_devinfo_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/gnss.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -263,7 +262,7 @@ g_free(gd); } -static struct ofono_gnss_driver driver = { +static const struct ofono_gnss_driver driver = { .name = "atmodem", .probe = at_gnss_probe, .remove = at_gnss_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -158,7 +157,10 @@ g_at_ppp_set_debug(gcd->ppp, ppp_debug, "PPP"); g_at_ppp_set_auth_method(gcd->ppp, gcd->auth_method); - g_at_ppp_set_credentials(gcd->ppp, gcd->username, gcd->password); + + if (gcd->auth_method != G_AT_PPP_AUTH_METHOD_NONE) + g_at_ppp_set_credentials(gcd->ppp, gcd->username, + gcd->password); /* set connect and disconnect callbacks */ g_at_ppp_set_connect_function(gcd->ppp, ppp_connect, gc); @@ -247,7 +249,7 @@ memcpy(gcd->username, ctx->username, sizeof(ctx->username)); memcpy(gcd->password, ctx->password, sizeof(ctx->password)); - /* We only support CHAP and PAP */ + /* We support CHAP, PAP and NONE */ switch (ctx->auth_method) { case OFONO_GPRS_AUTH_METHOD_CHAP: gcd->auth_method = G_AT_PPP_AUTH_METHOD_CHAP; @@ -255,8 +257,11 @@ case OFONO_GPRS_AUTH_METHOD_PAP: gcd->auth_method = G_AT_PPP_AUTH_METHOD_PAP; break; - default: - goto error; + case OFONO_GPRS_AUTH_METHOD_NONE: + gcd->auth_method = G_AT_PPP_AUTH_METHOD_NONE; + memset(gcd->username, 0, sizeof(gcd->username)); + memset(gcd->password, 0, sizeof(gcd->password)); + break; } gcd->state = STATE_ENABLING; @@ -304,6 +309,10 @@ snprintf(buf + len, sizeof(buf) - len - 3, ",\"PAP:%s\"", ctx->apn); break; + case OFONO_GPRS_AUTH_METHOD_NONE: + snprintf(buf + len, sizeof(buf) - len - 3, + ",\"%s\"", ctx->apn); + break; } break; default: @@ -484,7 +493,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "atmodem", .probe = at_gprs_context_probe, .remove = at_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/gprs.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -642,7 +641,7 @@ g_free(gd); } -static struct ofono_gprs_driver driver = { +static const struct ofono_gprs_driver driver = { .name = "atmodem", .probe = at_gprs_probe, .remove = at_gprs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/lte.c ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2017 Intel Corporation. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -23,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -41,45 +41,88 @@ #include "atmodem.h" +static const char *none_prefix[] = { NULL }; + struct lte_driver_data { GAtChat *chat; + struct ofono_lte_default_attach_info pending_info; }; -static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result, +static void at_lte_set_auth_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct cb_data *cbd = user_data; ofono_lte_cb_t cb = cbd->cb; struct ofono_error error; - DBG("ok %d", ok); - decode_at_error(&error, g_at_result_final_response(result)); cb(&error, cbd->data); } +static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct cb_data *cbd = user_data; + ofono_lte_cb_t cb = cbd->cb; + void *data = cbd->data; + struct lte_driver_data *ldd = cbd->user; + struct ofono_error error; + char buf[32 + OFONO_GPRS_MAX_USERNAME_LENGTH + + OFONO_GPRS_MAX_PASSWORD_LENGTH + 1]; + size_t buflen = sizeof(buf); + size_t len; + enum ofono_gprs_auth_method auth_method; + + if (!ok) { + decode_at_error(&error, g_at_result_final_response(result)); + cb(&error, data); + return; + } + + auth_method = ldd->pending_info.auth_method; + + /* change the authentication method if the parameters are invalid */ + if (!*ldd->pending_info.username || !*ldd->pending_info.password) + auth_method = OFONO_GPRS_AUTH_METHOD_NONE; + + len = snprintf(buf, buflen, "AT+CGAUTH=0,%d", + at_util_gprs_auth_method_to_auth_prot(auth_method)); + buflen -= len; + + if (auth_method != OFONO_GPRS_AUTH_METHOD_NONE) + snprintf(buf + len, buflen, ",\"%s\",\"%s\"", + ldd->pending_info.username, + ldd->pending_info.password); + + cbd = cb_data_ref(cbd); + if (g_at_chat_send(ldd->chat, buf, none_prefix, + at_lte_set_auth_cb, cbd, cb_data_unref) > 0) + return; + + cb_data_unref(cbd); + CALLBACK_WITH_FAILURE(cb, data); +} + static void at_lte_set_default_attach_info(const struct ofono_lte *lte, const struct ofono_lte_default_attach_info *info, ofono_lte_cb_t cb, void *data) { struct lte_driver_data *ldd = ofono_lte_get_data(lte); - char buf[32 + OFONO_GPRS_MAX_APN_LENGTH + 1]; struct cb_data *cbd = cb_data_new(cb, data); + char *buf = at_util_get_cgdcont_command(0, info->proto, info->apn); - DBG("LTE config with APN: %s", info->apn); + cbd->user = ldd; + memcpy(&ldd->pending_info, info, sizeof(ldd->pending_info)); - if (strlen(info->apn) > 0) - snprintf(buf, sizeof(buf), "AT+CGDCONT=0,\"IP\",\"%s\"", - info->apn); - else - snprintf(buf, sizeof(buf), "AT+CGDCONT=0,\"IP\""); - - /* We can't do much in case of failure so don't check response. */ - if (g_at_chat_send(ldd->chat, buf, NULL, - at_lte_set_default_attach_info_cb, cbd, g_free) > 0) - return; + if (g_at_chat_send(ldd->chat, buf, none_prefix, + at_lte_set_default_attach_info_cb, + cbd, cb_data_unref) > 0) + goto end; + cb_data_unref(cbd); CALLBACK_WITH_FAILURE(cb, data); +end: + g_free(buf); } static gboolean lte_delayed_register(gpointer user_data) @@ -124,7 +167,7 @@ g_free(ldd); } -static struct ofono_lte_driver driver = { +static const struct ofono_lte_driver driver = { .name = "atmodem", .probe = at_lte_probe, .remove = at_lte_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/network-registration.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -179,7 +178,7 @@ return tech; } -static int cinterion_parse_tech(GAtResult *result) +static int gemalto_parse_tech(GAtResult *result) { int tech = -1; GAtResultIter iter; @@ -235,13 +234,13 @@ cb(&error, status, lac, ci, tech, cbd->data); } -static void cinterion_query_tech_cb(gboolean ok, GAtResult *result, +static void gemalto_query_tech_cb(gboolean ok, GAtResult *result, gpointer user_data) { struct tech_query *tq = user_data; int tech; - tech = cinterion_parse_tech(result); + tech = gemalto_parse_tech(result); ofono_netreg_status_notify(tq->netreg, tq->status, tq->lac, tq->ci, tech); @@ -880,7 +879,7 @@ ofono_netreg_strength_notify(netreg, strength); } -static void cinterion_ciev_notify(GAtResult *result, gpointer user_data) +static void gemalto_ciev_notify(GAtResult *result, gpointer user_data) { struct ofono_netreg *netreg = user_data; struct netreg_data *nd = ofono_netreg_get_data(netreg); @@ -1560,10 +1559,10 @@ option_query_tech_cb, tq, g_free) > 0) return; break; - case OFONO_VENDOR_CINTERION: + case OFONO_VENDOR_GEMALTO: if (g_at_chat_send(nd->chat, "AT^SMONI", smoni_prefix, - cinterion_query_tech_cb, tq, g_free) > 0) + gemalto_query_tech_cb, tq, g_free) > 0) return; break; } @@ -2032,12 +2031,12 @@ g_at_chat_send(nd->chat, "AT*TLTS=1", none_prefix, NULL, NULL, NULL); break; - case OFONO_VENDOR_CINTERION: + case OFONO_VENDOR_GEMALTO: /* - * We can't set rssi bounds from Cinterion responses + * We can't set rssi bounds from Gemalto responses * so set them up to specified values here * - * Cinterion rssi signal strength specified as: + * Gemalto rssi signal strength specified as: * 0 <= -112dBm * 1 - 4 signal strengh in 15 dB steps * 5 >= -51 dBm @@ -2051,7 +2050,7 @@ g_at_chat_send(nd->chat, "AT^SIND=\"rssi\",1", none_prefix, NULL, NULL, NULL); g_at_chat_register(nd->chat, "+CIEV:", - cinterion_ciev_notify, FALSE, netreg, NULL); + gemalto_ciev_notify, FALSE, netreg, NULL); break; case OFONO_VENDOR_NOKIA: case OFONO_VENDOR_SAMSUNG: @@ -2155,7 +2154,7 @@ g_free(nd); } -static struct ofono_netreg_driver driver = { +static const struct ofono_netreg_driver driver = { .name = "atmodem", .probe = at_netreg_probe, .remove = at_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/phonebook.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -593,7 +592,7 @@ g_free(pbd); } -static struct ofono_phonebook_driver driver = { +static const struct ofono_phonebook_driver driver = { .name = "atmodem", .probe = at_phonebook_probe, .remove = at_phonebook_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/sim.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -1959,7 +1958,7 @@ g_free(sd); } -static struct ofono_sim_driver driver = { +static const struct ofono_sim_driver driver = { .name = "atmodem", .probe = at_sim_probe, .remove = at_sim_remove, @@ -1987,7 +1986,7 @@ .logical_access = at_logical_access }; -static struct ofono_sim_driver driver_noef = { +static const struct ofono_sim_driver driver_noef = { .name = "atmodem-noef", .probe = at_sim_probe, .remove = at_sim_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/sms.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -104,7 +103,7 @@ { struct sms_data *data = ofono_sms_get_data(sms); struct cb_data *cbd = cb_data_new(cb, user_data); - char buf[64]; + char buf[128]; snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type); @@ -859,8 +858,18 @@ data->cnma_enabled ? "21" : "1", FALSE)) return FALSE; + switch (data->vendor) { + case OFONO_VENDOR_GEMALTO: + mode = "0"; + break; + default: + /* Sounds like 2 is the sanest mode */ + mode = "20"; + break; + } + /* Always deliver CB via +CBM, otherwise don't deliver at all */ - if (!append_cnmi_element(buf, &len, cnmi_opts[2], "20", FALSE)) + if (!append_cnmi_element(buf, &len, cnmi_opts[2], mode, FALSE)) return FALSE; /* @@ -1320,7 +1329,7 @@ ofono_sms_set_data(sms, NULL); } -static struct ofono_sms_driver driver = { +static const struct ofono_sms_driver driver = { .name = "atmodem", .probe = at_sms_probe, .remove = at_sms_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/stk.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -223,7 +222,7 @@ g_free(sd); } -static struct ofono_stk_driver driver = { +static const struct ofono_stk_driver driver = { .name = "atmodem", .probe = at_stk_probe, .remove = at_stk_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/ussd.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -327,7 +326,7 @@ g_free(data); } -static struct ofono_ussd_driver driver = { +static const struct ofono_ussd_driver driver = { .name = "atmodem", .probe = at_ussd_probe, .remove = at_ussd_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/vendor.h ^ |
@@ -47,7 +47,6 @@ OFONO_VENDOR_QUECTEL_M95, OFONO_VENDOR_UBLOX, OFONO_VENDOR_UBLOX_TOBY_L2, - OFONO_VENDOR_CINTERION, OFONO_VENDOR_XMM, OFONO_VENDOR_GEMALTO, }; | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/voicecall.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -1155,7 +1154,7 @@ g_free(vd); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "atmodem", .probe = at_voicecall_probe, .remove = at_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/calypsomodem/stk.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -292,7 +291,7 @@ g_free(sd); } -static struct ofono_stk_driver driver = { +static const struct ofono_stk_driver driver = { .name = "calypsomodem", .probe = calypso_stk_probe, .remove = calypso_stk_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/calypsomodem/voicecall.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -402,7 +401,7 @@ g_free(vd); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "calypsomodem", .probe = calypso_voicecall_probe, .remove = calypso_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/cdmamodem/connman.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -323,7 +322,7 @@ g_free(cd); } -static struct ofono_cdma_connman_driver driver = { +static const struct ofono_cdma_connman_driver driver = { .name = "cdmamodem", .probe = cdma_connman_probe, .remove = cdma_connman_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/cdmamodem/devinfo.c ^ |
@@ -153,7 +153,7 @@ ofono_devinfo_set_data(info, NULL); } -static struct ofono_devinfo_driver driver = { +static const struct ofono_devinfo_driver driver = { .name = "cdmamodem", .probe = cdma_devinfo_probe, .remove = cdma_devinfo_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/cdmamodem/voicecall.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -143,7 +142,7 @@ g_free(vd); } -static struct ofono_cdma_voicecall_driver driver = { +static const struct ofono_cdma_voicecall_driver driver = { .name = "cdmamodem", .probe = cdma_voicecall_probe, .remove = cdma_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/dunmodem/gprs.c ^ |
@@ -73,7 +73,7 @@ CALLBACK_WITH_SUCCESS(cb, 1, data); } -static struct ofono_gprs_driver driver = { +static const struct ofono_gprs_driver driver = { .name = "dunmodem", .probe = dun_gprs_probe, .remove = dun_gprs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/dunmodem/network-registration.c ^ |
@@ -107,7 +107,7 @@ g_free(nd); } -static struct ofono_netreg_driver driver = { +static const struct ofono_netreg_driver driver = { .name = "dunmodem", .probe = dun_netreg_probe, .remove = dun_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/gemaltomodem.c ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2017 Vincent Cesson. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -35,12 +36,14 @@ static int gemaltomodem_init(void) { gemalto_location_reporting_init(); + gemalto_voicecall_init(); return 0; } static void gemaltomodem_exit(void) { + gemalto_voicecall_exit(); gemalto_location_reporting_exit(); } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/gemaltomodem.h ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2017 Vincent Cesson. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -23,3 +24,6 @@ extern void gemalto_location_reporting_init(); extern void gemalto_location_reporting_exit(); + +extern void gemalto_voicecall_init(); +extern void gemalto_voicecall_exit(); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/location-reporting.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -217,7 +216,7 @@ g_free(gd); } -static struct ofono_location_reporting_driver driver = { +static const struct ofono_location_reporting_driver driver = { .name = "gemaltomodem", .type = OFONO_LOCATION_REPORTING_TYPE_NMEA, .probe = gemalto_location_reporting_probe, | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/voicecall.c ^ |
@@ -0,0 +1,576 @@ +/* + * + * oFono - Open Source Telephony + * + * Copyright (C) 2008-2011 Intel Corporation. All rights reserved. + * Copyright (C) 2018 Gemalto M2M + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> + +#include <glib.h> + +#include <ofono/log.h> +#include <ofono/modem.h> +#include <ofono/voicecall.h> + +#include "gatchat.h" +#include "gatresult.h" + +#include "common.h" + +#include "gemaltomodem.h" + +static const char *clcc_prefix[] = { "+CLCC:", NULL }; +static const char *none_prefix[] = { NULL }; + +struct voicecall_data { + GAtChat *chat; + GSList *calls; + unsigned int local_release; + GSList *new_calls; +}; + +struct release_id_req { + struct ofono_voicecall *vc; + ofono_voicecall_cb_t cb; + void *data; + int id; +}; + +struct change_state_req { + struct ofono_voicecall *vc; + ofono_voicecall_cb_t cb; + void *data; + int affected_types; +}; + +static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct change_state_req *req = user_data; + struct voicecall_data *vd = ofono_voicecall_get_data(req->vc); + struct ofono_error error; + + decode_at_error(&error, g_at_result_final_response(result)); + + if (ok && req->affected_types) { + GSList *l; + struct ofono_call *call; + + for (l = vd->calls; l; l = l->next) { + call = l->data; + + if (req->affected_types & (1 << call->status)) + vd->local_release |= (1 << call->id); + } + } + + req->cb(&error, req->data); +} + +static void gemalto_call_common(const char *cmd, struct ofono_voicecall *vc, + GAtResultFunc result_cb, + unsigned int affected_types, + ofono_voicecall_cb_t cb, void *data) +{ + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + struct change_state_req *req = g_new0(struct change_state_req, 1); + + req->vc = vc; + req->cb = cb; + req->data = data; + req->affected_types = affected_types; + + if (g_at_chat_send(vd->chat, cmd, none_prefix, + result_cb, req, g_free) > 0) + return; + + g_free(req); + CALLBACK_WITH_FAILURE(cb, data); +} + +static void gemalto_answer(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + gemalto_call_common("ATA", vc, generic_cb, 0, cb, data); +} + +static void gemalto_hangup_all(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + unsigned int affected = (1 << CALL_STATUS_INCOMING) | + (1 << CALL_STATUS_DIALING) | + (1 << CALL_STATUS_ALERTING) | + (1 << CALL_STATUS_WAITING) | + (1 << CALL_STATUS_HELD) | + (1 << CALL_STATUS_ACTIVE); + + /* Hangup all calls */ + gemalto_call_common("AT+CHUP", vc, generic_cb, affected, cb, data); +} + +static void gemalto_hangup(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + unsigned int affected = (1 << CALL_STATUS_ACTIVE); + + /* Hangup current active call */ + gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data); +} + +static void gemalto_hold_all_active(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + unsigned int affected = (1 << CALL_STATUS_ACTIVE); + gemalto_call_common("AT+CHLD=2", vc, generic_cb, affected, cb, data); +} + +static void gemalto_release_all_held(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + unsigned int affected = (1 << CALL_STATUS_INCOMING) | + (1 << CALL_STATUS_WAITING); + + gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data); +} + +static void gemalto_set_udub(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + unsigned int affected = (1 << CALL_STATUS_INCOMING) | + (1 << CALL_STATUS_WAITING); + + gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data); +} + +static void gemalto_release_all_active(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + unsigned int affected = (1 << CALL_STATUS_ACTIVE); + + gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data); +} + +static void release_id_cb(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct release_id_req *req = user_data; + struct voicecall_data *vd = ofono_voicecall_get_data(req->vc); + struct ofono_error error; + + decode_at_error(&error, g_at_result_final_response(result)); + + if (ok) + vd->local_release = 1 << req->id; + + req->cb(&error, req->data); +} + +static void gemalto_release_specific(struct ofono_voicecall *vc, int id, + ofono_voicecall_cb_t cb, void *data) +{ + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + struct release_id_req *req = g_new0(struct release_id_req, 1); + char buf[32]; + + req->vc = vc; + req->cb = cb; + req->data = data; + req->id = id; + + snprintf(buf, sizeof(buf), "AT+CHLD=1%d", id); + + if (g_at_chat_send(vd->chat, buf, none_prefix, + release_id_cb, req, g_free) > 0) + return; + + g_free(req); + CALLBACK_WITH_FAILURE(cb, data); +} + +static void gemalto_private_chat(struct ofono_voicecall *vc, int id, + ofono_voicecall_cb_t cb, void *data) +{ + char buf[32]; + + snprintf(buf, sizeof(buf), "AT+CHLD=2%d", id); + gemalto_call_common(buf, vc, generic_cb, 0, cb, data); +} + +static void gemalto_create_multiparty(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + gemalto_call_common("AT+CHLD=3", vc, generic_cb, 0, cb, data); +} + +static void gemalto_transfer(struct ofono_voicecall *vc, + ofono_voicecall_cb_t cb, void *data) +{ + /* Held & Active */ + unsigned int affected = (1 << CALL_STATUS_ACTIVE) | + (1 << CALL_STATUS_HELD); + + /* Transfer can puts held & active calls together and disconnects + * from both. However, some networks support transferring of + * dialing/ringing calls as well. + */ + affected |= (1 << CALL_STATUS_DIALING) | + (1 << CALL_STATUS_ALERTING); + + gemalto_call_common("AT+CHLD=4", vc, generic_cb, affected, cb, data); +} + +static void gemalto_send_dtmf(struct ofono_voicecall *vc, const char *dtmf, + ofono_voicecall_cb_t cb, void *data) +{ + struct ofono_modem *modem = ofono_voicecall_get_modem(vc); + int use_quotes = ofono_modem_get_integer(modem, "GemaltoVtsQuotes"); + int len = strlen(dtmf); + int s; + int i; + char *buf; + + /* strlen("+VTS=\"T\";") = 9 + initial AT + null */ + buf = (char *)alloca(len * 9 + 3); + + if (use_quotes) + s = sprintf(buf, "AT+VTS=\"%c\"", dtmf[0]); + else + s = sprintf(buf, "AT+VTS=%c", dtmf[0]); + + for (i = 1; i < len; i++) { + if (use_quotes) + s += sprintf(buf + s, ";+VTS=\"%c\"", dtmf[i]); + else + s += sprintf(buf + s, ";+VTS=%c", dtmf[i]); + } + + gemalto_call_common(buf, vc, generic_cb, 0, cb, data); +} + +static void gemalto_dial(struct ofono_voicecall *vc, + const struct ofono_phone_number *ph, + enum ofono_clir_option clir, + ofono_voicecall_cb_t cb, void *data) +{ + struct cb_data *cbd = cb_data_new(cb, data); + char buf[256]; + size_t len; + + cbd->user = vc; + + if (ph->type == 145) + len = snprintf(buf, sizeof(buf), "ATD+%s", ph->number); + else + len = snprintf(buf, sizeof(buf), "ATD%s", ph->number); + + switch (clir) { + case OFONO_CLIR_OPTION_INVOCATION: + len += snprintf(buf+len, sizeof(buf)-len, "I"); + break; + case OFONO_CLIR_OPTION_SUPPRESSION: + len += snprintf(buf+len, sizeof(buf)-len, "i"); + break; + default: + break; + } + + snprintf(buf + len, sizeof(buf) - len, ";"); + + gemalto_call_common(buf, vc, generic_cb, 0, cb, data); +} + +static void gemalto_parse_slcc(GAtResult *result, GSList **l, + ofono_bool_t *ret_mpty, gboolean *last) +{ + GAtResultIter iter; + int id, dir, status, type; + ofono_bool_t mpty; + struct ofono_call *call; + const char *str = ""; + int number_type = 129; + + if (last) + *last = TRUE; + + g_at_result_iter_init(&iter, result); + + g_at_result_iter_next(&iter, "^SLCC:"); + + if (!g_at_result_iter_next_number(&iter, &id)) + return; + + if (last) + *last = FALSE; + + if (id == 0) + return; + + if (!g_at_result_iter_next_number(&iter, &dir)) + return; + + if (!g_at_result_iter_next_number(&iter, &status)) + return; + + if (status > 5) + return; + + if (!g_at_result_iter_next_number(&iter, &type)) + return; + + if (!g_at_result_iter_next_number(&iter, &mpty)) + return; + + /* skip 'Reserved=0' parameter, only difference from CLCC */ + if (!g_at_result_iter_skip_next(&iter)) + return; + + if (g_at_result_iter_next_string(&iter, &str)) + g_at_result_iter_next_number(&iter, &number_type); + + call = g_new0(struct ofono_call, 1); + ofono_call_init(call); + call->id = id; + call->direction = dir; + call->status = status; + call->type = type; + strncpy(call->phone_number.number, str, + OFONO_MAX_PHONE_NUMBER_LENGTH); + call->phone_number.type = number_type; + + if (strlen(str) > 0) + call->clip_validity = 2; + else + call->clip_validity = 0; + + *l = g_slist_insert_sorted(*l, call, at_util_call_compare); + + if (ret_mpty) + *ret_mpty = mpty; +} + +static void clcc_cb(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + GSList *l; + + if (!ok) + return; + + vd->calls = at_util_parse_clcc(result, NULL); + + for (l = vd->calls; l; l = l->next) + ofono_voicecall_notify(vc, l->data); +} + +/* + * ^SLCC, except for one RFU parameter (see above in the parsing), is identical + * to +CLCC, but as URC it is parsed line by line, and the last line is + * indicated by an empty "^SLCC:" (equivalent to the "OK" for CLCC). + */ +static void slcc_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + GSList *n, *o; + struct ofono_call *nc, *oc; + gboolean last; + + gemalto_parse_slcc(result, &vd->new_calls, NULL, &last); + + if (!last) + return; + + n = vd->new_calls; + o = vd->calls; + + while (n || o) { + nc = n ? n->data : NULL; + oc = o ? o->data : NULL; + + if (oc && (nc == NULL || (nc->id > oc->id))) { + enum ofono_disconnect_reason reason; + + if (vd->local_release & (1 << oc->id)) + reason = OFONO_DISCONNECT_REASON_LOCAL_HANGUP; + else + reason = OFONO_DISCONNECT_REASON_REMOTE_HANGUP; + + if (!oc->type) + ofono_voicecall_disconnected(vc, oc->id, + reason, NULL); + + o = o->next; + } else if (nc && (oc == NULL || (nc->id < oc->id))) { + + if (nc->type == 0) /* new call, signal it */ + ofono_voicecall_notify(vc, nc); + + n = n->next; + } else { + + DBG("modify call part"); + + /* notify in case of changes */ + if (memcmp(nc, oc, sizeof(*nc))) + ofono_voicecall_notify(vc, nc); + + n = n->next; + o = o->next; + } + } + + g_slist_free_full(vd->calls, g_free); + vd->calls = vd->new_calls; + vd->new_calls = NULL; + vd->local_release = 0; +} + +static void cssi_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + GAtResultIter iter; + int code, index; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+CSSI:")) + return; + + if (!g_at_result_iter_next_number(&iter, &code)) + return; + + if (!g_at_result_iter_next_number(&iter, &index)) + index = 0; + + ofono_voicecall_ssn_mo_notify(vc, 0, code, index); +} + +static void cssu_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + GAtResultIter iter; + int code; + int index; + const char *num; + struct ofono_phone_number ph; + + ph.number[0] = '\0'; + ph.type = 129; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+CSSU:")) + return; + + if (!g_at_result_iter_next_number(&iter, &code)) + return; + + if (!g_at_result_iter_next_number_default(&iter, -1, &index)) + goto out; + + if (!g_at_result_iter_next_string(&iter, &num)) + goto out; + + strncpy(ph.number, num, OFONO_MAX_PHONE_NUMBER_LENGTH); + + if (!g_at_result_iter_next_number(&iter, &ph.type)) + return; + +out: + ofono_voicecall_ssn_mt_notify(vc, 0, code, index, &ph); +} + +static void gemalto_voicecall_initialized(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct ofono_voicecall *vc = user_data; + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + + DBG("voicecall_init: registering to notifications"); + + /* NO CARRIER, NO ANSWER, BUSY, NO DIALTONE are handled through SLCC */ + g_at_chat_register(vd->chat, "^SLCC:", slcc_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "+CSSI:", cssi_notify, FALSE, vc, NULL); + g_at_chat_register(vd->chat, "+CSSU:", cssu_notify, FALSE, vc, NULL); + + ofono_voicecall_register(vc); + + /* Populate the call list */ + g_at_chat_send(vd->chat, "AT+CLCC", clcc_prefix, clcc_cb, vc, NULL); +} + +static int gemalto_voicecall_probe(struct ofono_voicecall *vc, + unsigned int vendor, void *data) +{ + GAtChat *chat = data; + struct voicecall_data *vd; + + vd = g_new0(struct voicecall_data, 1); + vd->chat = g_at_chat_clone(chat); + ofono_voicecall_set_data(vc, vd); + g_at_chat_send(vd->chat, "AT+CSSN=1,1", NULL, NULL, NULL, NULL); + g_at_chat_send(vd->chat, "AT^SLCC=1", NULL, + gemalto_voicecall_initialized, vc, NULL); + return 0; +} + +static void gemalto_voicecall_remove(struct ofono_voicecall *vc) +{ + struct voicecall_data *vd = ofono_voicecall_get_data(vc); + + ofono_voicecall_set_data(vc, NULL); + + g_at_chat_unref(vd->chat); + g_free(vd); +} + +static const struct ofono_voicecall_driver driver = { + .name = "gemaltomodem", + .probe = gemalto_voicecall_probe, + .remove = gemalto_voicecall_remove, + .dial = gemalto_dial, + .answer = gemalto_answer, + .hangup_all = gemalto_hangup_all, + .hangup_active = gemalto_hangup, + .hold_all_active = gemalto_hold_all_active, + .release_all_held = gemalto_release_all_held, + .set_udub = gemalto_set_udub, + .release_all_active = gemalto_release_all_active, + .release_specific = gemalto_release_specific, + .private_chat = gemalto_private_chat, + .create_multiparty = gemalto_create_multiparty, + .transfer = gemalto_transfer, + .send_tones = gemalto_send_dtmf +}; + +void gemalto_voicecall_init(void) +{ + ofono_voicecall_driver_register(&driver); +} + +void gemalto_voicecall_exit(void) +{ + ofono_voicecall_driver_unregister(&driver); +} | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/call-volume.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -218,7 +217,7 @@ g_free(vd); } -static struct ofono_call_volume_driver driver = { +static const struct ofono_call_volume_driver driver = { .name = "hfpmodem", .probe = hfp_call_volume_probe, .remove = hfp_call_volume_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/devinfo.c ^ |
@@ -91,7 +91,7 @@ g_free(dd); } -static struct ofono_devinfo_driver driver = { +static const struct ofono_devinfo_driver driver = { .name = "hfpmodem", .probe = hfp_devinfo_probe, .remove = hfp_devinfo_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/handsfree.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -411,7 +410,7 @@ CALLBACK_WITH_FAILURE(cb, data); } -static struct ofono_handsfree_driver driver = { +static const struct ofono_handsfree_driver driver = { .name = "hfpmodem", .probe = hfp_handsfree_probe, .remove = hfp_handsfree_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/network-registration.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -343,7 +342,7 @@ g_free(nd); } -static struct ofono_netreg_driver driver = { +static const struct ofono_netreg_driver driver = { .name = "hfpmodem", .probe = hfp_netreg_probe, .remove = hfp_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/siri.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -196,7 +195,7 @@ CALLBACK_WITH_FAILURE(cb, NULL); } -static struct ofono_siri_driver driver = { +static const struct ofono_siri_driver driver = { .name = "hfpmodem", .probe = hfp_siri_probe, .remove = hfp_siri_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/slc.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <string.h> #include <errno.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/voicecall.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -1303,7 +1302,7 @@ g_free(vd); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "hfpmodem", .probe = hfp_voicecall_probe, .remove = hfp_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hsomodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -379,7 +378,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "hsomodem", .probe = hso_gprs_context_probe, .remove = hso_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hsomodem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -199,7 +198,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "hsomodem", .probe = hso_radio_settings_probe, .remove = hso_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/audio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -113,7 +112,7 @@ g_free(asd); } -static struct ofono_audio_settings_driver driver = { +static const struct ofono_audio_settings_driver driver = { .name = "huaweimodem", .probe = huawei_audio_settings_probe, .remove = huawei_audio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/cdma-netreg.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <glib.h> #include <errno.h> @@ -210,7 +209,7 @@ g_at_chat_unref(chat); } -static struct ofono_cdma_netreg_driver driver = { +static const struct ofono_cdma_netreg_driver driver = { .name = "huaweimodem", .probe = huawei_cdma_netreg_probe, .remove = huawei_cdma_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -339,7 +338,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "huaweimodem", .probe = huawei_gprs_context_probe, .remove = huawei_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -569,7 +568,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "huaweimodem", .probe = huawei_radio_settings_probe, .remove = huawei_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/ussd.c ^ |
@@ -204,7 +204,7 @@ g_free(data); } -static struct ofono_ussd_driver driver = { +static const struct ofono_ussd_driver driver = { .name = "huaweimodem", .probe = huawei_ussd_probe, .remove = huawei_ussd_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/voicecall.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -497,7 +496,7 @@ g_free(vd); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "huaweimodem", .probe = huawei_voicecall_probe, .remove = huawei_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/iceramodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -403,7 +402,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "iceramodem", .probe = icera_gprs_context_probe, .remove = icera_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/iceramodem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -212,7 +211,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "iceramodem", .probe = icera_radio_settings_probe, .remove = icera_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/audio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -382,7 +381,7 @@ g_free(asd); } -static struct ofono_audio_settings_driver driver = { +static const struct ofono_audio_settings_driver driver = { .name = "ifxmodem", .probe = ifx_audio_settings_probe, .remove = ifx_audio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/ctm.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -167,7 +166,7 @@ g_free(ctmd); } -static struct ofono_ctm_driver driver = { +static const struct ofono_ctm_driver driver = { .name = "ifxmodem", .probe = ifx_ctm_probe, .remove = ifx_ctm_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -466,8 +465,14 @@ gcd->active_context = ctx->cid; gcd->cb = cb; gcd->cb_data = data; - memcpy(gcd->username, ctx->username, sizeof(ctx->username)); - memcpy(gcd->password, ctx->password, sizeof(ctx->password)); + + if (ctx->auth_method == OFONO_GPRS_AUTH_METHOD_NONE) { + memset(gcd->username, 0, sizeof(gcd->username)); + memset(gcd->password, 0, sizeof(gcd->password)); + } else { + memcpy(gcd->username, ctx->username, sizeof(ctx->username)); + memcpy(gcd->password, ctx->password, sizeof(ctx->password)); + } gcd->state = STATE_ENABLING; gcd->proto = ctx->proto; @@ -514,6 +519,9 @@ if (gcd->vendor != OFONO_VENDOR_XMM) g_at_chat_resume(gcd->chat); + if (!gcd->cb) + return; + CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data); } @@ -652,7 +660,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "ifxmodem", .probe = ifx_gprs_context_probe, .remove = ifx_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -201,7 +200,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "ifxmodem", .probe = ifx_radio_settings_probe, .remove = ifx_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/stk.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -307,7 +306,7 @@ g_free(sd); } -static struct ofono_stk_driver driver = { +static const struct ofono_stk_driver driver = { .name = "ifxmodem", .probe = ifx_stk_probe, .remove = ifx_stk_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/voicecall.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -1019,7 +1018,7 @@ g_free(vd); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "ifxmodem", .probe = ifx_voicecall_probe, .remove = ifx_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/audio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -117,7 +116,7 @@ g_free(asd); } -static struct ofono_audio_settings_driver driver = { +static const struct ofono_audio_settings_driver driver = { .name = "isimodem", .probe = isi_audio_settings_probe, .remove = isi_audio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-barring.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -429,7 +428,7 @@ g_free(data); } -static struct ofono_call_barring_driver driver = { +static const struct ofono_call_barring_driver driver = { .name = "isimodem", .probe = isi_call_barring_probe, .remove = isi_call_barring_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-forwarding.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -457,7 +456,7 @@ g_free(data); } -static struct ofono_call_forwarding_driver driver = { +static const struct ofono_call_forwarding_driver driver = { .name = "isimodem", .probe = isi_call_forwarding_probe, .remove = isi_call_forwarding_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-meter.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -118,7 +117,7 @@ g_free(data); } -static struct ofono_call_meter_driver driver = { +static const struct ofono_call_meter_driver driver = { .name = "isimodem", .probe = isi_call_meter_probe, .remove = isi_call_meter_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -405,7 +404,7 @@ g_free(data); } -static struct ofono_call_settings_driver driver = { +static const struct ofono_call_settings_driver driver = { .name = "isimodem", .probe = isi_call_settings_probe, .remove = isi_call_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/cbs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -227,7 +226,7 @@ g_free(cd); } -static struct ofono_cbs_driver driver = { +static const struct ofono_cbs_driver driver = { .name = "isimodem", .probe = isi_cbs_probe, .remove = isi_cbs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/debug.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdint.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/devinfo.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -252,7 +251,7 @@ g_free(data); } -static struct ofono_devinfo_driver driver = { +static const struct ofono_devinfo_driver driver = { .name = "isimodem", .probe = isi_devinfo_probe, .remove = isi_devinfo_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -538,11 +537,15 @@ strncpy(cd->apn, ctx->apn, GPDS_MAX_APN_STRING_LENGTH); cd->apn[GPDS_MAX_APN_STRING_LENGTH] = '\0'; - strncpy(cd->username, ctx->username, GPDS_MAX_USERNAME_LENGTH); - cd->username[GPDS_MAX_USERNAME_LENGTH] = '\0'; - - strncpy(cd->password, ctx->password, GPDS_MAX_PASSWORD_LENGTH); - cd->username[GPDS_MAX_PASSWORD_LENGTH] = '\0'; + if (ctx->auth_method == OFONO_GPRS_AUTH_METHOD_NONE) { + memset(cd->username, 0, sizeof(cd->username)); + memset(cd->password, 0, sizeof(cd->password)); + } else { + strncpy(cd->username, ctx->username, GPDS_MAX_USERNAME_LENGTH); + cd->username[GPDS_MAX_USERNAME_LENGTH] = '\0'; + strncpy(cd->password, ctx->password, GPDS_MAX_PASSWORD_LENGTH); + cd->username[GPDS_MAX_PASSWORD_LENGTH] = '\0'; + } cd->pep = g_isi_pep_create(cd->idx, NULL, NULL); if (cd->pep == NULL) @@ -659,7 +662,7 @@ g_free(cd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "isimodem", .probe = isi_gprs_context_probe, .remove = isi_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/gprs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -490,7 +489,7 @@ g_free(cbd); } -static struct ofono_gprs_driver driver = { +static const struct ofono_gprs_driver driver = { .name = "isimodem", .probe = isi_gprs_probe, .remove = isi_gprs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/network-registration.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1165,7 +1164,7 @@ g_free(data); } -static struct ofono_netreg_driver isimodem = { +static const struct ofono_netreg_driver isimodem = { .name = "isimodem", .probe = isi_netreg_probe, .remove = isi_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/phonebook.c ^ |
@@ -340,7 +340,7 @@ g_free(data); } -static struct ofono_phonebook_driver driver = { +static const struct ofono_phonebook_driver driver = { .name = "isimodem", .probe = isi_phonebook_probe, .remove = isi_phonebook_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -365,7 +364,7 @@ g_free(rd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "isimodem", .probe = isi_radio_settings_probe, .remove = isi_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/sim.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -969,7 +968,7 @@ g_free(data); } -static struct ofono_sim_driver driver = { +static const struct ofono_sim_driver driver = { .name = "isimodem", .probe = isi_sim_probe, .remove = isi_sim_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/sms.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1121,7 +1120,7 @@ g_free(sd); } -static struct ofono_sms_driver driver = { +static const struct ofono_sms_driver driver = { .name = "isimodem", .probe = isi_sms_probe, .remove = isi_sms_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/uicc-util.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/uicc.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1651,7 +1650,7 @@ g_free(data); } -static struct ofono_sim_driver driver = { +static const struct ofono_sim_driver driver = { .name = "wgmodem2.5", .probe = uicc_sim_probe, .remove = uicc_sim_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/ussd.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -276,7 +275,7 @@ g_free(data); } -static struct ofono_ussd_driver driver = { +static const struct ofono_ussd_driver driver = { .name = "isimodem", .probe = isi_ussd_probe, .remove = isi_ussd_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/voicecall.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1935,7 +1934,7 @@ g_free(data); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "isimodem", .probe = isi_probe, .remove = isi_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/devinfo.c ^ |
@@ -88,7 +88,7 @@ l_free(dd); } -static struct ofono_devinfo_driver driver = { +static const struct ofono_devinfo_driver driver = { .name = "mbim", .probe = mbim_devinfo_probe, .remove = mbim_devinfo_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <stdbool.h> #include <errno.h> @@ -75,9 +74,11 @@ return 2; /* MBIMAuthProtocolChap */ case OFONO_GPRS_AUTH_METHOD_PAP: return 1; /* MBIMAuthProtocolPap */ + case OFONO_GPRS_AUTH_METHOD_NONE: + return 0; /* MBIMAUthProtocolNone */ } - return 0; + return 0; /* MBIMAUthProtocolNone */ } static void mbim_deactivate_cb(struct mbim_message *message, void *user) @@ -345,6 +346,8 @@ { struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc); struct mbim_message *message; + const char *username = NULL; + const char *password = NULL; DBG("cid %u", ctx->cid); @@ -354,6 +357,12 @@ gcd->active_context = ctx->cid; gcd->proto = ctx->proto; + if (ctx->auth_method != OFONO_GPRS_AUTH_METHOD_NONE && ctx->username[0]) + username = ctx->username; + + if (ctx->auth_method != OFONO_GPRS_AUTH_METHOD_NONE && ctx->password[0]) + password = ctx->password; + message = mbim_message_new(mbim_uuid_basic_connect, MBIM_CID_CONNECT, MBIM_COMMAND_TYPE_SET); @@ -361,8 +370,8 @@ ctx->cid, 1, /* MBIMActivationCommandActivate */ ctx->apn, - ctx->username[0] ? ctx->username : NULL, - ctx->password[0] ? ctx->password : NULL, + username, + password, 0, /*MBIMCompressionNone */ auth_method_to_auth_protocol(ctx->auth_method), proto_to_context_ip_type(ctx->proto), @@ -444,7 +453,7 @@ l_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "mbim", .probe = mbim_gprs_context_probe, .remove = mbim_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/gprs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <stdbool.h> #include <inttypes.h> @@ -280,7 +279,7 @@ l_free(gd); } -static struct ofono_gprs_driver driver = { +static const struct ofono_gprs_driver driver = { .name = "mbim", .probe = mbim_gprs_probe, .remove = mbim_gprs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/mbim-message.c ^ |
@@ -23,6 +23,7 @@ #include <config.h> #endif +#include <stdlib.h> #include <sys/uio.h> #include <linux/types.h> @@ -197,7 +198,7 @@ if (L_CPU_TO_LE16(0x8000) != 0x8000) { uint16_t *le = (uint16_t *) buf; - for (i = 0; i < len; i+= 2) + for (i = 0; i < len / 2; i++) le[i] = __builtin_bswap16(le[i]); } @@ -1131,7 +1132,7 @@ if (L_CPU_TO_LE16(0x8000) != 0x8000) { size_t i; - for (i = 0; i < len - 2; i += 2) + for (i = 0; i < len / 2; i++) utf16[i] = __builtin_bswap16(utf16[i]); } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/mbim.c ^ |
@@ -487,7 +487,7 @@ written = TEMP_FAILURE_RETRY(write(fd, buf, pos)); - l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written); + l_info("n_iov: %zu, %zu", n_iov + 1, (size_t) written); if (written < 0) return false; @@ -646,8 +646,8 @@ l_info("hdr->len: %u", L_LE32_TO_CPU(hdr->len)); l_info("header_size: %u", header_size); - l_info("header_offset: %lu", device->header_offset); - l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining); + l_info("header_offset: %zu", device->header_offset); + l_info("segment_bytes_remaining: %zu", device->segment_bytes_remaining); iov[n_iov].iov_base = device->segment + L_LE32_TO_CPU(hdr->len) - device->header_offset - | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/network-registration.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdbool.h> #include <stdint.h> #include <stdlib.h> @@ -395,7 +394,7 @@ l_free(nd); } -static struct ofono_netreg_driver driver = { +static const struct ofono_netreg_driver driver = { .name = "mbim", .probe = mbim_netreg_probe, .remove = mbim_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/sim.c ^ |
@@ -509,7 +509,7 @@ l_free(sd); } -static struct ofono_sim_driver driver = { +static const struct ofono_sim_driver driver = { .name = "mbim", .probe = mbim_sim_probe, .remove = mbim_sim_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/sms.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <errno.h> #include <stdint.h> @@ -496,7 +495,7 @@ l_free(sd); } -static struct ofono_sms_driver driver = { +static const struct ofono_sms_driver driver = { .name = "mbim", .probe = mbim_sms_probe, .remove = mbim_sms_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbmmodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -511,7 +510,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "mbmmodem", .probe = mbm_gprs_context_probe, .remove = mbm_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbmmodem/location-reporting.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -231,7 +230,7 @@ g_free(gd); } -static struct ofono_location_reporting_driver driver = { +static const struct ofono_location_reporting_driver driver = { .name = "mbmmodem", .type = OFONO_LOCATION_REPORTING_TYPE_NMEA, .probe = mbm_location_reporting_probe, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbmmodem/stk.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -262,7 +261,7 @@ g_free(sd); } -static struct ofono_stk_driver driver = { +static const struct ofono_stk_driver driver = { .name = "mbmmodem", .probe = mbm_stk_probe, .remove = mbm_stk_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/nwmodem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -195,7 +194,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "nwmodem", .probe = nw_radio_settings_probe, .remove = nw_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/devinfo.c ^ |
@@ -208,7 +208,7 @@ g_free(data); } -static struct ofono_devinfo_driver driver = { +static const struct ofono_devinfo_driver driver = { .name = "qmimodem", .probe = qmi_devinfo_probe, .remove = qmi_devinfo_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/gprs-context.c ^ |
@@ -88,6 +88,7 @@ char* straddr; char* apn; const char *dns[3] = { NULL, NULL, NULL }; + char dns_buf[2][INET_ADDRSTRLEN]; DBG(""); @@ -131,14 +132,14 @@ if (qmi_result_get_uint32(result, QMI_WDS_RESULT_PRIMARY_DNS, &ip_addr)) { addr.s_addr = htonl(ip_addr); - dns[0] = inet_ntoa(addr); + dns[0] = inet_ntop(AF_INET, &addr, dns_buf[0], sizeof(dns_buf[0])); DBG("Primary DNS: %s", dns[0]); } if (qmi_result_get_uint32(result, QMI_WDS_RESULT_SECONDARY_DNS, &ip_addr)) { addr.s_addr = htonl(ip_addr); - dns[1] = inet_ntoa(addr); + dns[1] = inet_ntop(AF_INET, &addr, dns_buf[1], sizeof(dns_buf[1])); DBG("Secondary DNS: %s", dns[1]); } @@ -230,6 +231,20 @@ g_free(cbd); } +static uint8_t auth_method_to_qmi_auth(enum ofono_gprs_auth_method method) +{ + switch (method) { + case OFONO_GPRS_AUTH_METHOD_CHAP: + return QMI_WDS_AUTHENTICATION_CHAP; + case OFONO_GPRS_AUTH_METHOD_PAP: + return QMI_WDS_AUTHENTICATION_PAP; + case OFONO_GPRS_AUTH_METHOD_NONE: + return QMI_WDS_AUTHENTICATION_NONE; + } + + return QMI_WDS_AUTHENTICATION_NONE; +} + static void qmi_activate_primary(struct ofono_gprs_context *gc, const struct ofono_gprs_primary_context *ctx, ofono_gprs_context_cb_t cb, void *user_data) @@ -266,26 +281,16 @@ qmi_param_append_uint8(param, QMI_WDS_PARAM_IP_FAMILY, ip_family); - switch (ctx->auth_method) { - case OFONO_GPRS_AUTH_METHOD_CHAP: - auth = QMI_WDS_AUTHENTICATION_CHAP; - break; - case OFONO_GPRS_AUTH_METHOD_PAP: - auth = QMI_WDS_AUTHENTICATION_PAP; - break; - default: - auth = QMI_WDS_AUTHENTICATION_NONE; - break; - } + auth = auth_method_to_qmi_auth(ctx->auth_method); qmi_param_append_uint8(param, QMI_WDS_PARAM_AUTHENTICATION_PREFERENCE, auth); - if (ctx->username[0] != '\0') + if (auth != QMI_WDS_AUTHENTICATION_NONE && ctx->username[0] != '\0') qmi_param_append(param, QMI_WDS_PARAM_USERNAME, strlen(ctx->username), ctx->username); - if (ctx->password[0] != '\0') + if (auth != QMI_WDS_AUTHENTICATION_NONE && ctx->password[0] != '\0') qmi_param_append(param, QMI_WDS_PARAM_PASSWORD, strlen(ctx->password), ctx->password); @@ -487,7 +492,7 @@ g_free(data); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "qmimodem", .probe = qmi_gprs_context_probe, .remove = qmi_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/gprs.c ^ |
@@ -408,7 +408,7 @@ g_free(data); } -static struct ofono_gprs_driver driver = { +static const struct ofono_gprs_driver driver = { .name = "qmimodem", .probe = qmi_gprs_probe, .remove = qmi_gprs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/location-reporting.c ^ |
@@ -278,7 +278,7 @@ g_free(data); } -static struct ofono_location_reporting_driver driver = { +static const struct ofono_location_reporting_driver driver = { .name = "qmimodem", .type = OFONO_LOCATION_REPORTING_TYPE_NMEA, .probe = qmi_location_reporting_probe, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/lte.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -165,7 +164,7 @@ qmi_param_free(param); error: - ofono_error("Failed to reset profile %hhd", index); + ofono_error("Failed to reset default profile"); ofono_lte_remove(lte); } @@ -247,7 +246,7 @@ g_free(ldd); } -static struct ofono_lte_driver driver = { +static const struct ofono_lte_driver driver = { .name = "qmimodem", .probe = qmimodem_lte_probe, .remove = qmimodem_lte_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/netmon.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -268,7 +267,7 @@ g_free(nmd); } -static struct ofono_netmon_driver driver = { +static const struct ofono_netmon_driver driver = { .name = "qmimodem", .probe = qmi_netmon_probe, .remove = qmi_netmon_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/network-registration.c ^ |
@@ -637,7 +637,7 @@ g_free(data); } -static struct ofono_netreg_driver driver = { +static const struct ofono_netreg_driver driver = { .name = "qmimodem", .probe = qmi_netreg_probe, .remove = qmi_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/radio-settings.c ^ |
@@ -287,7 +287,7 @@ g_free(data); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "qmimodem", .probe = qmi_radio_settings_probe, .remove = qmi_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/sim-legacy.c ^ |
@@ -379,7 +379,7 @@ g_free(data); } -static struct ofono_sim_driver driver = { +static const struct ofono_sim_driver driver = { .name = "qmimodem-legacy", .probe = qmi_sim_probe, .remove = qmi_sim_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/sim.c ^ |
@@ -911,7 +911,7 @@ g_free(data); } -static struct ofono_sim_driver driver = { +static const struct ofono_sim_driver driver = { .name = "qmimodem", .probe = qmi_sim_probe, .remove = qmi_sim_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/sms.c ^ |
@@ -571,7 +571,7 @@ g_free(data); } -static struct ofono_sms_driver driver = { +static const struct ofono_sms_driver driver = { .name = "qmimodem", .probe = qmi_sms_probe, .remove = qmi_sms_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/ussd.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <glib.h> @@ -270,7 +269,7 @@ CALLBACK_WITH_FAILURE(cb, data); } -static struct ofono_ussd_driver driver = { +static const struct ofono_ussd_driver driver = { .name = "qmimodem", .probe = qmi_ussd_probe, .remove = qmi_ussd_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/voicecall.c ^ |
@@ -95,7 +95,7 @@ g_free(data); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "qmimodem", .probe = qmi_voicecall_probe, .remove = qmi_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-barring.c ^ |
@@ -270,7 +270,7 @@ g_free(data); } -static struct ofono_call_barring_driver driver = { +static const struct ofono_call_barring_driver driver = { .name = "rilmodem", .probe = ril_call_barring_probe, .remove = ril_call_barring_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-forwarding.c ^ |
@@ -25,7 +25,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -377,7 +376,7 @@ g_free(data); } -static struct ofono_call_forwarding_driver driver = { +static const struct ofono_call_forwarding_driver driver = { .name = RILMODEM, .probe = ril_call_forwarding_probe, .remove = ril_call_forwarding_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-settings.c ^ |
@@ -26,7 +26,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -320,7 +319,7 @@ g_free(sd); } -static struct ofono_call_settings_driver driver = { +static const struct ofono_call_settings_driver driver = { .name = RILMODEM, .probe = ril_call_settings_probe, .remove = ril_call_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-volume.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <errno.h> @@ -170,7 +169,7 @@ g_free(cvd); } -static struct ofono_call_volume_driver driver = { +static const struct ofono_call_volume_driver driver = { .name = RILMODEM, .probe = ril_call_volume_probe, .remove = ril_call_volume_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/cbs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <ctype.h> @@ -194,7 +193,7 @@ g_free(data); } -static struct ofono_cbs_driver driver = { +static const struct ofono_cbs_driver driver = { .name = RILMODEM, .probe = ril_cbs_probe, .remove = ril_cbs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/devinfo.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -212,7 +211,7 @@ g_ril_unref(ril); } -static struct ofono_devinfo_driver driver = { +static const struct ofono_devinfo_driver driver = { .name = RILMODEM, .probe = ril_devinfo_probe, .remove = ril_devinfo_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/gprs-context.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -598,9 +597,12 @@ * We do the same as in $AOSP/frameworks/opt/telephony/src/java/com/ * android/internal/telephony/dataconnection/DataConnection.java, * onConnect(), and use authentication or not depending on whether - * the user field is empty or not. + * the user field is empty or not, + * on top of the verification for the authentication method. */ - if (ctx->username[0] != '\0') + + if (ctx->auth_method != OFONO_GPRS_AUTH_METHOD_NONE && + ctx->username[0] != '\0') auth_type = RIL_AUTH_BOTH; else auth_type = RIL_AUTH_NONE; @@ -615,8 +617,10 @@ parcel_w_string(&rilp, buf); g_ril_append_print_buf(gcd->ril, "(%d,%s,%s,%s,%s,%d,%s,%u)", - tech, profile, ctx->apn, ctx->username, - ctx->password, auth_type, + tech, profile, ctx->apn, + auth_type == RIL_AUTH_NONE ? "" : ctx->username, + auth_type == RIL_AUTH_NONE ? "" : ctx->password, + auth_type, ril_util_gprs_proto_to_ril_string(ctx->proto), ctx->cid); } else @@ -852,7 +856,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = RILMODEM, .probe = ril_gprs_context_probe, .remove = ril_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/gprs.c ^ |
@@ -26,7 +26,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -515,7 +514,7 @@ g_free(gd); } -static struct ofono_gprs_driver driver = { +static const struct ofono_gprs_driver driver = { .name = RILMODEM, .probe = ril_gprs_probe, .remove = ril_gprs_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/lte.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -141,7 +140,7 @@ g_free(ld); } -static struct ofono_lte_driver driver = { +static const struct ofono_lte_driver driver = { .name = RILMODEM, .probe = ril_lte_probe, .remove = ril_lte_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/netmon.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -339,7 +338,7 @@ CALLBACK_WITH_FAILURE(cb, cbd->data); } -static struct ofono_netmon_driver driver = { +static const struct ofono_netmon_driver driver = { .name = RILMODEM, .probe = ril_netmon_probe, .remove = ril_netmon_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/network-registration.c ^ |
@@ -26,7 +26,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -834,7 +833,7 @@ g_free(nd); } -static struct ofono_netreg_driver driver = { +static const struct ofono_netreg_driver driver = { .name = RILMODEM, .probe = ril_netreg_probe, .remove = ril_netreg_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/phonebook.c ^ |
@@ -27,7 +27,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1037,7 +1036,7 @@ g_free(pbd); } -static struct ofono_phonebook_driver driver = { +static const struct ofono_phonebook_driver driver = { .name = RILMODEM, .probe = ril_phonebook_probe, .remove = ril_phonebook_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/radio-settings.c ^ |
@@ -25,7 +25,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -453,7 +452,7 @@ g_free(rd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = RILMODEM, .probe = ril_radio_settings_probe, .remove = ril_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/sim.c ^ |
@@ -25,7 +25,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -1483,7 +1482,7 @@ g_free(sd); } -static struct ofono_sim_driver driver = { +static const struct ofono_sim_driver driver = { .name = RILMODEM, .probe = ril_sim_probe, .remove = ril_sim_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/sms.c ^ |
@@ -25,7 +25,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <ctype.h> #include <string.h> #include <stdlib.h> @@ -503,7 +502,7 @@ ofono_sms_set_data(sms, NULL); } -static struct ofono_sms_driver driver = { +static const struct ofono_sms_driver driver = { .name = RILMODEM, .probe = ril_sms_probe, .sca_query = ril_csca_query, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/stk.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> @@ -238,7 +237,7 @@ g_free(data); } -static struct ofono_stk_driver driver = { +static const struct ofono_stk_driver driver = { .name = RILMODEM, .probe = ril_stk_probe, .remove = ril_stk_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/ussd.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -242,7 +241,7 @@ g_free(ud); } -static struct ofono_ussd_driver driver = { +static const struct ofono_ussd_driver driver = { .name = RILMODEM, .probe = ril_ussd_probe, .remove = ril_ussd_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/voicecall.c ^ |
@@ -25,7 +25,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -856,7 +855,7 @@ g_free(vd); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = RILMODEM, .probe = ril_voicecall_probe, .remove = ril_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/speedupmodem/ussd.c ^ |
@@ -204,7 +204,7 @@ g_free(data); } -static struct ofono_ussd_driver driver = { +static const struct ofono_ussd_driver driver = { .name = "speedupmodem", .probe = speedup_ussd_probe, .remove = speedup_ussd_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/stemodem/gprs-context.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -427,7 +426,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "stemodem", .probe = ste_gprs_context_probe, .remove = ste_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/stemodem/radio-settings.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -223,7 +222,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "stemodem", .probe = ste_radio_settings_probe, .remove = ste_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/stemodem/voicecall.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -582,7 +581,7 @@ g_free(vd); } -static struct ofono_voicecall_driver driver = { +static const struct ofono_voicecall_driver driver = { .name = "stemodem", .probe = ste_voicecall_probe, .remove = ste_voicecall_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/swmodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -245,7 +244,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "swmodem", .probe = sw_gprs_context_probe, .remove = sw_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/telitmodem/gprs-context-ncm.c ^ |
@@ -19,7 +19,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -277,7 +276,8 @@ return; } - if (gcd->username[0] && gcd->password[0]) + if (gcd->auth_method != AUTH_METHOD_NONE && + gcd->username[0] && gcd->password[0]) sprintf(buf, "AT#PDPAUTH=%u,%u,\"%s\",\"%s\"", gcd->active_context, gcd->auth_method, gcd->username, gcd->password); @@ -320,7 +320,7 @@ gcd->state = STATE_ENABLING; gcd->proto = ctx->proto; - /* We only support CHAP and PAP */ + /* We support CHAP, PAP and NONE */ switch (ctx->auth_method) { case OFONO_GPRS_AUTH_METHOD_CHAP: gcd->auth_method = AUTH_METHOD_CHAP; @@ -328,6 +328,11 @@ case OFONO_GPRS_AUTH_METHOD_PAP: gcd->auth_method = AUTH_METHOD_PAP; break; + case OFONO_GPRS_AUTH_METHOD_NONE: + gcd->auth_method = AUTH_METHOD_NONE; + gcd->username[0] = 0; + gcd->password[0] = 0; + break; default: goto error; } @@ -463,7 +468,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "telitncmmodem", .probe = telitncm_gprs_context_probe, .remove = telitncm_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/telitmodem/location-reporting.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -295,7 +294,7 @@ g_free(gd); } -static struct ofono_location_reporting_driver driver = { +static const struct ofono_location_reporting_driver driver = { .name = "telitmodem", .type = OFONO_LOCATION_REPORTING_TYPE_NMEA, .probe = telit_location_reporting_probe, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ubloxmodem/gprs-context.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -315,9 +314,10 @@ case OFONO_GPRS_AUTH_METHOD_CHAP: auth = 2; break; - default: - ofono_error("Unsupported auth type %u", auth_method); - return; + case OFONO_GPRS_AUTH_METHOD_NONE: + auth = 0; + username = password = ""; + break; } snprintf(buf, sizeof(buf), "AT+UAUTHREQ=%u,%u,\"%s\",\"%s\"", @@ -496,7 +496,7 @@ g_free(gcd); } -static struct ofono_gprs_context_driver driver = { +static const struct ofono_gprs_context_driver driver = { .name = "ubloxmodem", .probe = ublox_gprs_context_probe, .remove = ublox_gprs_context_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ubloxmodem/lte.c ^ |
@@ -22,7 +22,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -125,7 +124,7 @@ g_free(ldd); } -static struct ofono_lte_driver driver = { +static const struct ofono_lte_driver driver = { .name = UBLOXMODEM, .probe = ublox_lte_probe, .remove = ublox_lte_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ubloxmodem/netmon.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -336,7 +335,7 @@ g_free(nmd); } -static struct ofono_netmon_driver driver = { +static const struct ofono_netmon_driver driver = { .name = UBLOXMODEM, .probe = ublox_netmon_probe, .remove = ublox_netmon_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/ims.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -235,7 +234,7 @@ g_free(idd); } -static struct ofono_ims_driver driver = { +static const struct ofono_ims_driver driver = { .name = "xmm7modem", .probe = xmm_ims_probe, .remove = xmm_ims_remove, | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/netmon.c ^ |
@@ -0,0 +1,263 @@ +/* + * + * oFono - Open Source Telephony + * + * Copyright (C) 2017 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <stdint.h> +#include <string.h> +#include <errno.h> + +#include <glib.h> + +#include <ofono/log.h> +#include <ofono/modem.h> +#include <ofono/netreg.h> +#include <ofono/netmon.h> + +#include "gatchat.h" +#include "gatresult.h" + +#include "common.h" +#include "xmm7modem.h" +#include "drivers/atmodem/vendor.h" + +static const char *xmci_prefix[] = { "+XMCI:", NULL }; + +struct netmon_driver_data { + GAtChat *chat; +}; + +enum xmci_ofono_type_info { + XMCI_GSM_SERV_CELL, + XMCI_GSM_NEIGH_CELL, + XMCI_UMTS_SERV_CELL, + XMCI_UMTS_NEIGH_CELL, + XMCI_LTE_SERV_CELL, + XMCI_LTE_NEIGH_CELL +}; + +/* + * Returns the appropriate radio access technology. + * + * If we can not resolve to a specific radio access technolgy + * we return OFONO_NETMON_CELL_TYPE_GSM by default. + */ +static int xmm7modem_map_radio_access_technology(int tech) +{ + switch (tech) { + case XMCI_GSM_SERV_CELL: + case XMCI_GSM_NEIGH_CELL: + return OFONO_NETMON_CELL_TYPE_GSM; + case XMCI_UMTS_SERV_CELL: + case XMCI_UMTS_NEIGH_CELL: + return OFONO_NETMON_CELL_TYPE_UMTS; + case XMCI_LTE_SERV_CELL: + case XMCI_LTE_NEIGH_CELL: + return OFONO_NETMON_CELL_TYPE_LTE; + } + + return OFONO_NETMON_CELL_TYPE_GSM; +} + +static void xmci_cb(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct cb_data *cbd = user_data; + struct ofono_netmon *netmon = cbd->data; + ofono_netmon_cb_t cb = cbd->cb; + struct ofono_error error; + GAtResultIter iter; + int number; + int rxlev = -1; + int ber = -1; + int rscp = -1; + int rsrp = -1; + int ecn0 = -1; + int rsrq = -1; + int tech = -1; + + DBG("ok %d", ok); + + decode_at_error(&error, g_at_result_final_response(result)); + + if (!ok) { + cb(&error, cbd->data); + return; + } + + g_at_result_iter_init(&iter, result); + + while (g_at_result_iter_next(&iter, "+XMCI:")) { + if (!g_at_result_iter_next_number(&iter, &number)) + break; + + tech = xmm7modem_map_radio_access_technology(number); + + switch (number) { + case XMCI_GSM_SERV_CELL: + /* skip <MCC>,<MNC>,<LAC>,<CI>,<BSIC> */ + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + + g_at_result_iter_next_number(&iter, &number); + rxlev = number != 99 ? number : rxlev; + + g_at_result_iter_next_number(&iter, &number); + ber = number != 99 ? number : ber; + break; + case XMCI_UMTS_SERV_CELL: + /* + * skip <MCC>,<MNC>,<LAC>,<CI><PSC>,<DLUARFNC>, + * <ULUARFCN>,<PATHLOSS>,<RSSI> + */ + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + + g_at_result_iter_next_number(&iter, &number); + rscp = number != 255 ? number : rscp; + + g_at_result_iter_next_number(&iter, &number); + ecn0 = number != 255 ? number : ecn0; + break; + case XMCI_LTE_SERV_CELL: + /* + * skip <MCC>,<MNC>,<TAC>,<CI>,<PCI>,<DLUARFNC>, + * <ULUARFCN>,<PATHLOSS_LTE> + */ + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + + g_at_result_iter_next_number(&iter, &number); + rsrq = number != 255 ? number : rsrq; + + g_at_result_iter_next_number(&iter, &number); + rsrp = number != 255 ? number : rsrp; + break; + default: + break; + } + + ofono_netmon_serving_cell_notify(netmon, + tech, + OFONO_NETMON_INFO_RXLEV, rxlev, + OFONO_NETMON_INFO_BER, ber, + OFONO_NETMON_INFO_RSCP, rscp, + OFONO_NETMON_INFO_ECN0, ecn0, + OFONO_NETMON_INFO_RSRQ, rsrq, + OFONO_NETMON_INFO_RSRP, rsrp, + OFONO_NETMON_INFO_INVALID); + + CALLBACK_WITH_SUCCESS(cb, cbd->data); + break; + } +} + +static void xmm7modem_netmon_request_update(struct ofono_netmon *netmon, + ofono_netmon_cb_t cb, void *data) +{ + struct netmon_driver_data *nmd = ofono_netmon_get_data(netmon); + struct cb_data *cbd = cb_data_new(cb, data); + + DBG("xmm7modem netmon request update"); + + if (g_at_chat_send(nmd->chat, "AT+XMCI=1", xmci_prefix, + xmci_cb, cbd, g_free) > 0) + return; + + g_free(cbd); + CALLBACK_WITH_FAILURE(cb, data); +} + +static gboolean ril_delayed_register(gpointer user_data) +{ + struct ofono_netmon *netmon = user_data; + + ofono_netmon_register(netmon); + + return FALSE; +} + +static int xmm7modem_netmon_probe(struct ofono_netmon *netmon, + unsigned int vendor, void *user) +{ + GAtChat *chat = user; + struct netmon_driver_data *nmd; + + DBG("xmm7modem netmon probe"); + + nmd = g_new0(struct netmon_driver_data, 1); + nmd->chat = g_at_chat_clone(chat); + + ofono_netmon_set_data(netmon, nmd); + + g_idle_add(ril_delayed_register, netmon); + + return 0; +} + +static void xmm7modem_netmon_remove(struct ofono_netmon *netmon) +{ + struct netmon_driver_data *nmd = ofono_netmon_get_data(netmon); + + DBG("xmm7modem netmon remove"); + + g_at_chat_unref(nmd->chat); + + ofono_netmon_set_data(netmon, NULL); + + g_free(nmd); +} + +static const struct ofono_netmon_driver driver = { + .name = XMM7MODEM, + .probe = xmm7modem_netmon_probe, + .remove = xmm7modem_netmon_remove, + .request_update = xmm7modem_netmon_request_update, +}; + +void xmm_netmon_init(void) +{ + ofono_netmon_driver_register(&driver); +} + +void xmm_netmon_exit(void) +{ + ofono_netmon_driver_unregister(&driver); +} | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -214,7 +213,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "xmm7modem", .probe = xmm_radio_settings_probe, .remove = xmm_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/xmm7modem.c ^ |
@@ -37,7 +37,7 @@ { xmm_radio_settings_init(); xmm_ims_init(); - + xmm_netmon_init(); return 0; } @@ -45,6 +45,7 @@ { xmm_radio_settings_exit(); xmm_ims_exit(); + xmm_netmon_exit(); } OFONO_PLUGIN_DEFINE(xmm7modem, "Intel xmm7xxx series modem driver", | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/xmm7modem.h ^ |
@@ -28,3 +28,6 @@ extern void xmm_ims_init(void); extern void xmm_ims_exit(void); + +extern void xmm_netmon_init(void); +extern void xmm_netmon_exit(void); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ztemodem/radio-settings.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> @@ -195,7 +194,7 @@ g_free(rsd); } -static struct ofono_radio_settings_driver driver = { +static const struct ofono_radio_settings_driver driver = { .name = "ztemodem", .probe = zte_radio_settings_probe, .remove = zte_radio_settings_remove, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gatchat/gatppp.c ^ |
@@ -615,7 +615,8 @@ gboolean g_at_ppp_set_auth_method(GAtPPP *ppp, GAtPPPAuthMethod method) { if (method != G_AT_PPP_AUTH_METHOD_CHAP && - method != G_AT_PPP_AUTH_METHOD_PAP) + method != G_AT_PPP_AUTH_METHOD_PAP && + method != G_AT_PPP_AUTH_METHOD_NONE) return FALSE; ppp->auth_method = method; | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gatchat/gatppp.h ^ |
@@ -46,6 +46,7 @@ typedef enum _GAtPPPAuthMethod { G_AT_PPP_AUTH_METHOD_CHAP, G_AT_PPP_AUTH_METHOD_PAP, + G_AT_PPP_AUTH_METHOD_NONE, } GAtPPPAuthMethod; typedef void (*GAtPPPConnectFunc)(const char *iface, const char *local, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gatchat/ppp_lcp.c ^ |
@@ -279,6 +279,9 @@ *new_len = 4; return RCR_NAK; + + case G_AT_PPP_AUTH_METHOD_NONE: + return RCR_REJECT; } break; } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gisi/client.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <string.h> #include <stdlib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gisi/modem.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <string.h> #include <sys/types.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gril/parcel.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> #include <string.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/gprs-context.h ^ |
@@ -31,21 +31,6 @@ struct ofono_gprs_context; struct ofono_modem; -/* - * ETSI 123.003, Section 9.1: - * the APN has, after encoding as defined in the paragraph below, a maximum - * length of 100 octets - */ -#define OFONO_GPRS_MAX_APN_LENGTH 100 -#define OFONO_GPRS_MAX_USERNAME_LENGTH 63 -#define OFONO_GPRS_MAX_PASSWORD_LENGTH 255 - -enum ofono_gprs_proto { - OFONO_GPRS_PROTO_IP = 0, - OFONO_GPRS_PROTO_IPV6, - OFONO_GPRS_PROTO_IPV4V6, -}; - enum ofono_gprs_context_type { OFONO_GPRS_CONTEXT_TYPE_ANY = 0, OFONO_GPRS_CONTEXT_TYPE_INTERNET, @@ -54,11 +39,6 @@ OFONO_GPRS_CONTEXT_TYPE_IMS, }; -enum ofono_gprs_auth_method { - OFONO_GPRS_AUTH_METHOD_CHAP = 0, - OFONO_GPRS_AUTH_METHOD_PAP, -}; - struct ofono_gprs_primary_context { unsigned int cid; char apn[OFONO_GPRS_MAX_APN_LENGTH + 1]; | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/lte.h ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2016 Endocode AG. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -32,6 +33,10 @@ struct ofono_lte_default_attach_info { char apn[OFONO_GPRS_MAX_APN_LENGTH + 1]; + enum ofono_gprs_proto proto; + enum ofono_gprs_auth_method auth_method; + char username[OFONO_GPRS_MAX_USERNAME_LENGTH + 1]; + char password[OFONO_GPRS_MAX_PASSWORD_LENGTH + 1]; }; typedef void (*ofono_lte_cb_t)(const struct ofono_error *error, void *data); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/modem.h ^ |
@@ -127,6 +127,9 @@ struct ofono_modem *ofono_modem_find(ofono_modem_compare_cb_t func, void *user_data); +void ofono_modem_set_powered_timeout_hint(struct ofono_modem *modem, + unsigned int seconds); + #ifdef __cplusplus } #endif | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/types.h ^ |
@@ -122,6 +122,27 @@ unsigned char uuid[OFONO_SHA1_UUID_LEN]; }; +/* + * ETSI 123.003, Section 9.1: + * the APN has, after encoding as defined in the paragraph below, a maximum + * length of 100 octets + */ +#define OFONO_GPRS_MAX_APN_LENGTH 100 +#define OFONO_GPRS_MAX_USERNAME_LENGTH 63 +#define OFONO_GPRS_MAX_PASSWORD_LENGTH 255 + +enum ofono_gprs_proto { + OFONO_GPRS_PROTO_IP = 0, + OFONO_GPRS_PROTO_IPV6, + OFONO_GPRS_PROTO_IPV4V6, +}; + +enum ofono_gprs_auth_method { + OFONO_GPRS_AUTH_METHOD_CHAP = 0, + OFONO_GPRS_AUTH_METHOD_PAP, + OFONO_GPRS_AUTH_METHOD_NONE, +}; + const char *ofono_uuid_to_str(const struct ofono_uuid *uuid); void ofono_call_init(struct ofono_call *call); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/cinterion.c ^ |
@@ -209,7 +209,7 @@ ofono_ussd_create(modem, 0, "atmodem", chat); ofono_call_forwarding_create(modem, 0, "atmodem", chat); ofono_call_settings_create(modem, 0, "atmodem", chat); - ofono_netreg_create(modem, OFONO_VENDOR_CINTERION, "atmodem", chat); + ofono_netreg_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", chat); ofono_call_meter_create(modem, 0, "atmodem", chat); ofono_call_barring_create(modem, 0, "atmodem", chat); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/file-provision.c ^ |
@@ -93,7 +93,9 @@ if (value != NULL) (*settings)[0].password = value; - (*settings)[0].auth_method = OFONO_GPRS_AUTH_METHOD_CHAP; + /* select default authentication method */ + (*settings)[0].auth_method = OFONO_GPRS_AUTH_METHOD_NONE; + value = g_key_file_get_string(key_file, setting_group, "internet.AuthenticationMethod", NULL); @@ -104,7 +106,7 @@ else if (g_strcmp0(value, "pap") == 0) (*settings)[0].auth_method = OFONO_GPRS_AUTH_METHOD_PAP; - else + else if (g_strcmp0(value, "none") != 0) DBG("Unknown auth method: %s", value); g_free(value); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/gemalto.c ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2017 Vincent Cesson. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -571,6 +572,10 @@ ofono_devinfo_create(modem, 0, "atmodem", data->app); ofono_location_reporting_create(modem, 0, "gemaltomodem", data->app); + + ofono_modem_set_integer(modem, "GemaltoVtsQuotes", 1); + ofono_voicecall_create(modem, 0, "gemaltomodem", data->app); + data->sim = ofono_sim_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app); @@ -597,8 +602,15 @@ if (gprs && gc) ofono_gprs_add_context(gprs, gc); + ofono_ussd_create(modem, 0, "atmodem", data->app); + + ofono_call_forwarding_create(modem, 0, "atmodem", data->app); + ofono_call_settings_create(modem, 0, "atmodem", data->app); + ofono_call_meter_create(modem, 0, "atmodem", data->app); + ofono_call_barring_create(modem, 0, "atmodem", data->app); + if (!g_strcmp0(model, GEMALTO_MODEL_ALS3_PLS8x)) - ofono_lte_create(modem, OFONO_VENDOR_CINTERION, + ofono_lte_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app); } @@ -608,7 +620,7 @@ DBG("%p", modem); - ofono_netreg_create(modem, OFONO_VENDOR_CINTERION, "atmodem", data->app); + ofono_netreg_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app); } static struct ofono_modem_driver gemalto_driver = { | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/gobi.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <unistd.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/mbim.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <errno.h> #include <fcntl.h> #include <sys/types.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/mbpi.c ^ |
@@ -325,6 +325,8 @@ ap->apn = g_strdup(apn); ap->type = OFONO_GPRS_CONTEXT_TYPE_INTERNET; ap->proto = OFONO_GPRS_PROTO_IP; + + /* pre-select default authentication method */ ap->auth_method = OFONO_GPRS_AUTH_METHOD_CHAP; g_markup_parse_context_push(context, &apn_parser, ap); @@ -395,6 +397,10 @@ if (ap == NULL) return; + /* select authentication method NONE if fit */ + if (!ap->username || !ap->password) + ap->auth_method = OFONO_GPRS_AUTH_METHOD_NONE; + if (gsm->allow_duplicates == FALSE) { GSList *l; | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/phonesim.c ^ |
@@ -803,6 +803,7 @@ set_online_cb, cbd, g_free) > 0) return; + g_free(cbd); CALLBACK_WITH_FAILURE(cb, user_data); } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/sim900.c ^ |
@@ -24,6 +24,7 @@ #endif #include <errno.h> +#include <string.h> #include <stdlib.h> #include <glib.h> #include <gatchat.h> @@ -60,13 +61,66 @@ static const char *none_prefix[] = { NULL }; +enum type { + SIMCOM_UNKNOWN, + SIM800, + SIM900, +}; + struct sim900_data { GIOChannel *device; GAtMux *mux; GAtChat * dlcs[NUM_DLC]; guint frame_size; + enum type modem_type; }; +static void mux_ready_notify(GAtResult *result, gpointer user_data) +{ + struct ofono_modem *modem = user_data; + struct sim900_data *data = ofono_modem_get_data(modem); + struct ofono_gprs *gprs = NULL; + struct ofono_gprs_context *gc; + + ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem", + data->dlcs[SMS_DLC]); + + gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]); + if (gprs == NULL) + return; + + gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM, + "atmodem", data->dlcs[GPRS_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); +} + +static void check_model(gboolean ok, GAtResult *result, gpointer user_data) +{ + struct ofono_modem *modem = user_data; + GAtResultIter iter; + char const *model; + struct sim900_data *data = ofono_modem_get_data(modem); + + DBG(""); + + g_at_result_iter_init(&iter, result); + + while (g_at_result_iter_next(&iter, NULL)) { + if (!g_at_result_iter_next_unquoted_string(&iter, &model)) + continue; + + DBG("setting type %s", model); + + if (strstr(model, "SIM800")) + data->modem_type = SIM800; + else if (strstr(model, "SIM900")) + data->modem_type = SIM800; + else + data->modem_type = SIMCOM_UNKNOWN; + } +} + static int sim900_probe(struct ofono_modem *modem) { struct sim900_data *data; @@ -233,6 +287,14 @@ } } + if (data->modem_type == SIM800) { + for (i = 0; i<NUM_DLC; i++) { + g_at_chat_register(data->dlcs[i], "SMS Ready", + mux_ready_notify, FALSE, + modem, NULL); + } + } + ofono_modem_set_powered(modem, TRUE); return; @@ -294,6 +356,8 @@ return -EINVAL; g_at_chat_send(data->dlcs[SETUP_DLC], "ATE0", NULL, NULL, NULL, NULL); + g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CGMM", NULL, + check_model, modem, NULL); /* For obtain correct sms service number */ g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CSCS=\"GSM\"", NULL, @@ -353,18 +417,24 @@ DBG("%p", modem); - ofono_phonebook_create(modem, 0, "atmodem", data->dlcs[VOICE_DLC]); - ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem", + if (data->modem_type == SIM900) { + ofono_phonebook_create(modem, 0, "atmodem", + data->dlcs[VOICE_DLC]); + ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem", data->dlcs[SMS_DLC]); - gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]); - if (gprs == NULL) - return; - - gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM_SIM900, - "atmodem", data->dlcs[GPRS_DLC]); - if (gc) - ofono_gprs_add_context(gprs, gc); + gprs = ofono_gprs_create(modem, 0, "atmodem", + data->dlcs[GPRS_DLC]); + if (gprs == NULL) + return; + + gc = ofono_gprs_context_create(modem, + OFONO_VENDOR_SIMCOM_SIM900, + "atmodem", + data->dlcs[GPRS_DLC]); + if (gc) + ofono_gprs_add_context(gprs, gc); + } } static void sim900_post_online(struct ofono_modem *modem) | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/udevng.c ^ |
@@ -962,8 +962,6 @@ ofono_modem_set_string(modem->modem, "Device", ctl); ofono_modem_set_string(modem->modem, "NetworkInterface", net); ofono_modem_set_string(modem->modem, "DescriptorFile", descriptors); - ofono_modem_set_string(modem->modem, "Vendor", modem->vendor); - ofono_modem_set_string(modem->modem, "Model", modem->model); return TRUE; } @@ -1195,12 +1193,22 @@ info->interface, info->number, info->label, info->sysattr, info->subsystem); - if (g_strcmp0(info->subsystem, "tty") == 0) { - if (g_strcmp0(info->number, "02") == 0) - mdm = info->devnode; - } else if (g_strcmp0(info->subsystem, "net") == 0) { - if (g_strcmp0(info->number, "00") == 0) - net = info->devnode; + if (g_strcmp0(modem->model,"095a") == 0) { + if (g_strcmp0(info->subsystem, "tty") == 0) { + if (g_strcmp0(info->number, "00") == 0) + mdm = info->devnode; + } else if (g_strcmp0(info->subsystem, "net") == 0) { + if (g_strcmp0(info->number, "06") == 0) + net = info->devnode; + } + } else { + if (g_strcmp0(info->subsystem, "tty") == 0) { + if (g_strcmp0(info->number, "02") == 0) + mdm = info->devnode; + } else if (g_strcmp0(info->subsystem, "net") == 0) { + if (g_strcmp0(info->number, "00") == 0) + net = info->devnode; + } } } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/xmm7xxx.c ^ |
@@ -50,20 +50,911 @@ #include <ofono/lte.h> #include <ofono/ims.h> #include <ofono/sim-auth.h> +#include <ofono/sms.h> +#include <ofono/phonebook.h> +#include <ofono/netmon.h> #include <drivers/atmodem/atutil.h> #include <drivers/atmodem/vendor.h> +#include "ofono.h" +#include "gdbus.h" + +#define OFONO_COEX_INTERFACE OFONO_SERVICE ".intel.LteCoexistence" +#define OFONO_COEX_AGENT_INTERFACE OFONO_SERVICE ".intel.LteCoexistenceAgent" + +#define NET_BAND_LTE_INVALID 0 +#define NET_BAND_LTE_1 101 +#define NET_BAND_LTE_43 143 +#define BAND_LEN 20 +#define MAX_BT_SAFE_VECTOR 15 +#define MAX_WL_SAFE_VECTOR 13 + static const char *none_prefix[] = { NULL }; static const char *xsimstate_prefix[] = { "+XSIMSTATE:", NULL }; +static const char *xnvmplmn_prefix[] = { "+XNVMPLMN:", NULL }; + +struct bt_coex_info { + int safe_tx_min; + int safe_tx_max; + int safe_rx_min; + int safe_rx_max; + int safe_vector[MAX_BT_SAFE_VECTOR]; + int num_safe_vector; +}; + +struct wl_coex_info { + int safe_tx_min; + int safe_tx_max; + int safe_rx_min; + int safe_rx_max; + int safe_vector[MAX_BT_SAFE_VECTOR]; + int num_safe_vector; +}; + +struct coex_agent { + char *path; + char *bus; + guint disconnect_watch; + ofono_bool_t remove_on_terminate; + ofono_destroy_func removed_cb; + void *removed_data; + DBusMessage *msg; +}; struct xmm7xxx_data { GAtChat *chat; /* AT chat */ struct ofono_sim *sim; ofono_bool_t have_sim; ofono_bool_t sms_phonebook_added; + unsigned int netreg_watch; +}; + +/* Coex Implementation */ +enum wlan_bw { + WLAN_BW_UNSUPPORTED = -1, + WLAN_BW_20MHZ = 0, + WLAN_BW_40MHZ = 1, + WLAN_BW_80MHZ = 2, +}; + +struct plmn_hist { + unsigned short mnc; + unsigned short mcc; + unsigned long tdd; + unsigned long fdd; + unsigned char bw; +}; + +struct xmm7xxx_coex { + GAtChat *chat; + struct ofono_modem *modem; + + DBusMessage *pending; + ofono_bool_t bt_active; + ofono_bool_t wlan_active; + enum wlan_bw wlan_bw; + char *lte_band; + + ofono_bool_t pending_bt_active; + ofono_bool_t pending_wlan_active; + enum wlan_bw pending_wlan_bw; + + struct coex_agent *session_agent; }; +static ofono_bool_t coex_agent_matches(struct coex_agent *agent, + const char *path, const char *sender) +{ + return !strcmp(agent->path, path) && !strcmp(agent->bus, sender); +} + +static void coex_agent_set_removed_notify(struct coex_agent *agent, + ofono_destroy_func destroy, + void *user_data) +{ + agent->removed_cb = destroy; + agent->removed_data = user_data; +} + +static void coex_agent_send_noreply(struct coex_agent *agent, + const char *method) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + DBusMessage *message; + + message = dbus_message_new_method_call(agent->bus, agent->path, + OFONO_COEX_INTERFACE, + method); + if (message == NULL) + return; + + dbus_message_set_no_reply(message, TRUE); + g_dbus_send_message(conn, message); +} + +static void coex_agent_send_release(struct coex_agent *agent) +{ + coex_agent_send_noreply(agent, "Release"); +} + +static void coex_agent_free(struct coex_agent *agent) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + + if (agent->disconnect_watch) { + coex_agent_send_release(agent); + + g_dbus_remove_watch(conn, agent->disconnect_watch); + agent->disconnect_watch = 0; + } + + if (agent->removed_cb) + agent->removed_cb(agent->removed_data); + + g_free(agent->path); + g_free(agent->bus); + g_free(agent); +} + +static void coex_agent_disconnect_cb(DBusConnection *conn, void *user_data) +{ + struct coex_agent *agent = user_data; + + ofono_debug("Agent exited without calling Unregister"); + + agent->disconnect_watch = 0; + + coex_agent_free(agent); +} + +static struct coex_agent *coex_agent_new(const char *path, const char *sender, + ofono_bool_t remove_on_terminate) +{ + struct coex_agent *agent = g_try_new0(struct coex_agent, 1); + DBusConnection *conn = ofono_dbus_get_connection(); + + DBG(""); + if (agent == NULL) + return NULL; + + agent->path = g_strdup(path); + agent->bus = g_strdup(sender); + + agent->remove_on_terminate = remove_on_terminate; + + agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender, + coex_agent_disconnect_cb, + agent, NULL); + + return agent; +} + +static int coex_agent_coex_wlan_notify(struct coex_agent *agent, + const struct wl_coex_info wlan_info) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + DBusMessageIter wl_args, wl_dict, wl_array; + const dbus_int32_t *pwl_array = wlan_info.safe_vector; + dbus_int32_t value; + + agent->msg = dbus_message_new_method_call(agent->bus, agent->path, + OFONO_COEX_AGENT_INTERFACE, + "ReceiveWiFiNotification"); + if (agent->msg == NULL) + return -ENOMEM; + + dbus_message_iter_init_append(agent->msg, &wl_args); + + dbus_message_iter_open_container(&wl_args, DBUS_TYPE_ARRAY, + DBUS_TYPE_INT32_AS_STRING, &wl_array); + dbus_message_iter_append_fixed_array(&wl_array, DBUS_TYPE_INT32, + &pwl_array, MAX_WL_SAFE_VECTOR); + + dbus_message_iter_close_container(&wl_args, &wl_array); + + dbus_message_iter_open_container(&wl_args, DBUS_TYPE_ARRAY, + "{sv}", &wl_dict); + + value = wlan_info.safe_tx_min; + ofono_dbus_dict_append(&wl_dict, "SafeTxMin", DBUS_TYPE_UINT32, &value); + value = wlan_info.safe_tx_max; + ofono_dbus_dict_append(&wl_dict, "SafeTxMax", DBUS_TYPE_UINT32, &value); + value = wlan_info.safe_rx_min; + ofono_dbus_dict_append(&wl_dict, "SafeRxMin", DBUS_TYPE_UINT32, &value); + value = wlan_info.safe_rx_max; + ofono_dbus_dict_append(&wl_dict, "SafeRxMax", DBUS_TYPE_UINT32, &value); + value = wlan_info.num_safe_vector; + ofono_dbus_dict_append(&wl_dict, "NumSafeVector", + DBUS_TYPE_UINT32, &value); + + dbus_message_iter_close_container(&wl_args, &wl_dict); + dbus_message_set_no_reply(agent->msg, TRUE); + + if (dbus_connection_send(conn, agent->msg, NULL) == FALSE) + return -EIO; + + dbus_message_unref(agent->msg); + + return 0; +} + +static int coex_agent_coex_bt_notify(struct coex_agent *agent, + const struct bt_coex_info bt_info) +{ + DBusConnection *conn = ofono_dbus_get_connection(); + DBusMessageIter bt_args, bt_dict, bt_array; + const dbus_int32_t *pbt_array = bt_info.safe_vector; + int len = MAX_BT_SAFE_VECTOR; + dbus_int32_t value; + + agent->msg = dbus_message_new_method_call(agent->bus, agent->path, + OFONO_COEX_AGENT_INTERFACE, + "ReceiveBTNotification"); + + if (agent->msg == NULL) + return -ENOMEM; + + pbt_array = bt_info.safe_vector; + + dbus_message_iter_init_append(agent->msg, &bt_args); + + dbus_message_iter_open_container(&bt_args, DBUS_TYPE_ARRAY, + DBUS_TYPE_INT32_AS_STRING, &bt_array); + + dbus_message_iter_append_fixed_array(&bt_array, DBUS_TYPE_INT32, + &pbt_array, len); + + dbus_message_iter_close_container(&bt_args, &bt_array); + + dbus_message_iter_open_container(&bt_args, + DBUS_TYPE_ARRAY, "{sv}", &bt_dict); + + value = bt_info.safe_tx_min; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeTxMin", DBUS_TYPE_UINT32, &value); + + value = bt_info.safe_tx_max; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeTxMax", DBUS_TYPE_UINT32, &value); + + value = bt_info.safe_rx_min; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeRxMin", DBUS_TYPE_UINT32, &value); + + value = bt_info.safe_rx_max; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "SafeRxMax", DBUS_TYPE_UINT32, &value); + + value = bt_info.num_safe_vector; + DBG("value = %d", value); + ofono_dbus_dict_append(&bt_dict, "NumSafeVector", + DBUS_TYPE_UINT32, &value); + + dbus_message_iter_close_container(&bt_args, &bt_dict); + + if (dbus_connection_send(conn, agent->msg, NULL) == FALSE) + return -EIO; + + dbus_message_unref(agent->msg); + + return 0; +} + +static gboolean coex_wlan_bw_from_string(const char *str, + enum wlan_bw *band) +{ + if (g_str_equal(str, "20")) { + *band = WLAN_BW_20MHZ; + return TRUE; + } else if (g_str_equal(str, "40")) { + *band = WLAN_BW_40MHZ; + return TRUE; + } else if (g_str_equal(str, "80")) { + *band = WLAN_BW_80MHZ; + return TRUE; + } else + *band = WLAN_BW_UNSUPPORTED; + + return FALSE; +} + +static const char *wlan_bw_to_string(int band) +{ + switch (band) { + case WLAN_BW_20MHZ: + return "20MHz"; + case WLAN_BW_40MHZ: + return "40MHz"; + case WLAN_BW_80MHZ: + return "80MHz"; + case WLAN_BW_UNSUPPORTED: + return "UnSupported"; + } + + return ""; +} + +static void xmm_get_band_string(int lte_band, char *band) +{ + int band_lte; + + band_lte = lte_band - NET_BAND_LTE_1 + 1; + + if (lte_band >= NET_BAND_LTE_1 && lte_band <= NET_BAND_LTE_43) + sprintf(band, "BAND_LTE_%d", band_lte); + else + sprintf(band, "INVALID"); +} + +static DBusMessage *coex_get_properties(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + DBusMessage *reply; + DBusMessageIter iter; + DBusMessageIter dict; + dbus_bool_t value; + const char *band = NULL; + + reply = dbus_message_new_method_return(msg); + if (reply == NULL) + return NULL; + + dbus_message_iter_init_append(reply, &iter); + + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, + OFONO_PROPERTIES_ARRAY_SIGNATURE, + &dict); + + value = coex->bt_active; + ofono_dbus_dict_append(&dict, "BTActive", + DBUS_TYPE_BOOLEAN, &value); + + value = coex->wlan_active; + ofono_dbus_dict_append(&dict, "WLANActive", + DBUS_TYPE_BOOLEAN, &value); + + band = wlan_bw_to_string(coex->wlan_bw); + ofono_dbus_dict_append(&dict, "WLANBandwidth", + DBUS_TYPE_STRING, &band); + + band = coex->lte_band; + ofono_dbus_dict_append(&dict, "Band", DBUS_TYPE_STRING, &band); + + dbus_message_iter_close_container(&iter, &dict); + + return reply; +} + +static void coex_set_params_cb(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + DBusMessage *reply; + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(coex->modem); + + DBG("ok %d", ok); + + if (!ok) { + coex->pending_bt_active = coex->bt_active; + coex->pending_wlan_active = coex->wlan_active; + coex->pending_wlan_bw = coex->wlan_bw; + reply = __ofono_error_failed(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); + return; + } + + reply = dbus_message_new_method_return(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); + + if (coex->bt_active != coex->pending_bt_active) { + coex->bt_active = coex->pending_bt_active; + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, "BTActive", + DBUS_TYPE_BOOLEAN, &coex->bt_active); + } + + if (coex->wlan_active != coex->pending_wlan_active) { + coex->wlan_active = coex->pending_wlan_active; + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, "WLANActive", + DBUS_TYPE_BOOLEAN, &coex->wlan_active); + } + + if (coex->wlan_bw != coex->pending_wlan_bw) { + const char *str_band = wlan_bw_to_string(coex->wlan_bw); + + coex->wlan_bw = coex->pending_wlan_bw; + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, "WLANBandwidth", + DBUS_TYPE_STRING, &str_band); + } +} + +static void coex_set_params(struct xmm7xxx_coex *coex, ofono_bool_t bt_active, + ofono_bool_t wlan_active, int wlan_bw) +{ + char buf[64]; + DBusMessage *reply; + + DBG(""); + sprintf(buf, "AT+XNRTCWS=65535,%u,%u,%u", (int)wlan_active, + wlan_bw, bt_active); + + if (g_at_chat_send(coex->chat, buf, none_prefix, + coex_set_params_cb, coex, NULL) > 0) + return; + + coex->pending_bt_active = coex->bt_active; + coex->pending_wlan_active = coex->wlan_active; + coex->pending_wlan_bw = coex->wlan_bw; + reply = __ofono_error_failed(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); +} + +static DBusMessage *coex_set_property(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + DBusMessageIter iter; + DBusMessageIter var; + const char *property; + dbus_bool_t value; + + if (coex->pending) + return __ofono_error_busy(msg); + + if (!dbus_message_iter_init(msg, &iter)) + return __ofono_error_invalid_args(msg); + + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&iter, &property); + dbus_message_iter_next(&iter); + + if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_recurse(&iter, &var); + + if (!strcmp(property, "BTActive")) { + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&var, &value); + + if (coex->bt_active == (ofono_bool_t) value) + return dbus_message_new_method_return(msg); + + coex->pending_bt_active = value; + coex->pending = dbus_message_ref(msg); + + coex_set_params(coex, value, coex->wlan_active, coex->wlan_bw); + return NULL; + } else if (!strcmp(property, "WLANActive")) { + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&var, &value); + + if (coex->wlan_active == (ofono_bool_t) value) + return dbus_message_new_method_return(msg); + + coex->pending_wlan_active = value; + coex->pending = dbus_message_ref(msg); + + coex_set_params(coex, coex->bt_active, value, coex->wlan_bw); + return NULL; + } else if (g_strcmp0(property, "WLANBandwidth") == 0) { + const char *value; + enum wlan_bw band; + + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_STRING) + return __ofono_error_invalid_args(msg); + + dbus_message_iter_get_basic(&var, &value); + if (coex_wlan_bw_from_string(value, &band) == FALSE) + return __ofono_error_invalid_args(msg); + + if (coex->wlan_bw == band) + return dbus_message_new_method_return(msg); + + coex->pending_wlan_bw = band; + coex->pending = dbus_message_ref(msg); + + coex_set_params(coex, coex->bt_active, coex->wlan_active, band); + return NULL; + } else { + return __ofono_error_invalid_args(msg); + } + + return dbus_message_new_method_return(msg); +} + +static void coex_default_agent_notify(gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + + g_at_chat_send(coex->chat, "AT+XNRTCWS=0", none_prefix, + NULL, NULL, NULL); + + coex->session_agent = NULL; +} + +static DBusMessage *coex_register_agent(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + const char *agent_path; + + if (coex->session_agent) { + DBG("Coexistence agent already registered"); + return __ofono_error_busy(msg); + } + + if (dbus_message_get_args(msg, NULL, + DBUS_TYPE_OBJECT_PATH, &agent_path, + DBUS_TYPE_INVALID) == FALSE) + return __ofono_error_invalid_args(msg); + + if (!dbus_validate_path(agent_path, NULL)) + return __ofono_error_invalid_format(msg); + + coex->session_agent = coex_agent_new(agent_path, + dbus_message_get_sender(msg), + FALSE); + + if (coex->session_agent == NULL) + return __ofono_error_failed(msg); + + coex_agent_set_removed_notify(coex->session_agent, + coex_default_agent_notify, coex); + + return dbus_message_new_method_return(msg); +} + +static DBusMessage *coex_unregister_agent(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + const char *agent_path; + const char *agent_bus = dbus_message_get_sender(msg); + + if (dbus_message_get_args(msg, NULL, + DBUS_TYPE_OBJECT_PATH, &agent_path, + DBUS_TYPE_INVALID) == FALSE) + return __ofono_error_invalid_args(msg); + + if (coex->session_agent == NULL) + return __ofono_error_failed(msg); + + if (!coex_agent_matches(coex->session_agent, agent_path, agent_bus)) + return __ofono_error_failed(msg); + + coex_agent_send_release(coex->session_agent); + coex_agent_free(coex->session_agent); + + g_at_chat_send(coex->chat, "AT+XNRTCWS=0", none_prefix, + NULL, NULL, NULL); + + return dbus_message_new_method_return(msg); +} + +static void append_plmn_properties(struct plmn_hist *list, + DBusMessageIter *dict) +{ + ofono_dbus_dict_append(dict, "MobileCountryCode", + DBUS_TYPE_UINT16, &list->mcc); + ofono_dbus_dict_append(dict, "MobileNetworkCode", + DBUS_TYPE_UINT16, &list->mnc); + ofono_dbus_dict_append(dict, "LteBandsFDD", + DBUS_TYPE_UINT32, &list->fdd); + ofono_dbus_dict_append(dict, "LteBandsTDD", + DBUS_TYPE_UINT32, &list->tdd); + ofono_dbus_dict_append(dict, "ChannelBandwidth", + DBUS_TYPE_UINT32, &list->bw); +} + +static void append_plmn_history_struct_list(struct plmn_hist *list, + DBusMessageIter *arr) +{ + DBusMessageIter iter; + DBusMessageIter dict; + + dbus_message_iter_open_container(arr, DBUS_TYPE_STRUCT, NULL, &iter); + + dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, + OFONO_PROPERTIES_ARRAY_SIGNATURE, + &dict); + + append_plmn_properties(list, &dict); + + dbus_message_iter_close_container(&iter, &dict); + + dbus_message_iter_close_container(arr, &iter); +} + +static void coex_get_plmn_history_cb(gboolean ok, GAtResult *result, + gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + struct plmn_hist *list = NULL; + GAtResultIter iter; + int list_size = 0, count; + DBusMessage *reply; + DBusMessageIter itr, arr; + int value; + + DBG("ok %d", ok); + + if (!ok) { + __ofono_dbus_pending_reply(&coex->pending, + __ofono_error_failed(coex->pending)); + return; + } + + g_at_result_iter_init(&iter, result); + + while (g_at_result_iter_next(&iter, "+XNVMPLMN:")) { + if (!list_size) + list = g_new0(struct plmn_hist, ++list_size); + else + list = g_renew(struct plmn_hist, list, ++list_size); + + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].mcc = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].mnc = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].fdd = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].tdd = value; + g_at_result_iter_next_number(&iter, &value); + list[list_size - 1].bw = value; + + DBG("list_size = %d", list_size); + } + + reply = dbus_message_new_method_return(coex->pending); + dbus_message_iter_init_append(reply, &itr); + + dbus_message_iter_open_container(&itr, DBUS_TYPE_ARRAY, + DBUS_STRUCT_BEGIN_CHAR_AS_STRING + DBUS_TYPE_ARRAY_AS_STRING + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING + DBUS_STRUCT_END_CHAR_AS_STRING, + &arr); + + for (count = 0; count < list_size; count++) + append_plmn_history_struct_list(list, &arr); + + dbus_message_iter_close_container(&itr, &arr); + + reply = dbus_message_new_method_return(coex->pending); + __ofono_dbus_pending_reply(&coex->pending, reply); + + g_free(list); +} + +static DBusMessage *coex_get_plmn_history(DBusConnection *conn, + DBusMessage *msg, void *data) +{ + struct xmm7xxx_coex *coex = data; + + if (coex->pending) + return __ofono_error_busy(msg); + + if (!g_at_chat_send(coex->chat, "AT+XNVMPLMN=2,2", xnvmplmn_prefix, + coex_get_plmn_history_cb, coex, NULL)) + return __ofono_error_failed(msg); + + coex->pending = dbus_message_ref(msg); + return NULL; +} + +static const GDBusMethodTable coex_methods[] = { + { GDBUS_METHOD("GetProperties", + NULL, GDBUS_ARGS({ "properties", "a{sv}" }), + coex_get_properties) }, + { GDBUS_METHOD("SetProperty", + GDBUS_ARGS({ "property", "s" }, { "value", "v" }), + NULL, coex_set_property) }, + { GDBUS_METHOD("RegisterAgent", + GDBUS_ARGS({ "path", "o" }), NULL, + coex_register_agent) }, + { GDBUS_METHOD("UnregisterAgent", + GDBUS_ARGS({ "path", "o" }), NULL, + coex_unregister_agent) }, + { GDBUS_ASYNC_METHOD("GetPlmnHistory", + NULL, GDBUS_ARGS({ "plmnhistory", "a(a{sv})" }), + coex_get_plmn_history) }, + { } +}; + +static const GDBusSignalTable coex_signals[] = { + { GDBUS_SIGNAL("PropertyChanged", + GDBUS_ARGS({ "name", "s" }, { "value", "v" })) }, + { } +}; + +static void xmm_coex_w_notify(GAtResult *result, gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + GAtResultIter iter; + int count; + struct wl_coex_info wlan; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+XNRTCWSW:")) + return; + + g_at_result_iter_next_number(&iter, &wlan.safe_rx_min); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.safe_rx_max); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.safe_tx_min); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.safe_tx_max); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_next_number(&iter, &wlan.num_safe_vector); + + for (count = 0; count < wlan.num_safe_vector; count++) + g_at_result_iter_next_number(&iter, &wlan.safe_vector[count]); + + DBG("WLAN notification"); + + if (coex->session_agent) + coex_agent_coex_wlan_notify(coex->session_agent, wlan); +} + +static void xmm_coex_b_notify(GAtResult *result, gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + GAtResultIter iter; + struct bt_coex_info bt; + int count; + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+XNRTCWSB:")) + return; + + g_at_result_iter_next_number(&iter, &bt.safe_rx_min); + g_at_result_iter_next_number(&iter, &bt.safe_rx_max); + g_at_result_iter_next_number(&iter, &bt.safe_tx_min); + g_at_result_iter_next_number(&iter, &bt.safe_tx_max); + g_at_result_iter_next_number(&iter, &bt.num_safe_vector); + + for (count = 0; count < bt.num_safe_vector; count++) + g_at_result_iter_next_number(&iter, &bt.safe_vector[count]); + + DBG("BT notification"); + + if (coex->session_agent) + coex_agent_coex_bt_notify(coex->session_agent, bt); +} + +static void xmm_lte_band_notify(GAtResult *result, gpointer user_data) +{ + struct xmm7xxx_coex *coex = user_data; + GAtResultIter iter; + int lte_band; + char band[BAND_LEN]; + const char *path = ofono_modem_get_path(coex->modem); + DBusConnection *conn = ofono_dbus_get_connection(); + + g_at_result_iter_init(&iter, result); + + if (!g_at_result_iter_next(&iter, "+XCCINFO:")) + return; + + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + g_at_result_iter_skip_next(&iter); + + if (!g_at_result_iter_next_number(&iter, <e_band)) + return; + + xmm_get_band_string(lte_band, band); + DBG("band %s", band); + + if (!strcmp(band, coex->lte_band)) + return; + + g_free(coex->lte_band); + coex->lte_band = g_strdup(band); + + if (coex->lte_band == NULL) + return; + + ofono_dbus_signal_property_changed(conn, path, + OFONO_COEX_INTERFACE, + "Band", DBUS_TYPE_STRING, &coex->lte_band); +} + +static void coex_cleanup(void *data) +{ + struct xmm7xxx_coex *coex = data; + + if (coex->pending) + __ofono_dbus_pending_reply(&coex->pending, + __ofono_error_canceled(coex->pending)); + + if (coex->session_agent) { + coex_agent_free(coex->session_agent); + + g_at_chat_send(coex->chat, "AT+XNRTCWS=0", none_prefix, + NULL, NULL, NULL); + } + + g_free(coex->lte_band); + g_free(coex); +} + +static int xmm_coex_enable(struct ofono_modem *modem, void *data) +{ + struct xmm7xxx_coex *coex = g_new0(struct xmm7xxx_coex, 1); + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + + DBG("coex enable"); + + coex->chat = data; + coex->modem = modem; + coex->bt_active = 0; + coex->wlan_active = 0; + coex->wlan_bw = WLAN_BW_20MHZ; + coex->lte_band = g_strdup("INVALID"); + coex->session_agent = NULL; + + if (!g_at_chat_send(coex->chat, "AT+XCCINFO=1", none_prefix, + NULL, NULL, NULL)) + goto out; + + if (!g_at_chat_send(coex->chat, "AT+XNRTCWS=7", none_prefix, + NULL, NULL, NULL)) + goto out; + + if (!g_dbus_register_interface(conn, path, OFONO_COEX_INTERFACE, + coex_methods, + coex_signals, + NULL, coex, coex_cleanup)) { + ofono_error("Could not register %s interface under %s", + OFONO_COEX_INTERFACE, path); + goto out; + } + + ofono_modem_add_interface(modem, OFONO_COEX_INTERFACE); + + g_at_chat_register(coex->chat, "+XNRTCWSW:", xmm_coex_w_notify, + FALSE, coex, NULL); + g_at_chat_register(coex->chat, "+XNRTCWSB:", xmm_coex_b_notify, + FALSE, coex, NULL); + g_at_chat_register(coex->chat, "+XCCINFO:", xmm_lte_band_notify, + FALSE, coex, NULL); + return 0; + +out: + g_free(coex->lte_band); + g_free(coex); + return -EIO; +} + +/* Coex Implementation Ends*/ + static void xmm7xxx_debug(const char *str, void *user_data) { const char *prefix = user_data; @@ -126,15 +1017,28 @@ data->sms_phonebook_added = FALSE; } break; + case 1: /* SIM inserted, PIN verification needed */ + if (data->have_sim == FALSE) { + ofono_sim_inserted_notify(data->sim, TRUE); + data->have_sim = TRUE; + } + break; case 2: /* SIM inserted, PIN verification not needed - READY */ case 3: /* SIM inserted, PIN verified - READY */ - case 7: + case 7: /* SIM inserted, SMS and phonebook - READY */ if (data->have_sim == FALSE) { ofono_sim_inserted_notify(data->sim, TRUE); data->have_sim = TRUE; } ofono_sim_initialized_notify(data->sim); + + if (data->sms_phonebook_added == FALSE) { + ofono_phonebook_create(modem, 0, "atmodem", data->chat); + ofono_sms_create(modem, 0, "atmodem", data->chat); + data->sms_phonebook_added = TRUE; + } + break; default: ofono_warn("Unknown SIM state %d received", status); @@ -226,6 +1130,29 @@ xsimstate_query_cb, modem, NULL); } +static void netreg_watch(struct ofono_atom *atom, + enum ofono_atom_watch_condition cond, + void *data) +{ + struct ofono_modem *modem = data; + struct xmm7xxx_data *modem_data = ofono_modem_get_data(modem); + DBusConnection *conn = ofono_dbus_get_connection(); + const char *path = ofono_modem_get_path(modem); + + if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) { + if (g_dbus_unregister_interface(conn, path, + OFONO_COEX_INTERFACE)) + ofono_modem_remove_interface(modem, + OFONO_COEX_INTERFACE); + return; + } + + if (cond == OFONO_ATOM_WATCH_CONDITION_REGISTERED) { + xmm_coex_enable(modem, modem_data->chat); + return; + } +} + static int xmm7xxx_enable(struct ofono_modem *modem) { struct xmm7xxx_data *data = ofono_modem_get_data(modem); @@ -247,6 +1174,10 @@ g_at_chat_send(data->chat, "AT+CFUN=4", none_prefix, cfun_enable_cb, modem, NULL); + data->netreg_watch = __ofono_modem_add_atom_watch(modem, + OFONO_ATOM_TYPE_NETREG, + netreg_watch, modem, NULL); + return -EINPROGRESS; } @@ -277,6 +1208,11 @@ g_at_chat_send(data->chat, "AT+CFUN=0", none_prefix, cfun_disable_cb, modem, NULL); + if (data->netreg_watch) { + __ofono_modem_remove_atom_watch(modem, data->netreg_watch); + data->netreg_watch = 0; + } + return -EINPROGRESS; } @@ -347,6 +1283,7 @@ ofono_gprs_add_context(gprs, gc); ofono_ims_create(modem, "xmm7modem", data->chat); + ofono_netmon_create(modem, 0, "xmm7modem", data->chat); } static int xmm7xxx_probe(struct ofono_modem *modem) | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/call-volume.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/cdma-smsutil.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <dirent.h> #include <sys/types.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/common.c ^ |
@@ -669,6 +669,10 @@ return "unknown"; case NETWORK_REGISTRATION_STATUS_ROAMING: return "roaming"; + case NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN: + return "registered"; + case NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN: + return "roaming"; } return ""; @@ -765,3 +769,64 @@ return "unknown"; } + +const char *gprs_proto_to_string(enum ofono_gprs_proto proto) +{ + switch (proto) { + case OFONO_GPRS_PROTO_IP: + return "ip"; + case OFONO_GPRS_PROTO_IPV6: + return "ipv6"; + case OFONO_GPRS_PROTO_IPV4V6: + return "dual"; + }; + + return NULL; +} + +gboolean gprs_proto_from_string(const char *str, enum ofono_gprs_proto *proto) +{ + if (g_str_equal(str, "ip")) { + *proto = OFONO_GPRS_PROTO_IP; + return TRUE; + } else if (g_str_equal(str, "ipv6")) { + *proto = OFONO_GPRS_PROTO_IPV6; + return TRUE; + } else if (g_str_equal(str, "dual")) { + *proto = OFONO_GPRS_PROTO_IPV4V6; + return TRUE; + } + + return FALSE; +} + +const char *gprs_auth_method_to_string(enum ofono_gprs_auth_method auth) +{ + switch (auth) { + case OFONO_GPRS_AUTH_METHOD_CHAP: + return "chap"; + case OFONO_GPRS_AUTH_METHOD_PAP: + return "pap"; + case OFONO_GPRS_AUTH_METHOD_NONE: + return "none"; + }; + + return NULL; +} + +gboolean gprs_auth_method_from_string(const char *str, + enum ofono_gprs_auth_method *auth) +{ + if (g_str_equal(str, "chap")) { + *auth = OFONO_GPRS_AUTH_METHOD_CHAP; + return TRUE; + } else if (g_str_equal(str, "pap")) { + *auth = OFONO_GPRS_AUTH_METHOD_PAP; + return TRUE; + } else if (g_str_equal(str, "none")) { + *auth = OFONO_GPRS_AUTH_METHOD_NONE; + return TRUE; + } + + return FALSE; +} | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/common.h ^ |
@@ -37,12 +37,14 @@ /* 27.007 Section 7.2 <stat> */ enum network_registration_status { - NETWORK_REGISTRATION_STATUS_NOT_REGISTERED = 0, - NETWORK_REGISTRATION_STATUS_REGISTERED = 1, - NETWORK_REGISTRATION_STATUS_SEARCHING = 2, - NETWORK_REGISTRATION_STATUS_DENIED = 3, - NETWORK_REGISTRATION_STATUS_UNKNOWN = 4, - NETWORK_REGISTRATION_STATUS_ROAMING = 5, + NETWORK_REGISTRATION_STATUS_NOT_REGISTERED = 0, + NETWORK_REGISTRATION_STATUS_REGISTERED = 1, + NETWORK_REGISTRATION_STATUS_SEARCHING = 2, + NETWORK_REGISTRATION_STATUS_DENIED = 3, + NETWORK_REGISTRATION_STATUS_UNKNOWN = 4, + NETWORK_REGISTRATION_STATUS_ROAMING = 5, + NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN = 6, + NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN = 7, }; /* 27.007 Section 7.3 <stat> */ @@ -185,3 +187,10 @@ gboolean is_valid_apn(const char *apn); const char *call_status_to_string(enum call_status status); + +const char *gprs_proto_to_string(enum ofono_gprs_proto proto); +gboolean gprs_proto_from_string(const char *str, enum ofono_gprs_proto *proto); + +const char *gprs_auth_method_to_string(enum ofono_gprs_auth_method auth); +gboolean gprs_auth_method_from_string(const char *str, + enum ofono_gprs_auth_method *auth); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/gnss.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <stdlib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/gnssagent.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <string.h> #include <errno.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/gprs.c ^ |
@@ -223,63 +223,6 @@ return FALSE; } -static const char *gprs_proto_to_string(enum ofono_gprs_proto proto) -{ - switch (proto) { - case OFONO_GPRS_PROTO_IP: - return "ip"; - case OFONO_GPRS_PROTO_IPV6: - return "ipv6"; - case OFONO_GPRS_PROTO_IPV4V6: - return "dual"; - }; - - return NULL; -} - -static gboolean gprs_proto_from_string(const char *str, - enum ofono_gprs_proto *proto) -{ - if (g_str_equal(str, "ip")) { - *proto = OFONO_GPRS_PROTO_IP; - return TRUE; - } else if (g_str_equal(str, "ipv6")) { - *proto = OFONO_GPRS_PROTO_IPV6; - return TRUE; - } else if (g_str_equal(str, "dual")) { - *proto = OFONO_GPRS_PROTO_IPV4V6; - return TRUE; - } - - return FALSE; -} - -static const char *gprs_auth_method_to_string(enum ofono_gprs_auth_method auth) -{ - switch (auth) { - case OFONO_GPRS_AUTH_METHOD_CHAP: - return "chap"; - case OFONO_GPRS_AUTH_METHOD_PAP: - return "pap"; - }; - - return NULL; -} - -static gboolean gprs_auth_method_from_string(const char *str, - enum ofono_gprs_auth_method *auth) -{ - if (g_str_equal(str, "chap")) { - *auth = OFONO_GPRS_AUTH_METHOD_CHAP; - return TRUE; - } else if (g_str_equal(str, "pap")) { - *auth = OFONO_GPRS_AUTH_METHOD_PAP; - return TRUE; - } - - return FALSE; -} - static unsigned int gprs_cid_alloc(struct ofono_gprs *gprs) { return idmap_alloc(gprs->cid_map); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/handsfree.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/idmap.c ^ |
@@ -24,7 +24,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <glib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/lte.c ^ |
@@ -3,6 +3,7 @@ * oFono - Open Source Telephony * * Copyright (C) 2016 Endocode AG. All rights reserved. + * Copyright (C) 2018 Gemalto M2M * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -39,7 +40,11 @@ #define SETTINGS_STORE "lte" #define SETTINGS_GROUP "Settings" -#define DEFAULT_APN_KEY "DefaultAccessPointName" +#define LTE_APN "DefaultAccessPointName" +#define LTE_PROTO "Protocol" +#define LTE_USERNAME "Username" +#define LTE_PASSWORD "Password" +#define LTE_AUTH_METHOD "AuthenticationMethod" struct ofono_lte { const struct ofono_lte_driver *driver; @@ -57,6 +62,10 @@ static void lte_load_settings(struct ofono_lte *lte) { char *apn; + char *proto_str; + char *auth_method_str; + char *username; + char *password; if (lte->imsi == NULL) return; @@ -69,19 +78,57 @@ return; } - apn = g_key_file_get_string(lte->settings, SETTINGS_GROUP , - DEFAULT_APN_KEY, NULL); - if (apn) { + apn = g_key_file_get_string(lte->settings, SETTINGS_GROUP, + LTE_APN, NULL); + proto_str = g_key_file_get_string(lte->settings, SETTINGS_GROUP, + LTE_PROTO, NULL); + auth_method_str = g_key_file_get_string(lte->settings, SETTINGS_GROUP, + LTE_AUTH_METHOD, NULL); + username = g_key_file_get_string(lte->settings, SETTINGS_GROUP, + LTE_USERNAME, NULL); + password = g_key_file_get_string(lte->settings, SETTINGS_GROUP, + LTE_PASSWORD, NULL); + if (apn && is_valid_apn(apn)) strcpy(lte->info.apn, apn); - g_free(apn); - } + + if (proto_str == NULL) + proto_str = g_strdup("ip"); + + /* this must have a valid default */ + if (!gprs_proto_from_string(proto_str, <e->info.proto)) + lte->info.proto = OFONO_GPRS_PROTO_IP; + + if (auth_method_str == NULL) + auth_method_str = g_strdup("none"); + + /* this must have a valid default */ + if (!gprs_auth_method_from_string(auth_method_str, + <e->info.auth_method)) + lte->info.auth_method = OFONO_GPRS_AUTH_METHOD_NONE; + + if (username && strlen(username) <= OFONO_GPRS_MAX_USERNAME_LENGTH) + strcpy(lte->info.username, username); + + if (password && strlen(password) <= OFONO_GPRS_MAX_PASSWORD_LENGTH) + strcpy(lte->info.password, password); + + g_free(apn); + g_free(proto_str); + g_free(auth_method_str); + g_free(username); + g_free(password); } static DBusMessage *lte_get_properties(DBusConnection *conn, DBusMessage *msg, void *data) { struct ofono_lte *lte = data; + const char *proto = gprs_proto_to_string(lte->info.proto); const char *apn = lte->info.apn; + const char* auth_method = + gprs_auth_method_to_string(lte->info.auth_method); + const char *username = lte->info.username; + const char *password = lte->info.password; DBusMessage *reply; DBusMessageIter iter; DBusMessageIter dict; @@ -95,20 +142,31 @@ dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY, OFONO_PROPERTIES_ARRAY_SIGNATURE, &dict); - ofono_dbus_dict_append(&dict, DEFAULT_APN_KEY, DBUS_TYPE_STRING, &apn); + ofono_dbus_dict_append(&dict, LTE_APN, DBUS_TYPE_STRING, &apn); + ofono_dbus_dict_append(&dict, LTE_PROTO, DBUS_TYPE_STRING, &proto); + ofono_dbus_dict_append(&dict, LTE_AUTH_METHOD, DBUS_TYPE_STRING, + &auth_method); + ofono_dbus_dict_append(&dict, LTE_USERNAME, DBUS_TYPE_STRING, + &username); + ofono_dbus_dict_append(&dict, LTE_PASSWORD, DBUS_TYPE_STRING, + &password); dbus_message_iter_close_container(&iter, &dict); return reply; } static void lte_set_default_attach_info_cb(const struct ofono_error *error, - void *data) + void *data) { struct ofono_lte *lte = data; const char *path = __ofono_atom_get_path(lte->atom); DBusConnection *conn = ofono_dbus_get_connection(); DBusMessage *reply; - const char *apn = lte->info.apn; + char *key; + char *value; + const char *str; + DBusMessageIter iter; + DBusMessageIter var; DBG("%s error %d", path, error->type); @@ -118,55 +176,48 @@ return; } - g_strlcpy(lte->info.apn, lte->pending_info.apn, - OFONO_GPRS_MAX_APN_LENGTH + 1); + /* + * Reparsing of the message to extract the key and value + * No error checking needed since we already validated pending + */ + dbus_message_iter_init(lte->pending, &iter); + dbus_message_iter_get_basic(&iter, &str); + key = strdup(str); + + dbus_message_iter_next(&iter); + dbus_message_iter_recurse(&iter, &var); + dbus_message_iter_get_basic(&var, &str); + value = strdup(str); + + memcpy(<e->info, <e->pending_info, sizeof(lte->info)); + + reply = dbus_message_new_method_return(lte->pending); + __ofono_dbus_pending_reply(<e->pending, reply); if (lte->settings) { - if (strlen(lte->info.apn) == 0) - /* Clear entry on empty APN. */ - g_key_file_remove_key(lte->settings, SETTINGS_GROUP, - DEFAULT_APN_KEY, NULL); + /* + * the following code removes from storage empty APN, user, pwd + * for proto and auth_method, given that they always + * have defaults, it will not do anything. + */ + if (!*value) + /* Clear entry on empty string. */ + g_key_file_remove_key(lte->settings, + SETTINGS_GROUP, key, NULL); else - g_key_file_set_string(lte->settings, SETTINGS_GROUP, - DEFAULT_APN_KEY, lte->info.apn); + g_key_file_set_string(lte->settings, + SETTINGS_GROUP, key, value); storage_sync(lte->imsi, SETTINGS_STORE, lte->settings); } - reply = dbus_message_new_method_return(lte->pending); - __ofono_dbus_pending_reply(<e->pending, reply); - ofono_dbus_signal_property_changed(conn, path, OFONO_CONNECTION_CONTEXT_INTERFACE, - DEFAULT_APN_KEY, - DBUS_TYPE_STRING, &apn); -} - -static DBusMessage *lte_set_default_apn(struct ofono_lte *lte, - DBusConnection *conn, DBusMessage *msg, - const char *apn) -{ - if (lte->driver->set_default_attach_info == NULL) - return __ofono_error_not_implemented(msg); - - if (lte->pending) - return __ofono_error_busy(msg); + key, + DBUS_TYPE_STRING, &value); - if (g_str_equal(apn, lte->info.apn)) - return dbus_message_new_method_return(msg); - - /* We do care about empty value: it can be used for reset. */ - if (is_valid_apn(apn) == FALSE && apn[0] != '\0') - return __ofono_error_invalid_format(msg); - - lte->pending = dbus_message_ref(msg); - - g_strlcpy(lte->pending_info.apn, apn, OFONO_GPRS_MAX_APN_LENGTH + 1); - - lte->driver->set_default_attach_info(lte, <e->pending_info, - lte_set_default_attach_info_cb, lte); - - return NULL; + g_free(value); + g_free(key); } static DBusMessage *lte_set_property(DBusConnection *conn, @@ -177,6 +228,14 @@ DBusMessageIter var; const char *property; const char *str; + enum ofono_gprs_auth_method auth_method; + enum ofono_gprs_proto proto; + + if (lte->driver->set_default_attach_info == NULL) + return __ofono_error_not_implemented(msg); + + if (lte->pending) + return __ofono_error_busy(msg); if (!dbus_message_iter_init(msg, &iter)) return __ofono_error_invalid_args(msg); @@ -192,16 +251,65 @@ dbus_message_iter_recurse(&iter, &var); - if (!strcmp(property, DEFAULT_APN_KEY)) { - if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_STRING) - return __ofono_error_invalid_args(msg); + if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_STRING) + return __ofono_error_invalid_args(msg); - dbus_message_iter_get_basic(&var, &str); + dbus_message_iter_get_basic(&var, &str); - return lte_set_default_apn(lte, conn, msg, str); - } + memcpy(<e->pending_info, <e->info, sizeof(lte->info)); + + if ((strcmp(property, LTE_APN) == 0)) { + if (g_str_equal(str, lte->info.apn)) + return dbus_message_new_method_return(msg); + + /* We do care about empty value: it can be used for reset. */ + if (is_valid_apn(str) == FALSE && str[0] != '\0') + return __ofono_error_invalid_format(msg); + + g_strlcpy(lte->pending_info.apn, str, + OFONO_GPRS_MAX_APN_LENGTH + 1); + } else if ((strcmp(property, LTE_PROTO) == 0)) { + if (!gprs_proto_from_string(str, &proto)) + return __ofono_error_invalid_format(msg); + + if (proto == lte->info.proto) + return dbus_message_new_method_return(msg); + + lte->pending_info.proto = proto; + } else if (strcmp(property, LTE_AUTH_METHOD) == 0) { + if (!gprs_auth_method_from_string(str, &auth_method)) + return __ofono_error_invalid_format(msg); + + if (auth_method == lte->info.auth_method) + return dbus_message_new_method_return(msg); + + lte->pending_info.auth_method = auth_method; + } else if (strcmp(property, LTE_USERNAME) == 0) { + if (strlen(str) > OFONO_GPRS_MAX_USERNAME_LENGTH) + return __ofono_error_invalid_format(msg); + + if (g_str_equal(str, lte->info.username)) + return dbus_message_new_method_return(msg); + + g_strlcpy(lte->pending_info.username, str, + OFONO_GPRS_MAX_USERNAME_LENGTH + 1); + } else if (strcmp(property, LTE_PASSWORD) == 0) { + if (strlen(str) > OFONO_GPRS_MAX_PASSWORD_LENGTH) + return __ofono_error_invalid_format(msg); + + if (g_str_equal(str, lte->info.password)) + return dbus_message_new_method_return(msg); + + g_strlcpy(lte->pending_info.password, str, + OFONO_GPRS_MAX_PASSWORD_LENGTH + 1); + } else + return __ofono_error_invalid_args(msg); + + lte->pending = dbus_message_ref(msg); + lte->driver->set_default_attach_info(lte, <e->pending_info, + lte_set_default_attach_info_cb, lte); - return __ofono_error_invalid_args(msg); + return NULL; } static const GDBusMethodTable lte_methods[] = { | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/main.c ^ |
@@ -32,9 +32,7 @@ #include <gdbus.h> -#ifdef HAVE_ELL #include <ell/ell.h> -#endif #include "ofono.h" @@ -174,7 +172,6 @@ { NULL }, }; -#ifdef HAVE_ELL struct ell_event_source { GSource source; GPollFD pollfd; @@ -198,7 +195,6 @@ .prepare = event_prepare, .check = event_check, }; -#endif int main(int argc, char **argv) { @@ -207,9 +203,7 @@ DBusConnection *conn; DBusError error; guint signal; -#ifdef HAVE_ELL struct ell_event_source *source; -#endif context = g_option_context_new(NULL); g_option_context_add_main_entries(context, options, NULL); @@ -241,7 +235,6 @@ event_loop = g_main_loop_new(NULL, FALSE); -#ifdef HAVE_ELL l_log_set_stderr(); l_debug_enable("*"); l_main_init(); @@ -255,8 +248,6 @@ g_source_add_poll((GSource *)source, &source->pollfd); g_source_attach((GSource *) source, g_main_loop_get_context(event_loop)); -#endif - signal = setup_signalfd(); @@ -305,10 +296,9 @@ cleanup: g_source_remove(signal); -#ifdef HAVE_ELL g_source_destroy((GSource *) source); l_main_exit(); -#endif + g_main_loop_unref(event_loop); __ofono_log_cleanup(); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/modem.c ^ |
@@ -34,15 +34,17 @@ #include "common.h" -static GSList *g_devinfo_drivers = NULL; -static GSList *g_driver_list = NULL; -static GSList *g_modem_list = NULL; - -static int next_modem_id = 0; -static gboolean powering_down = FALSE; -static int modems_remaining = 0; +#define DEFAULT_POWERED_TIMEOUT (20) -static struct ofono_watchlist *g_modemwatches = NULL; +static GSList *g_devinfo_drivers; +static GSList *g_driver_list; +static GSList *g_modem_list; + +static int next_modem_id; +static gboolean powering_down; +static int modems_remaining; + +static struct ofono_watchlist *g_modemwatches; enum property_type { PROPERTY_TYPE_INVALID = 0, @@ -75,6 +77,7 @@ char *lock_owner; guint lock_watch; guint timeout; + guint timeout_hint; ofono_bool_t online; struct ofono_watchlist *online_watches; struct ofono_watchlist *powered_watches; @@ -1055,7 +1058,7 @@ } modem->pending = dbus_message_ref(msg); - modem->timeout = g_timeout_add_seconds(20, + modem->timeout = g_timeout_add_seconds(modem->timeout_hint, set_powered_timeout, modem); return NULL; } @@ -1133,7 +1136,8 @@ return __ofono_error_failed(msg); modem->pending = dbus_message_ref(msg); - modem->timeout = g_timeout_add_seconds(20, + modem->timeout = g_timeout_add_seconds( + modem->timeout_hint, set_powered_timeout, modem); return NULL; } @@ -1843,6 +1847,12 @@ return value; } +void ofono_modem_set_powered_timeout_hint(struct ofono_modem *modem, + unsigned int seconds) +{ + modem->timeout_hint = seconds; +} + void ofono_modem_set_name(struct ofono_modem *modem, const char *name) { if (modem->name) @@ -1904,6 +1914,7 @@ modem->driver_type = g_strdup(type); modem->properties = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, unregister_property); + modem->timeout_hint = DEFAULT_POWERED_TIMEOUT; g_modem_list = g_slist_prepend(g_modem_list, modem); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/netmonagent.c ^ |
@@ -2,7 +2,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <string.h> #include <errno.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/ofono.conf ^ |
@@ -16,6 +16,7 @@ <allow send_interface="org.ofono.PositioningRequestAgent"/> <allow send_interface="org.ofono.HandsfreeAudioAgent"/> <allow send_interface="org.ofono.NetworkMonitorAgent"/> + <allow send_interface="org.ofono.intel.LteCoexistenceAgent"/> </policy> <policy at_console="true"> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/phonebook.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <stdlib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/sim-auth.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <glib.h> #include <errno.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/sim.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <stdint.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/simfs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/siri.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdlib.h> #include <stdio.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/sms.c ^ |
@@ -170,6 +170,26 @@ return "spanish"; case SMS_ALPHABET_PORTUGUESE: return "portuguese"; + case SMS_ALPHABET_BENGALI: + return "bengali"; + case SMS_ALPHABET_GUJARATI: + return "gujarati"; + case SMS_ALPHABET_HINDI: + return "hindi"; + case SMS_ALPHABET_KANNADA: + return "kannada"; + case SMS_ALPHABET_MALAYALAM: + return "malayalam"; + case SMS_ALPHABET_ORIYA: + return "oriya"; + case SMS_ALPHABET_PUNJABI: + return "punjabi"; + case SMS_ALPHABET_TAMIL: + return "tamil"; + case SMS_ALPHABET_TELUGU: + return "telugu"; + case SMS_ALPHABET_URDU: + return "urdu"; case SMS_ALPHABET_DEFAULT: return "default"; } @@ -188,6 +208,26 @@ *alphabet = SMS_ALPHABET_SPANISH; else if (g_str_equal(str, "portuguese")) *alphabet = SMS_ALPHABET_PORTUGUESE; + else if (g_str_equal(str, "bengali")) + *alphabet = SMS_ALPHABET_BENGALI; + else if (g_str_equal(str, "gujarati")) + *alphabet = SMS_ALPHABET_GUJARATI; + else if (g_str_equal(str, "hindi")) + *alphabet = SMS_ALPHABET_HINDI; + else if (g_str_equal(str, "kannada")) + *alphabet = SMS_ALPHABET_KANNADA; + else if (g_str_equal(str, "malayalam")) + *alphabet = SMS_ALPHABET_MALAYALAM; + else if (g_str_equal(str, "oriya")) + *alphabet = SMS_ALPHABET_ORIYA; + else if (g_str_equal(str, "punjabi")) + *alphabet = SMS_ALPHABET_PUNJABI; + else if (g_str_equal(str, "tamil")) + *alphabet = SMS_ALPHABET_TAMIL; + else if (g_str_equal(str, "telugu")) + *alphabet = SMS_ALPHABET_TELUGU; + else if (g_str_equal(str, "urdu")) + *alphabet = SMS_ALPHABET_URDU; else return FALSE; @@ -782,6 +822,8 @@ switch (status) { case NETWORK_REGISTRATION_STATUS_REGISTERED: case NETWORK_REGISTRATION_STATUS_ROAMING: + case NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN: + case NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN: sms->registered = TRUE; break; default: | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/smsagent.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <string.h> #include <errno.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/smsutil.c ^ |
@@ -2280,10 +2280,10 @@ * If language is not defined in 3GPP TS 23.038, * implementations are instructed to ignore it */ - if (locking_shift > SMS_ALPHABET_PORTUGUESE) + if (locking_shift > SMS_ALPHABET_URDU) locking_shift = GSM_DIALECT_DEFAULT; - if (single_shift > SMS_ALPHABET_PORTUGUESE) + if (single_shift > SMS_ALPHABET_URDU) single_shift = GSM_DIALECT_DEFAULT; converted = convert_gsm_to_utf8_with_lang(buf, written, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/smsutil.h ^ |
@@ -159,6 +159,16 @@ SMS_ALPHABET_TURKISH, SMS_ALPHABET_SPANISH, SMS_ALPHABET_PORTUGUESE, + SMS_ALPHABET_BENGALI, + SMS_ALPHABET_GUJARATI, + SMS_ALPHABET_HINDI, + SMS_ALPHABET_KANNADA, + SMS_ALPHABET_MALAYALAM, + SMS_ALPHABET_ORIYA, + SMS_ALPHABET_PUNJABI, + SMS_ALPHABET_TAMIL, + SMS_ALPHABET_TELUGU, + SMS_ALPHABET_URDU, }; enum sms_mwi_type { | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/stk.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <stdlib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/stkagent.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdint.h> #include <string.h> #include <errno.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/stkutil.c ^ |
@@ -4405,9 +4405,6 @@ const struct stk_ussd_string *ussd = data; unsigned char tag = STK_DATA_OBJECT_TYPE_USSD_STRING; - if (ussd->string == NULL) - return TRUE; - return stk_tlv_builder_open_container(tlv, cr, tag, FALSE) && stk_tlv_builder_append_byte(tlv, ussd->dcs) && stk_tlv_builder_append_bytes(tlv, ussd->string, ussd->len) && | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/storage.c ^ |
@@ -25,7 +25,6 @@ #include <ofono/storage.h> -#define _GNU_SOURCE #include <string.h> #include <stdarg.h> #include <sys/types.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/ussd.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <string.h> #include <stdio.h> #include <errno.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/util.c ^ |
@@ -288,6 +288,1666 @@ { 0x20AC, 0x1B65 } }; +/* Appendix A.2.4. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint ben_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0X003C }, + { 0x11, 0X003D }, + { 0x12, 0X003E }, + { 0x13, 0X00A1 }, + { 0x14, 0X005E }, + { 0x15, 0X00A1 }, + { 0x16, 0X005F }, + { 0x17, 0X0023 }, + { 0x18, 0X002A }, + { 0x19, 0X09E6 }, + { 0x1A, 0X09E7 }, + { 0x1B, 0X0020 }, /* See NOTE 1 */ + { 0x1C, 0X09E8 }, + { 0x1D, 0X09E9 }, + { 0x1E, 0X09EA }, + { 0x1F, 0X09EB }, + { 0x20, 0x09EC }, + { 0x21, 0x09ED }, + { 0x22, 0x09EE }, + { 0x23, 0x09EF }, + { 0x24, 0x09DF }, + { 0x25, 0x09E0 }, + { 0x26, 0x09E1 }, + { 0x27, 0x09E2 }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x09E3 }, + { 0x2B, 0x09F2 }, + { 0x2C, 0x09F3 }, + { 0x2D, 0x09F4 }, + { 0x2E, 0x09F5 }, + { 0x2F, 0x005C }, + { 0x30, 0x09F6 }, + { 0x31, 0x09F7 }, + { 0x32, 0x09F8 }, + { 0x33, 0x09F9 }, + { 0x34, 0x09FA }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint ben_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0X0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0X002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0X003C, 0x1B10 }, + { 0X003D, 0x1B11 }, + { 0X003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0X005E, 0x1B14 }, + { 0X005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0X00A1, 0x1B13 }, + { 0X00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x09DF, 0x1B24 }, + { 0x09E0, 0x1B25 }, + { 0x09E1, 0x1B26 }, + { 0x09E2, 0x1B27 }, + { 0x09E3, 0x1B2A }, + { 0X09E6, 0x1B19 }, + { 0X09E7, 0x1B1A }, + { 0X09E8, 0x1B1C }, + { 0X09E9, 0x1B1D }, + { 0X09EA, 0x1B1E }, + { 0X09EB, 0x1B1F }, + { 0x09EC, 0x1B20 }, + { 0x09ED, 0x1B21 }, + { 0x09EE, 0x1B22 }, + { 0x09EF, 0x1B23 }, + { 0x09F2, 0x1B2B }, + { 0x09F3, 0x1B2C }, + { 0x09F4, 0x1B2D }, + { 0x09F5, 0x1B2E }, + { 0x09F6, 0x1B30 }, + { 0x09F7, 0x1B31 }, + { 0x09F8, 0x1B32 }, + { 0x09F9, 0x1B33 }, + { 0x09FA, 0x1B34 }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.5. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint guj_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0964 }, + { 0x1A, 0x0965 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0AE6 }, + { 0x1D, 0x0AE7 }, + { 0x1E, 0x0AE8 }, + { 0x1F, 0x0AE9 }, + { 0x20, 0x0AEA }, + { 0x21, 0x0AEB }, + { 0x22, 0x0AEC }, + { 0x23, 0x0AED }, + { 0x24, 0x0AEE }, + { 0x25, 0x0AEF }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2F, 0x005C }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint guj_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0964, 0x1B19 }, + { 0x0965, 0x1B1A }, + { 0x0AE6, 0x1B1C }, + { 0x0AE7, 0x1B1D }, + { 0x0AE8, 0x1B1E }, + { 0x0AE9, 0x1B1F }, + { 0x0AEA, 0x1B20 }, + { 0x0AEB, 0x1B21 }, + { 0x0AEC, 0x1B22 }, + { 0x0AED, 0x1B23 }, + { 0x0AEE, 0x1B24 }, + { 0x0AEF, 0x1B25 }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.6. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint hin_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0964 }, + { 0x1A, 0x0965 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0966 }, + { 0x1D, 0x0967 }, + { 0x1E, 0x0968 }, + { 0x1F, 0x0969 }, + { 0x20, 0x096A }, + { 0x21, 0x096B }, + { 0x22, 0x096C }, + { 0x23, 0x096D }, + { 0x24, 0x096E }, + { 0x25, 0x096F }, + { 0x26, 0x0951 }, + { 0x27, 0x0952 }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x0953 }, + { 0x2B, 0x0954 }, + { 0x2C, 0x0958 }, + { 0x2D, 0x0959 }, + { 0x2E, 0x095A }, + { 0x2F, 0x005C }, + { 0x30, 0x095B }, + { 0x31, 0x095C }, + { 0x32, 0x095D }, + { 0x33, 0x095E }, + { 0x34, 0x095F }, + { 0x35, 0x0960 }, + { 0x36, 0x0961 }, + { 0x37, 0x0962 }, + { 0x38, 0x0963 }, + { 0x39, 0x0970 }, + { 0x3A, 0x0971 }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint hin_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0951, 0x1B26 }, + { 0x0952, 0x1B27 }, + { 0x0953, 0x1B2A }, + { 0x0954, 0x1B2B }, + { 0x0958, 0x1B2C }, + { 0x0959, 0x1B2D }, + { 0x095A, 0x1B2E }, + { 0x095B, 0x1B30 }, + { 0x095C, 0x1B31 }, + { 0x095D, 0x1B32 }, + { 0x095E, 0x1B33 }, + { 0x095F, 0x1B34 }, + { 0x0960, 0x1B35 }, + { 0x0961, 0x1B36 }, + { 0x0962, 0x1B37 }, + { 0x0963, 0x1B38 }, + { 0x0964, 0x1B19 }, + { 0x0965, 0x1B1A }, + { 0x0966, 0x1B1C }, + { 0x0967, 0x1B1D }, + { 0x0968, 0x1B1E }, + { 0x0969, 0x1B1F }, + { 0x096A, 0x1B20 }, + { 0x096B, 0x1B21 }, + { 0x096C, 0x1B22 }, + { 0x096D, 0x1B23 }, + { 0x096E, 0x1B24 }, + { 0x096F, 0x1B25 }, + { 0x0970, 0x1B39 }, + { 0x0971, 0x1B3A }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.7. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint kan_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0964 }, + { 0x1A, 0x0965 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0CE6 }, + { 0x1D, 0x0CE7 }, + { 0x1E, 0x0CE8 }, + { 0x1F, 0x0CE9 }, + { 0x20, 0x0CEA }, + { 0x21, 0x0CEB }, + { 0x22, 0x0CEC }, + { 0x23, 0x0CED }, + { 0x24, 0x0CEE }, + { 0x25, 0x0CEF }, + { 0x26, 0x0CDE }, + { 0x27, 0x0CF1 }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x0CF2 }, + { 0x2F, 0x005C }, + { 0x3C, 0x005D }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint kan_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3C }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0964, 0x1B19 }, + { 0x0965, 0x1B1A }, + { 0x0CDE, 0x1B26 }, + { 0x0CE6, 0x1B1C }, + { 0x0CE7, 0x1B1D }, + { 0x0CE8, 0x1B1E }, + { 0x0CE9, 0x1B1F }, + { 0x0CEA, 0x1B20 }, + { 0x0CEB, 0x1B21 }, + { 0x0CEC, 0x1B22 }, + { 0x0CED, 0x1B23 }, + { 0x0CEE, 0x1B24 }, + { 0x0CEF, 0x1B25 }, + { 0x0CF1, 0x1B27 }, + { 0x0CF2, 0x1B2A }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.8. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint mal_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0964 }, + { 0x1A, 0x0965 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0D66 }, + { 0x1D, 0x0D67 }, + { 0x1E, 0x0D68 }, + { 0x1F, 0x0D69 }, + { 0x20, 0x0D6A }, + { 0x21, 0x0D6B }, + { 0x22, 0x0D6C }, + { 0x23, 0x0D6D }, + { 0x24, 0x0D6E }, + { 0x25, 0x0D6F }, + { 0x26, 0x0D70 }, + { 0x27, 0x0D71 }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x0D72 }, + { 0x2B, 0x0D73 }, + { 0x2C, 0x0D74 }, + { 0x2D, 0x0D75 }, + { 0x2E, 0x0D7A }, + { 0x2F, 0x005C }, + { 0x30, 0x0D7B }, + { 0x31, 0x0D7C }, + { 0x32, 0x0D7D }, + { 0x33, 0x0D7E }, + { 0x34, 0x0D7F }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint mal_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0964, 0x1B19 }, + { 0x0965, 0x1B1A }, + { 0x0D66, 0x1B1C }, + { 0x0D67, 0x1B1D }, + { 0x0D68, 0x1B1E }, + { 0x0D69, 0x1B1F }, + { 0x0D6A, 0x1B20 }, + { 0x0D6B, 0x1B21 }, + { 0x0D6C, 0x1B22 }, + { 0x0D6D, 0x1B23 }, + { 0x0D6E, 0x1B24 }, + { 0x0D6F, 0x1B25 }, + { 0x0D70, 0x1B26 }, + { 0x0D71, 0x1B27 }, + { 0x0D72, 0x1B2A }, + { 0x0D73, 0x1B2B }, + { 0x0D74, 0x1B2C }, + { 0x0D75, 0x1B2D }, + { 0x0D7A, 0x1B2E }, + { 0x0D7B, 0x1B30 }, + { 0x0D7C, 0x1B31 }, + { 0x0D7D, 0x1B32 }, + { 0x0D7E, 0x1B33 }, + { 0x0D7F, 0x1B34 }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.9. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint ori_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0964 }, + { 0x1A, 0x0965 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0B66 }, + { 0x1D, 0x0B67 }, + { 0x1E, 0x0B68 }, + { 0x1F, 0x0B69 }, + { 0x20, 0x0B6A }, + { 0x21, 0x0B6B }, + { 0x22, 0x0B6C }, + { 0x23, 0x0B6D }, + { 0x24, 0x0B6E }, + { 0x25, 0x0B6F }, + { 0x26, 0x0B5C }, + { 0x27, 0x0B5D }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x0B5F }, + { 0x2B, 0x0B70 }, + { 0x2C, 0x0B71 }, + { 0x2F, 0x005C }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint ori_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0964, 0x1B19 }, + { 0x0965, 0x1B1A }, + { 0x0B5C, 0x1B26 }, + { 0x0B5D, 0x1B27 }, + { 0x0B5F, 0x1B2A }, + { 0x0B66, 0x1B1C }, + { 0x0B67, 0x1B1D }, + { 0x0B68, 0x1B1E }, + { 0x0B69, 0x1B1F }, + { 0x0B6A, 0x1B20 }, + { 0x0B6B, 0x1B21 }, + { 0x0B6C, 0x1B22 }, + { 0x0B6D, 0x1B23 }, + { 0x0B6E, 0x1B24 }, + { 0x0B6F, 0x1B25 }, + { 0x0B70, 0x1B2B }, + { 0x0B71, 0x1B2C }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.10. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint pun_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0964 }, + { 0x1A, 0x0965 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0A66 }, + { 0x1D, 0x0A67 }, + { 0x1E, 0x0A68 }, + { 0x1F, 0x0A69 }, + { 0x20, 0x0A6A }, + { 0x21, 0x0A6B }, + { 0x22, 0x0A6C }, + { 0x23, 0x0A6D }, + { 0x24, 0x0A6E }, + { 0x25, 0x0A6F }, + { 0x26, 0x0A59 }, + { 0x27, 0x0A5A }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x0A5B }, + { 0x2B, 0x0A5C }, + { 0x2C, 0x0A5E }, + { 0x2D, 0x0A75 }, + { 0x2F, 0x005C }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint pun_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0964, 0x1B19 }, + { 0x0965, 0x1B1A }, + { 0x0A59, 0x1B26 }, + { 0x0A5A, 0x1B27 }, + { 0x0A5B, 0x1B2A }, + { 0x0A5C, 0x1B2B }, + { 0x0A5E, 0x1B2C }, + { 0x0A66, 0x1B1C }, + { 0x0A67, 0x1B1D }, + { 0x0A68, 0x1B1E }, + { 0x0A69, 0x1B1F }, + { 0x0A6A, 0x1B20 }, + { 0x0A6B, 0x1B21 }, + { 0x0A6C, 0x1B22 }, + { 0x0A6D, 0x1B23 }, + { 0x0A6E, 0x1B24 }, + { 0x0A6F, 0x1B25 }, + { 0x0A75, 0x1B2D }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.11. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint tam_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0964 }, + { 0x1A, 0x0965 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0BE6 }, + { 0x1D, 0x0BE7 }, + { 0x1E, 0x0BE8 }, + { 0x1F, 0x0BE9 }, + { 0x20, 0x0BEA }, + { 0x21, 0x0BEB }, + { 0x22, 0x0BEC }, + { 0x23, 0x0BED }, + { 0x24, 0x0BEE }, + { 0x25, 0x0BEF }, + { 0x26, 0x0BF3 }, + { 0x27, 0x0BF4 }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x0BF5 }, + { 0x2B, 0x0BF6 }, + { 0x2C, 0x0BF7 }, + { 0x2D, 0x0BF8 }, + { 0x2E, 0x0BFA }, + { 0x2F, 0x005C }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint tam_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0964, 0x1B19 }, + { 0x0965, 0x1B1A }, + { 0x0BE6, 0x1B1C }, + { 0x0BE7, 0x1B1D }, + { 0x0BE8, 0x1B1E }, + { 0x0BE9, 0x1B1F }, + { 0x0BEA, 0x1B20 }, + { 0x0BEB, 0x1B21 }, + { 0x0BEC, 0x1B22 }, + { 0x0BED, 0x1B23 }, + { 0x0BEE, 0x1B24 }, + { 0x0BEF, 0x1B25 }, + { 0x0BF3, 0x1B26 }, + { 0x0BF4, 0x1B27 }, + { 0x0BF5, 0x1B2A }, + { 0x0BF6, 0x1B2B }, + { 0x0BF7, 0x1B2C }, + { 0x0BF8, 0x1B2D }, + { 0x0BFA, 0x1B2E }, + { 0x20AC, 0x1B65 } +}; + +/* Appendix A.2.12. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint tel_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x0C66 }, + { 0x1D, 0x0C67 }, + { 0x1E, 0x0C68 }, + { 0x1F, 0x0C69 }, + { 0x20, 0x0C6A }, + { 0x21, 0x0C6B }, + { 0x22, 0x0C6C }, + { 0x23, 0x0C6D }, + { 0x24, 0x0C6E }, + { 0x25, 0x0C6F }, + { 0x26, 0x0C58 }, + { 0x27, 0x0C59 }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x0C78 }, + { 0x2B, 0x0C79 }, + { 0x2C, 0x0C7A }, + { 0x2D, 0x0C7B }, + { 0x2E, 0x0C7C }, + { 0x2F, 0x005C }, + { 0x30, 0x0C7D }, + { 0x31, 0x0C7E }, + { 0x32, 0x0C7F }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A } +}; + +static const struct codepoint tel_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0C58, 0x1B26 }, + { 0x0C59, 0x1B27 }, + { 0x0C66, 0x1B1C }, + { 0x0C67, 0x1B1D }, + { 0x0C68, 0x1B1E }, + { 0x0C69, 0x1B1F }, + { 0x0C6A, 0x1B20 }, + { 0x0C6B, 0x1B21 }, + { 0x0C6C, 0x1B22 }, + { 0x0C6D, 0x1B23 }, + { 0x0C6E, 0x1B24 }, + { 0x0C6F, 0x1B25 }, + { 0x0C78, 0x1B2A }, + { 0x0C79, 0x1B2B }, + { 0x0C7A, 0x1B2C }, + { 0x0C7B, 0x1B2D }, + { 0x0C7C, 0x1B2E }, + { 0x0C7D, 0x1B30 }, + { 0x0C7E, 0x1B31 }, + { 0x0C7F, 0x1B32 } +}; + +/* Appendix A.2.13. in 3GPP TS23.038 V.8.2.0 */ +static const struct codepoint urd_ext_gsm[] = { + { 0x00, 0x0040 }, + { 0x01, 0x00A3 }, + { 0x02, 0x0024 }, + { 0x03, 0x00A5 }, + { 0x04, 0x00BF }, + { 0x05, 0x0022 }, + { 0x06, 0x00A4 }, + { 0x07, 0x0025 }, + { 0x08, 0x0026 }, + { 0x09, 0x0027 }, + { 0x0A, 0x000C }, /* See NOTE 3 */ + { 0x0B, 0x002A }, + { 0x0C, 0x002B }, + { 0x0E, 0x002D }, + { 0x0F, 0x002F }, + { 0x10, 0x003C }, + { 0x11, 0x003D }, + { 0x12, 0x003E }, + { 0x13, 0x00A1 }, + { 0x14, 0x005E }, + { 0x15, 0x00A1 }, + { 0x16, 0x005F }, + { 0x17, 0x0023 }, + { 0x18, 0x002A }, + { 0x19, 0x0600 }, + { 0x1A, 0x0601 }, + { 0x1B, 0x0020 }, /* See NOTE 1 */ + { 0x1C, 0x06F0 }, + { 0x1D, 0x06F1 }, + { 0x1E, 0x06F2 }, + { 0x1F, 0x06F3 }, + { 0x20, 0x06F4 }, + { 0x21, 0x06F5 }, + { 0x22, 0x06F6 }, + { 0x23, 0x06F7 }, + { 0x24, 0x06F8 }, + { 0x25, 0x06F9 }, + { 0x26, 0x060C }, + { 0x27, 0x060D }, + { 0x28, 0x007B }, + { 0x29, 0x007D }, + { 0x2A, 0x060E }, + { 0x2B, 0x060F }, + { 0x2C, 0x0610 }, + { 0x2D, 0x0611 }, + { 0x2E, 0x0612 }, + { 0x2F, 0x005C }, + { 0x30, 0x0613 }, + { 0x31, 0x0614 }, + { 0x32, 0x061B }, + { 0x33, 0x061F }, + { 0x34, 0x0640 }, + { 0x35, 0x0652 }, + { 0x36, 0x0658 }, + { 0x37, 0x066B }, + { 0x38, 0x066C }, + { 0x39, 0x0672 }, + { 0x3A, 0x0673 }, + { 0x3B, 0x06CD }, + { 0x3C, 0x005B }, + { 0x3D, 0x007E }, + { 0x3E, 0x005D }, + { 0x3F, 0x06D4 }, + { 0x40, 0x007C }, + { 0x41, 0x0041 }, + { 0x42, 0x0042 }, + { 0x43, 0x0043 }, + { 0x44, 0x0044 }, + { 0x45, 0x0045 }, + { 0x46, 0x0046 }, + { 0x47, 0x0047 }, + { 0x48, 0x0048 }, + { 0x49, 0x0049 }, + { 0x4A, 0x004A }, + { 0x4B, 0x004B }, + { 0x4C, 0x004C }, + { 0x4D, 0x004D }, + { 0x4E, 0x004E }, + { 0x4F, 0x004F }, + { 0x50, 0x0050 }, + { 0x51, 0x0051 }, + { 0x52, 0x0052 }, + { 0x53, 0x0053 }, + { 0x54, 0x0054 }, + { 0x55, 0x0055 }, + { 0x56, 0x0056 }, + { 0x57, 0x0057 }, + { 0x58, 0x0058 }, + { 0x59, 0x0059 }, + { 0x5A, 0x005A }, + { 0x65, 0x20AC } +}; + +static const struct codepoint urd_ext_unicode[] = { + { 0x000C, 0x1B0A }, + { 0x0022, 0x1B05 }, + { 0x0023, 0x1B17 }, + { 0x0024, 0x1B02 }, + { 0x0025, 0x1B07 }, + { 0x0026, 0x1B08 }, + { 0x0027, 0x1B09 }, + { 0x002A, 0x1B0B }, + { 0x002A, 0x1B18 }, + { 0x002B, 0x1B0C }, + { 0x002D, 0x1B0E }, + { 0x002F, 0x1B0F }, + { 0x003C, 0x1B10 }, + { 0x003D, 0x1B11 }, + { 0x003E, 0x1B12 }, + { 0x0040, 0x1B00 }, + { 0x0041, 0x1B41 }, + { 0x0042, 0x1B42 }, + { 0x0043, 0x1B43 }, + { 0x0044, 0x1B44 }, + { 0x0045, 0x1B45 }, + { 0x0046, 0x1B46 }, + { 0x0047, 0x1B47 }, + { 0x0048, 0x1B48 }, + { 0x0049, 0x1B49 }, + { 0x004A, 0x1B4A }, + { 0x004B, 0x1B4B }, + { 0x004C, 0x1B4C }, + { 0x004D, 0x1B4D }, + { 0x004E, 0x1B4E }, + { 0x004F, 0x1B4F }, + { 0x0050, 0x1B50 }, + { 0x0051, 0x1B51 }, + { 0x0052, 0x1B52 }, + { 0x0053, 0x1B53 }, + { 0x0054, 0x1B54 }, + { 0x0055, 0x1B55 }, + { 0x0056, 0x1B56 }, + { 0x0057, 0x1B57 }, + { 0x0058, 0x1B58 }, + { 0x0059, 0x1B59 }, + { 0x005A, 0x1B5A }, + { 0x005B, 0x1B3C }, + { 0x005C, 0x1B2F }, + { 0x005D, 0x1B3E }, + { 0x005E, 0x1B14 }, + { 0x005F, 0x1B16 }, + { 0x007B, 0x1B28 }, + { 0x007C, 0x1B40 }, + { 0x007D, 0x1B29 }, + { 0x007E, 0x1B3D }, + { 0x00A1, 0x1B13 }, + { 0x00A1, 0x1B15 }, + { 0x00A3, 0x1B01 }, + { 0x00A4, 0x1B06 }, + { 0x00A5, 0x1B03 }, + { 0x00BF, 0x1B04 }, + { 0x0600, 0x1B19 }, + { 0x0601, 0x1B1A }, + { 0x060C, 0x1B26 }, + { 0x060D, 0x1B27 }, + { 0x060E, 0x1B2A }, + { 0x060F, 0x1B2B }, + { 0x0610, 0x1B2C }, + { 0x0611, 0x1B2D }, + { 0x0612, 0x1B2E }, + { 0x0613, 0x1B30 }, + { 0x0614, 0x1B31 }, + { 0x061B, 0x1B32 }, + { 0x061F, 0x1B33 }, + { 0x0640, 0x1B34 }, + { 0x0652, 0x1B35 }, + { 0x0658, 0x1B36 }, + { 0x066B, 0x1B37 }, + { 0x066C, 0x1B38 }, + { 0x0672, 0x1B39 }, + { 0x0673, 0x1B3A }, + { 0x06CD, 0x1B3B }, + { 0x06D4, 0x1B3F }, + { 0x06F0, 0x1B1C }, + { 0x06F1, 0x1B1D }, + { 0x06F2, 0x1B1E }, + { 0x06F3, 0x1B1F }, + { 0x06F4, 0x1B20 }, + { 0x06F5, 0x1B21 }, + { 0x06F6, 0x1B22 }, + { 0x06F7, 0x1B23 }, + { 0x06F8, 0x1B24 }, + { 0x06F9, 0x1B25 }, + { 0x20AC, 0x1B65 } +}; + /* Used for conversion of GSM to Unicode */ static const unsigned short def_gsm[] = { 0x0040, 0x00A3, 0x0024, 0x00A5, 0x00E8, 0x00E9, 0x00F9, 0x00EC, @@ -454,6 +2114,535 @@ { 0x00FC, 0x7E }, { 0x0394, 0x10 }, { 0x20AC, 0x18 }, { 0x221E, 0x15 } }; +/* Appendix A.3.4 in 3GPP TS23.038 */ +static const unsigned short ben_gsm[] = { + 0x0981, 0x0982, 0x0983, 0x0985, 0x0986, 0x0987, 0x0988, 0x0989, + 0x098A, 0x098B, 0x000A, 0x098C, 0x0020, 0x000D, 0x0020, 0x098F, + 0x0990, 0x0020, 0x0020, 0x0993, 0x0994, 0x0995, 0x0996, 0x0997, + 0x0998, 0x0999, 0x099A, 0x00A0, 0x099B, 0x099C, 0x099D, 0x099E, + 0x0020, 0x0021, 0x099F, 0x09A0, 0x09A1, 0x09A2, 0x09A3, 0x09A4, + 0x0029, 0x0028, 0x09A5, 0x09A6, 0x002C, 0x09A7, 0x002E, 0x09A8, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x09AA, 0x09AB, 0x003F, + 0x09AC, 0x09AD, 0x09AE, 0x09AF, 0x09B0, 0x0020, 0x09B2, 0x0020, + 0x0020, 0x0020, 0x09B6, 0x09B7, 0x09B8, 0x09B9, 0x09BC, 0x09BD, + 0x09BE, 0x09BF, 0x09C0, 0x09C1, 0x09C2, 0x09C3, 0x09C4, 0x0020, + 0x0020, 0x09C7, 0x09C8, 0x0020, 0x0020, 0x09CB, 0x09CC, 0x09CD, + 0x09CE, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x09D7, 0x09DC, 0x09DD, 0x09F0, 0x09F1 +}; + +static const struct codepoint ben_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0981, 0x00 }, { 0x0982, 0x01 }, { 0x0983, 0x02 }, { 0x0985, 0x03 }, + { 0x0986, 0x04 }, { 0x0987, 0x05 }, { 0x0988, 0x06 }, { 0x0989, 0x07 }, + { 0x098A, 0x08 }, { 0x098B, 0x09 }, { 0x098C, 0x0B }, { 0x098F, 0x0F }, + { 0x0990, 0x10 }, { 0x0993, 0x13 }, { 0x0994, 0x14 }, { 0x0995, 0x15 }, + { 0x0996, 0x16 }, { 0x0997, 0x17 }, { 0x0998, 0x18 }, { 0x0999, 0x19 }, + { 0x099A, 0x1A }, { 0x099B, 0x1C }, { 0x099C, 0x1D }, { 0x099D, 0x1E }, + { 0x099E, 0x1F }, { 0x099F, 0x22 }, { 0x09A0, 0x23 }, { 0x09A1, 0x24 }, + { 0x09A2, 0x25 }, { 0x09A3, 0x26 }, { 0x09A4, 0x27 }, { 0x09A5, 0x2A }, + { 0x09A6, 0x2B }, { 0x09A7, 0x2D }, { 0x09A8, 0x2F }, { 0x09AA, 0x3D }, + { 0x09AB, 0x3E }, { 0x09AC, 0x40 }, { 0x09AD, 0x41 }, { 0x09AE, 0x42 }, + { 0x09AF, 0x43 }, { 0x09B0, 0x44 }, { 0x09B2, 0x46 }, { 0x09B6, 0x4A }, + { 0x09B7, 0x4B }, { 0x09B8, 0x4C }, { 0x09B9, 0x4D }, { 0x09BC, 0x4E }, + { 0x09BD, 0x4F }, { 0x09BE, 0x50 }, { 0x09BF, 0x51 }, { 0x09C0, 0x52 }, + { 0x09C1, 0x53 }, { 0x09C2, 0x54 }, { 0x09C3, 0x55 }, { 0x09C4, 0x56 }, + { 0x09C7, 0x59 }, { 0x09C8, 0x5A }, { 0x09CB, 0x5D }, { 0x09CC, 0x5E }, + { 0x09CD, 0x5F }, { 0x09CE, 0x60 }, { 0x09D7, 0x7B }, { 0x09DC, 0x7C }, + { 0x09DD, 0x7D }, { 0x09F0, 0x7E }, { 0x09F1, 0x7F } +}; + +/* Appendix A.3.5 in 3GPP TS23.038 */ +static const unsigned short guj_gsm[] = { + 0x0A81, 0x0A82, 0x0A83, 0x0A85, 0x0A86, 0x0A87, 0x0A88, 0x0A89, + 0x0A8A, 0x0A8B, 0x000A, 0x0A8C, 0x0A8D, 0x000D, 0x0020, 0x0A8F, + 0x0A90, 0x0A91, 0x0020, 0x0A93, 0x0A94, 0x0A95, 0x0A96, 0x0A97, + 0x0A98, 0x0A99, 0x0A9A, 0x00A0, 0x0A9B, 0x0A9C, 0x0A9D, 0x0A9E, + 0x0020, 0x0021, 0x0A9F, 0x0AA0, 0x0AA1, 0x0AA2, 0x0AA3, 0x0AA4, + 0x0029, 0x0028, 0x0AA5, 0x0AA6, 0x002C, 0x0AA7, 0x002E, 0x0AA8, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x0AAA, 0x0AAB, 0x003F, + 0x0AAC, 0x0AAD, 0x0AAE, 0x0AAF, 0x0AB0, 0x0020, 0x0AB2, 0x0AB3, + 0x0020, 0x0AB5, 0x0AB6, 0x0AB7, 0x0AB8, 0x0AB9, 0x0ABC, 0x0ABD, + 0x0ABE, 0x0ABF, 0x0AC0, 0x0AC1, 0x0AC2, 0x0AC3, 0x0AC4, 0x0AC5, + 0x0020, 0x0AC7, 0x0AC8, 0x0AC9, 0x0020, 0x0ACB, 0x0ACC, 0x0ACD, + 0x0AD0, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0AE0, 0x0AE1, 0x0AE2, 0x0AE3, 0x0AF1 +}; + +static const struct codepoint guj_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0A81, 0x00 }, { 0x0A82, 0x01 }, { 0x0A83, 0x02 }, { 0x0A85, 0x03 }, + { 0x0A86, 0x04 }, { 0x0A87, 0x05 }, { 0x0A88, 0x06 }, { 0x0A89, 0x07 }, + { 0x0A8A, 0x08 }, { 0x0A8B, 0x09 }, { 0x0A8C, 0x0B }, { 0x0A8D, 0x0C }, + { 0x0A8F, 0x0F }, { 0x0A90, 0x10 }, { 0x0A91, 0x11 }, { 0x0A93, 0x13 }, + { 0x0A94, 0x14 }, { 0x0A95, 0x15 }, { 0x0A96, 0x16 }, { 0x0A97, 0x17 }, + { 0x0A98, 0x18 }, { 0x0A99, 0x19 }, { 0x0A9A, 0x1A }, { 0x0A9B, 0x1C }, + { 0x0A9C, 0x1D }, { 0x0A9D, 0x1E }, { 0x0A9E, 0x1F }, { 0x0A9F, 0x22 }, + { 0x0AA0, 0x23 }, { 0x0AA1, 0x24 }, { 0x0AA2, 0x25 }, { 0x0AA3, 0x26 }, + { 0x0AA4, 0x27 }, { 0x0AA5, 0x2A }, { 0x0AA6, 0x2B }, { 0x0AA7, 0x2D }, + { 0x0AA8, 0x2F }, { 0x0AAA, 0x3D }, { 0x0AAB, 0x3E }, { 0x0AAC, 0x40 }, + { 0x0AAD, 0x41 }, { 0x0AAE, 0x42 }, { 0x0AAF, 0x43 }, { 0x0AB0, 0x44 }, + { 0x0AB2, 0x46 }, { 0x0AB3, 0x47 }, { 0x0AB5, 0x49 }, { 0x0AB6, 0x4A }, + { 0x0AB7, 0x4B }, { 0x0AB8, 0x4C }, { 0x0AB9, 0x4D }, { 0x0ABC, 0x4E }, + { 0x0ABD, 0x4F }, { 0x0ABE, 0x50 }, { 0x0ABF, 0x51 }, { 0x0AC0, 0x52 }, + { 0x0AC1, 0x53 }, { 0x0AC2, 0x54 }, { 0x0AC3, 0x55 }, { 0x0AC4, 0x56 }, + { 0x0AC5, 0x57 }, { 0x0AC7, 0x59 }, { 0x0AC8, 0x5A }, { 0x0AC9, 0x5B }, + { 0x0ACB, 0x5D }, { 0x0ACC, 0x5E }, { 0x0ACD, 0x5F }, { 0x0AD0, 0x60 }, + { 0x0AE0, 0x7B }, { 0x0AE1, 0x7C }, { 0x0AE2, 0x7D }, { 0x0AE3, 0x7E }, + { 0x0AF1, 0x7F } +}; + +/* Appendix A.3.6 in 3GPP TS23.038 */ +static const unsigned short hin_gsm[] = { + 0x0901, 0x0902, 0x0903, 0x0905, 0x0906, 0x0907, 0x0908, 0x0909, + 0x090A, 0x090B, 0x000A, 0x090C, 0x090D, 0x000D, 0x090E, 0x090F, + 0x0910, 0x0911, 0x0912, 0x0913, 0x0914, 0x0915, 0x0916, 0x0917, + 0x0918, 0x0919, 0x091A, 0x00A0, 0x091B, 0x091C, 0x091D, 0x091E, + 0x0020, 0x0021, 0x091F, 0x0920, 0x0921, 0x0922, 0x0923, 0x0924, + 0x0029, 0x0028, 0x0925, 0x0926, 0x002C, 0x0927, 0x002E, 0x0928, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0929, 0x092A, 0x092B, 0x003F, + 0x092C, 0x092D, 0x092E, 0x092F, 0x0930, 0x0931, 0x0932, 0x0933, + 0x0934, 0x0935, 0x0936, 0x0937, 0x0938, 0x0939, 0x093C, 0x093D, + 0x093E, 0x093F, 0x0940, 0x0941, 0x0942, 0x0943, 0x0944, 0x0945, + 0x0946, 0x0947, 0x0948, 0x0949, 0x094A, 0x094B, 0x094C, 0x094D, + 0x0950, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0972, 0x097B, 0x097C, 0x097E, 0x097F +}; + +static const struct codepoint hin_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0901, 0x00 }, { 0x0902, 0x01 }, { 0x0903, 0x02 }, { 0x0905, 0x03 }, + { 0x0906, 0x04 }, { 0x0907, 0x05 }, { 0x0908, 0x06 }, { 0x0909, 0x07 }, + { 0x090A, 0x08 }, { 0x090B, 0x09 }, { 0x090C, 0x0B }, { 0x090D, 0x0C }, + { 0x090E, 0x0E }, { 0x090F, 0x0F }, { 0x0910, 0x10 }, { 0x0911, 0x11 }, + { 0x0912, 0x12 }, { 0x0913, 0x13 }, { 0x0914, 0x14 }, { 0x0915, 0x15 }, + { 0x0916, 0x16 }, { 0x0917, 0x17 }, { 0x0918, 0x18 }, { 0x0919, 0x19 }, + { 0x091A, 0x1A }, { 0x091B, 0x1C }, { 0x091C, 0x1D }, { 0x091D, 0x1E }, + { 0x091E, 0x1F }, { 0x091F, 0x22 }, { 0x0920, 0x23 }, { 0x0921, 0x24 }, + { 0x0922, 0x25 }, { 0x0923, 0x26 }, { 0x0924, 0x27 }, { 0x0925, 0x2A }, + { 0x0926, 0x2B }, { 0x0927, 0x2D }, { 0x0928, 0x2F }, { 0x0929, 0x3C }, + { 0x092A, 0x3D }, { 0x092B, 0x3E }, { 0x092C, 0x40 }, { 0x092D, 0x41 }, + { 0x092E, 0x42 }, { 0x092F, 0x43 }, { 0x0930, 0x44 }, { 0x0931, 0x45 }, + { 0x0932, 0x46 }, { 0x0933, 0x47 }, { 0x0934, 0x48 }, { 0x0935, 0x49 }, + { 0x0936, 0x4A }, { 0x0937, 0x4B }, { 0x0938, 0x4C }, { 0x0939, 0x4D }, + { 0x093C, 0x4E }, { 0x093D, 0x4F }, { 0x093E, 0x50 }, { 0x093F, 0x51 }, + { 0x0940, 0x52 }, { 0x0941, 0x53 }, { 0x0942, 0x54 }, { 0x0943, 0x55 }, + { 0x0944, 0x56 }, { 0x0945, 0x57 }, { 0x0946, 0x58 }, { 0x0947, 0x59 }, + { 0x0948, 0x5A }, { 0x0949, 0x5B }, { 0x094A, 0x5C }, { 0x094B, 0x5D }, + { 0x094C, 0x5E }, { 0x094D, 0x5F }, { 0x0950, 0x60 }, { 0x0972, 0x7B }, + { 0x097B, 0x7C }, { 0x097C, 0x7D }, { 0x097E, 0x7E }, { 0x097F, 0x7F } +}; + +/* Appendix A.3.7 in 3GPP TS23.038 */ +static const unsigned short kan_gsm[] = { + 0x0020, 0x0C82, 0x0C83, 0x0C85, 0x0C86, 0x0C87, 0x0C88, 0x0C89, + 0x0C8A, 0x0C8B, 0x000A, 0x0C8C, 0x0020, 0x000D, 0x0C8E, 0x0C8F, + 0x0C90, 0x0020, 0x0C92, 0x0C93, 0x0C94, 0x0C95, 0x0C96, 0x0C97, + 0x0C98, 0x0C99, 0x0C9A, 0x00A0, 0x0C9B, 0x0C9C, 0x0C9D, 0x0C9E, + 0x0020, 0x0021, 0x0C9F, 0x0CA0, 0x0CAA, 0x0CA2, 0x0CA3, 0x0CA4, + 0x0029, 0x0028, 0x0CA5, 0x0CA6, 0x002C, 0x0CA7, 0x002E, 0x0CA8, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x0CAA, 0x0CAB, 0x003F, + 0x0CAC, 0x0CAD, 0x0CAE, 0x0CAF, 0x0CB0, 0x0CB1, 0x0CB2, 0x0CB3, + 0x0020, 0x0CB5, 0x0CB6, 0x0CB7, 0x0CB8, 0x0CB9, 0x0CBC, 0x0CBD, + 0x0CBE, 0x0CBF, 0x0CC0, 0x0CC1, 0x0CC2, 0x0CC3, 0x0CC4, 0x0020, + 0x0CC6, 0x0CC7, 0x0CC8, 0x0020, 0x0CCA, 0x0CCB, 0x0CCC, 0x0CCD, + 0x0CD5, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0CD6, 0x0CE0, 0x0CE1, 0x0CE2, 0x0CE3 +}; + +static const struct codepoint kan_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0C82, 0x01 }, { 0x0C83, 0x02 }, { 0x0C85, 0x03 }, { 0x0C86, 0x04 }, + { 0x0C87, 0x05 }, { 0x0C88, 0x06 }, { 0x0C89, 0x07 }, { 0x0C8A, 0x08 }, + { 0x0C8B, 0x09 }, { 0x0C8C, 0x0B }, { 0x0C8E, 0x0E }, { 0x0C8F, 0x0F }, + { 0x0C90, 0x10 }, { 0x0C92, 0x12 }, { 0x0C93, 0x13 }, { 0x0C94, 0x14 }, + { 0x0C95, 0x15 }, { 0x0C96, 0x16 }, { 0x0C97, 0x17 }, { 0x0C98, 0x18 }, + { 0x0C99, 0x19 }, { 0x0C9A, 0x1A }, { 0x0C9B, 0x1C }, { 0x0C9C, 0x1D }, + { 0x0C9D, 0x1E }, { 0x0C9E, 0x1F }, { 0x0C9F, 0x22 }, { 0x0CA0, 0x23 }, + { 0x0CA2, 0x25 }, { 0x0CA3, 0x26 }, { 0x0CA4, 0x27 }, { 0x0CA5, 0x2A }, + { 0x0CA6, 0x2B }, { 0x0CA7, 0x2D }, { 0x0CA8, 0x2F }, { 0x0CAA, 0x3D }, + { 0x0CAB, 0x3E }, { 0x0CAC, 0x40 }, { 0x0CAD, 0x41 }, { 0x0CAE, 0x42 }, + { 0x0CAF, 0x43 }, { 0x0CB0, 0x44 }, { 0x0CB1, 0x45 }, { 0x0CB2, 0x46 }, + { 0x0CB3, 0x47 }, { 0x0CB5, 0x49 }, { 0x0CB6, 0x4A }, { 0x0CB7, 0x4B }, + { 0x0CB8, 0x4C }, { 0x0CB9, 0x4D }, { 0x0CBC, 0x4E }, { 0x0CBD, 0x4F }, + { 0x0CBE, 0x50 }, { 0x0CBF, 0x51 }, { 0x0CC0, 0x52 }, { 0x0CC1, 0x53 }, + { 0x0CC2, 0x54 }, { 0x0CC3, 0x55 }, { 0x0CC4, 0x56 }, { 0x0CC6, 0x58 }, + { 0x0CC7, 0x59 }, { 0x0CC8, 0x5A }, { 0x0CCA, 0x5C }, { 0x0CCB, 0x5D }, + { 0x0CCC, 0x5E }, { 0x0CCD, 0x5F }, { 0x0CD5, 0x60 }, { 0x0CD6, 0x7B }, + { 0x0CE0, 0x7C }, { 0x0CE1, 0x7D }, { 0x0CE2, 0x7E }, { 0x0CE3, 0x7F } +}; + +/* Appendix A.3.8 in 3GPP TS23.038 */ +static const unsigned short mal_gsm[] = { + 0x0020, 0x0D02, 0x0D03, 0x0D05, 0x0D06, 0x0D07, 0x0D08, 0x0D09, + 0x0D0A, 0x0D0B, 0x000A, 0x0D0C, 0x0020, 0x000D, 0x0D0E, 0x0D0F, + 0x0D10, 0x0020, 0x0D12, 0x0D13, 0x0D14, 0x0D15, 0x0D16, 0x0D17, + 0x0D18, 0x0D19, 0x0D1A, 0x00A0, 0x0D1B, 0x0D1C, 0x0D1D, 0x0D1E, + 0x0020, 0x0021, 0x0D1F, 0x0D20, 0x0D21, 0x0D22, 0x0D23, 0x0D24, + 0x0029, 0x0028, 0x0D25, 0x0D26, 0x002C, 0x0D27, 0x002C, 0x0D28, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x0D2A, 0x0D2B, 0x003F, + 0x0D2C, 0x0D2D, 0x0D2E, 0x0D2F, 0x0D30, 0x0D31, 0x0D32, 0x0D33, + 0x0D34, 0x0D35, 0x0D36, 0x0D37, 0x0D38, 0x0D39, 0x0020, 0x0D3D, + 0x0D3E, 0x0D3F, 0x0D40, 0x0D41, 0x0D42, 0x0D43, 0x0D44, 0x0020, + 0x0D46, 0x0D47, 0x0D48, 0x0020, 0x0D4A, 0x0D4B, 0x0D4C, 0x0D4D, + 0x0D57, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0D60, 0x0D61, 0x0D62, 0x0D63, 0x0D79 +}; + +static const struct codepoint mal_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2E }, { 0x0030, 0x30 }, + { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, { 0x0034, 0x34 }, + { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, { 0x0038, 0x38 }, + { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, { 0x003F, 0x3F }, + { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, { 0x0064, 0x64 }, + { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, { 0x0068, 0x68 }, + { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, { 0x006C, 0x6C }, + { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, { 0x0070, 0x70 }, + { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, { 0x0074, 0x74 }, + { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, { 0x0078, 0x78 }, + { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, { 0x0D02, 0x01 }, + { 0x0D03, 0x02 }, { 0x0D05, 0x03 }, { 0x0D06, 0x04 }, { 0x0D07, 0x05 }, + { 0x0D08, 0x06 }, { 0x0D09, 0x07 }, { 0x0D0A, 0x08 }, { 0x0D0B, 0x09 }, + { 0x0D0C, 0x0B }, { 0x0D0E, 0x0E }, { 0x0D0F, 0x0F }, { 0x0D10, 0x10 }, + { 0x0D12, 0x12 }, { 0x0D13, 0x13 }, { 0x0D14, 0x14 }, { 0x0D15, 0x15 }, + { 0x0D16, 0x16 }, { 0x0D17, 0x17 }, { 0x0D18, 0x18 }, { 0x0D19, 0x19 }, + { 0x0D1A, 0x1A }, { 0x0D1B, 0x1C }, { 0x0D1C, 0x1D }, { 0x0D1D, 0x1E }, + { 0x0D1E, 0x1F }, { 0x0D1F, 0x22 }, { 0x0D20, 0x23 }, { 0x0D21, 0x24 }, + { 0x0D22, 0x25 }, { 0x0D23, 0x26 }, { 0x0D24, 0x27 }, { 0x0D25, 0x2A }, + { 0x0D26, 0x2B }, { 0x0D27, 0x2D }, { 0x0D28, 0x2F }, { 0x0D2A, 0x3D }, + { 0x0D2B, 0x3E }, { 0x0D2C, 0x40 }, { 0x0D2D, 0x41 }, { 0x0D2E, 0x42 }, + { 0x0D2F, 0x43 }, { 0x0D30, 0x44 }, { 0x0D31, 0x45 }, { 0x0D32, 0x46 }, + { 0x0D33, 0x47 }, { 0x0D34, 0x48 }, { 0x0D35, 0x49 }, { 0x0D36, 0x4A }, + { 0x0D37, 0x4B }, { 0x0D38, 0x4C }, { 0x0D39, 0x4D }, { 0x0D3D, 0x4F }, + { 0x0D3E, 0x50 }, { 0x0D3F, 0x51 }, { 0x0D40, 0x52 }, { 0x0D41, 0x53 }, + { 0x0D42, 0x54 }, { 0x0D43, 0x55 }, { 0x0D44, 0x56 }, { 0x0D46, 0x58 }, + { 0x0D47, 0x59 }, { 0x0D48, 0x5A }, { 0x0D4A, 0x5C }, { 0x0D4B, 0x5D }, + { 0x0D4C, 0x5E }, { 0x0D4D, 0x5F }, { 0x0D57, 0x60 }, { 0x0D60, 0x7B }, + { 0x0D61, 0x7C }, { 0x0D62, 0x7D }, { 0x0D63, 0x7E }, { 0x0D79, 0x7F } +}; + +/* Appendix A.3.9 in 3GPP TS23.038 */ +static const unsigned short ori_gsm[] = { + 0x0B01, 0x0B02, 0x0B03, 0x0B05, 0x0B06, 0x0B07, 0x0B08, 0x0B09, + 0x0B0A, 0x0B0B, 0x000A, 0x0B0C, 0x0020, 0x000D, 0x0020, 0x0B0F, + 0x0B10, 0x0020, 0x0020, 0x0B13, 0x0B14, 0x0B15, 0x0B16, 0x0B17, + 0x0B18, 0x0B19, 0x0B1A, 0x00A0, 0x0B1B, 0x0B1C, 0x0B1D, 0x0B1E, + 0x0020, 0x0021, 0x0B1F, 0x0B20, 0x0B21, 0x0B22, 0x0B23, 0x0B24, + 0x0029, 0x0028, 0x0B25, 0x0B26, 0x002C, 0x0B27, 0x002E, 0x0B28, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x0B2A, 0x0B2B, 0x003F, + 0x0B2C, 0x0B2D, 0x0B2E, 0x0B2F, 0x0B30, 0x0020, 0x0B32, 0x0B33, + 0x0020, 0x0B35, 0x0B36, 0x0B37, 0x0B38, 0x0B39, 0x0B3C, 0x0B3D, + 0x0B3E, 0x0B3F, 0x0B40, 0x0B41, 0x0B42, 0x0B43, 0x0B44, 0x0020, + 0x0020, 0x0B47, 0x0B48, 0x0020, 0x0020, 0x0B4B, 0x0B4C, 0x0B4D, + 0x0B56, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0B57, 0x0B60, 0x0B61, 0x0B62, 0x0B63 +}; + +static const struct codepoint ori_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0B01, 0x00 }, { 0x0B02, 0x01 }, { 0x0B03, 0x02 }, { 0x0B05, 0x03 }, + { 0x0B06, 0x04 }, { 0x0B07, 0x05 }, { 0x0B08, 0x06 }, { 0x0B09, 0x07 }, + { 0x0B0A, 0x08 }, { 0x0B0B, 0x09 }, { 0x0B0C, 0x0B }, { 0x0B0F, 0x0F }, + { 0x0B10, 0x10 }, { 0x0B13, 0x13 }, { 0x0B14, 0x14 }, { 0x0B15, 0x15 }, + { 0x0B16, 0x16 }, { 0x0B17, 0x17 }, { 0x0B18, 0x18 }, { 0x0B19, 0x19 }, + { 0x0B1A, 0x1A }, { 0x0B1B, 0x1C }, { 0x0B1C, 0x1D }, { 0x0B1D, 0x1E }, + { 0x0B1E, 0x1F }, { 0x0B1F, 0x22 }, { 0x0B20, 0x23 }, { 0x0B21, 0x24 }, + { 0x0B22, 0x25 }, { 0x0B23, 0x26 }, { 0x0B24, 0x27 }, { 0x0B25, 0x2A }, + { 0x0B26, 0x2B }, { 0x0B27, 0x2D }, { 0x0B28, 0x2F }, { 0x0B2A, 0x3D }, + { 0x0B2B, 0x3E }, { 0x0B2C, 0x40 }, { 0x0B2D, 0x41 }, { 0x0B2E, 0x42 }, + { 0x0B2F, 0x43 }, { 0x0B30, 0x44 }, { 0x0B32, 0x46 }, { 0x0B33, 0x47 }, + { 0x0B35, 0x49 }, { 0x0B36, 0x4A }, { 0x0B37, 0x4B }, { 0x0B38, 0x4C }, + { 0x0B39, 0x4D }, { 0x0B3C, 0x4E }, { 0x0B3D, 0x4F }, { 0x0B3E, 0x50 }, + { 0x0B3F, 0x51 }, { 0x0B40, 0x52 }, { 0x0B41, 0x53 }, { 0x0B42, 0x54 }, + { 0x0B43, 0x55 }, { 0x0B44, 0x56 }, { 0x0B47, 0x59 }, { 0x0B48, 0x5A }, + { 0x0B4B, 0x5D }, { 0x0B4C, 0x5E }, { 0x0B4D, 0x5F }, { 0x0B56, 0x60 }, + { 0x0B57, 0x7B }, { 0x0B60, 0x7C }, { 0x0B61, 0x7D }, { 0x0B62, 0x7E }, + { 0x0B63, 0x7F } +}; + +/* Appendix A.3.10 in 3GPP TS23.038 */ +static const unsigned short pun_gsm[] = { + 0x0A01, 0x0A02, 0x0A03, 0x0A05, 0x0A06, 0x0A07, 0x0A08, 0x0A09, + 0x0A0A, 0x0020, 0x000A, 0x0020, 0x0020, 0x000D, 0x0020, 0x0A0F, + 0x0A10, 0x0020, 0x0020, 0x0A13, 0x0A14, 0x0A15, 0x0A16, 0x0A17, + 0x0A18, 0x0A19, 0x0A1A, 0x00A0, 0x0A1B, 0x0A1C, 0x0A1D, 0x0A1E, + 0x0020, 0x0021, 0x0A1F, 0x0A20, 0x0A21, 0x0A22, 0x0A23, 0x0A24, + 0x0029, 0x0028, 0x0A25, 0x0A26, 0x002C, 0x0A27, 0x002E, 0x0A28, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x0A2A, 0x0A2B, 0x003F, + 0x0A2C, 0x0A2D, 0x0A2E, 0x0A2F, 0x0A30, 0x0020, 0x0A32, 0x0A33, + 0x0020, 0x0A35, 0x0A36, 0x0020, 0x0A38, 0x0A39, 0x0A3C, 0x0020, + 0x0A3E, 0x0A3F, 0x0A40, 0x0A41, 0x0A42, 0x0020, 0x0020, 0x0020, + 0x0020, 0x0A47, 0x0A48, 0x0020, 0x0020, 0x0A4B, 0x0A4C, 0x0A4D, + 0x0A51, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0A70, 0x0A71, 0x0A72, 0x0A73, 0x0A74 +}; + +static const struct codepoint pun_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0A01, 0x00 }, { 0x0A02, 0x01 }, { 0x0A03, 0x02 }, { 0x0A05, 0x03 }, + { 0x0A06, 0x04 }, { 0x0A07, 0x05 }, { 0x0A08, 0x06 }, { 0x0A09, 0x07 }, + { 0x0A0A, 0x08 }, { 0x0A0F, 0x0F }, { 0x0A10, 0x10 }, { 0x0A13, 0x13 }, + { 0x0A14, 0x14 }, { 0x0A15, 0x15 }, { 0x0A16, 0x16 }, { 0x0A17, 0x17 }, + { 0x0A18, 0x18 }, { 0x0A19, 0x19 }, { 0x0A1A, 0x1A }, { 0x0A1B, 0x1C }, + { 0x0A1C, 0x1D }, { 0x0A1D, 0x1E }, { 0x0A1E, 0x1F }, { 0x0A1F, 0x22 }, + { 0x0A20, 0x23 }, { 0x0A21, 0x24 }, { 0x0A22, 0x25 }, { 0x0A23, 0x26 }, + { 0x0A24, 0x27 }, { 0x0A25, 0x2A }, { 0x0A26, 0x2B }, { 0x0A27, 0x2D }, + { 0x0A28, 0x2F }, { 0x0A2A, 0x3D }, { 0x0A2B, 0x3E }, { 0x0A2C, 0x40 }, + { 0x0A2D, 0x41 }, { 0x0A2E, 0x42 }, { 0x0A2F, 0x43 }, { 0x0A30, 0x44 }, + { 0x0A32, 0x46 }, { 0x0A33, 0x47 }, { 0x0A35, 0x49 }, { 0x0A36, 0x4A }, + { 0x0A38, 0x4C }, { 0x0A39, 0x4D }, { 0x0A3C, 0x4E }, { 0x0A3E, 0x50 }, + { 0x0A3F, 0x51 }, { 0x0A40, 0x52 }, { 0x0A41, 0x53 }, { 0x0A42, 0x54 }, + { 0x0A47, 0x59 }, { 0x0A48, 0x5A }, { 0x0A4B, 0x5D }, { 0x0A4C, 0x5E }, + { 0x0A4D, 0x5F }, { 0x0A51, 0x60 }, { 0x0A70, 0x7B }, { 0x0A71, 0x7C }, + { 0x0A72, 0x7D }, { 0x0A73, 0x7E }, { 0x0A74, 0x7F } +}; + +/* Appendix A.3.11 in 3GPP TS23.038 */ +static const unsigned short tam_gsm[] = { + 0x0020, 0x0B82, 0x0B83, 0x0B85, 0x0B86, 0x0B87, 0x0B88, 0x0B89, + 0x0B8A, 0x0020, 0x000A, 0x0020, 0x0020, 0x000D, 0x0B8E, 0x0B8F, + 0x0B90, 0x0020, 0x0B92, 0x0B93, 0x0B94, 0x0B95, 0x0020, 0x0020, + 0x0020, 0x0B99, 0x0B9A, 0x00A0, 0x0020, 0x0B9C, 0x0020, 0x0B9E, + 0x0020, 0x0021, 0x0B9F, 0x0020, 0x0020, 0x0020, 0x0BA3, 0x0BA4, + 0x0029, 0x0028, 0x0020, 0x0020, 0x002C, 0x0020, 0x002E, 0x0BA8, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0BA9, 0x0BAA, 0x0020, 0x003F, + 0x0020, 0x0020, 0x0BAE, 0x0BAF, 0x0BB0, 0x0BB1, 0x0BB2, 0x0BB3, + 0x0BB4, 0x0BB5, 0x0BB6, 0x0BB7, 0x0BB8, 0x0BB9, 0x0020, 0x0020, + 0x0BBE, 0x0BBF, 0x0BC0, 0x0BC1, 0x0BC2, 0x0020, 0x0020, 0x0020, + 0x0BC6, 0x0BC7, 0x0BC8, 0x0020, 0x0BCA, 0x0BCB, 0x0BCC, 0x0BCD, + 0x0BD0, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0BD7, 0x0BF0, 0x0BF1, 0x0BF2, 0x0BF9 +}; + +static const struct codepoint tam_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0B82, 0x01 }, { 0x0B83, 0x02 }, { 0x0B85, 0x03 }, { 0x0B86, 0x04 }, + { 0x0B87, 0x05 }, { 0x0B88, 0x06 }, { 0x0B89, 0x07 }, { 0x0B8A, 0x08 }, + { 0x0B8E, 0x0E }, { 0x0B8F, 0x0F }, { 0x0B90, 0x10 }, { 0x0B92, 0x12 }, + { 0x0B93, 0x13 }, { 0x0B94, 0x14 }, { 0x0B95, 0x15 }, { 0x0B99, 0x19 }, + { 0x0B9A, 0x1A }, { 0x0B9C, 0x1D }, { 0x0B9E, 0x1F }, { 0x0B9F, 0x22 }, + { 0x0BA3, 0x26 }, { 0x0BA4, 0x27 }, { 0x0BA8, 0x2F }, { 0x0BA9, 0x3C }, + { 0x0BAA, 0x3D }, { 0x0BAE, 0x42 }, { 0x0BAF, 0x43 }, { 0x0BB0, 0x44 }, + { 0x0BB1, 0x45 }, { 0x0BB2, 0x46 }, { 0x0BB3, 0x47 }, { 0x0BB4, 0x48 }, + { 0x0BB5, 0x49 }, { 0x0BB6, 0x4A }, { 0x0BB7, 0x4B }, { 0x0BB8, 0x4C }, + { 0x0BB9, 0x4D }, { 0x0BBE, 0x50 }, { 0x0BBF, 0x51 }, { 0x0BC0, 0x52 }, + { 0x0BC1, 0x53 }, { 0x0BC2, 0x54 }, { 0x0BC6, 0x58 }, { 0x0BC7, 0x59 }, + { 0x0BC8, 0x5A }, { 0x0BCA, 0x5C }, { 0x0BCB, 0x5D }, { 0x0BCC, 0x5E }, + { 0x0BCD, 0x5F }, { 0x0BD0, 0x60 }, { 0x0BD7, 0x7B }, { 0x0BF0, 0x7C }, + { 0x0BF1, 0x7D }, { 0x0BF2, 0x7E }, { 0x0BF9, 0x7F } +}; + +/* Appendix A.3.12 in 3GPP TS23.038 */ +static const unsigned short tel_gsm[] = { + 0x0C01, 0x0C02, 0x0C03, 0x0C05, 0x0C06, 0x0C07, 0x0C08, 0x0C09, + 0x0C0A, 0x0C0B, 0x000A, 0x0C0C, 0x0020, 0x000D, 0x0C0E, 0x0C0F, + 0x0C10, 0x0020, 0x0C12, 0x0C13, 0x0C14, 0x0C15, 0x0C16, 0x0C17, + 0x0C18, 0x0C19, 0x0C1A, 0x00A0, 0x0C1B, 0x0C1C, 0x0C1D, 0x0C1E, + 0x0020, 0x0021, 0x0C1F, 0x0C20, 0x0C21, 0x0C22, 0x0C23, 0x0C24, + 0x0029, 0x0028, 0x0C25, 0x0C26, 0x002C, 0x0C27, 0x002E, 0x0C28, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x0020, 0x0C2A, 0x0C2B, 0x003F, + 0x0C2C, 0x0C2D, 0x0C2E, 0x0C2F, 0x0C30, 0x0C31, 0x0C32, 0x0C33, + 0x0020, 0x0C35, 0x0C36, 0x0C37, 0x0C38, 0x0C39, 0x0020, 0x0C3D, + 0x0C3E, 0x0C3F, 0x0C40, 0x0C41, 0x0C42, 0x0C43, 0x0C44, 0x0020, + 0x0C46, 0x0C47, 0x0C48, 0x0020, 0x0C4A, 0x0C4B, 0x0C4C, 0x0C4D, + 0x0C55, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0C56, 0x0C60, 0x0C61, 0x0C62, 0x0C63 +}; + +static const struct codepoint tel_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0C01, 0x00 }, { 0x0C02, 0x01 }, { 0x0C03, 0x02 }, { 0x0C05, 0x03 }, + { 0x0C06, 0x04 }, { 0x0C07, 0x05 }, { 0x0C08, 0x06 }, { 0x0C09, 0x07 }, + { 0x0C0A, 0x08 }, { 0x0C0B, 0x09 }, { 0x0C0C, 0x0B }, { 0x0C0E, 0x0E }, + { 0x0C0F, 0x0F }, { 0x0C10, 0x10 }, { 0x0C12, 0x12 }, { 0x0C13, 0x13 }, + { 0x0C14, 0x14 }, { 0x0C15, 0x15 }, { 0x0C16, 0x16 }, { 0x0C17, 0x17 }, + { 0x0C18, 0x18 }, { 0x0C19, 0x19 }, { 0x0C1A, 0x1A }, { 0x0C1B, 0x1C }, + { 0x0C1C, 0x1D }, { 0x0C1D, 0x1E }, { 0x0C1E, 0x1F }, { 0x0C1F, 0x22 }, + { 0x0C20, 0x23 }, { 0x0C21, 0x24 }, { 0x0C22, 0x25 }, { 0x0C23, 0x26 }, + { 0x0C24, 0x27 }, { 0x0C25, 0x2A }, { 0x0C26, 0x2B }, { 0x0C27, 0x2D }, + { 0x0C28, 0x2F }, { 0x0C2A, 0x3D }, { 0x0C2B, 0x3E }, { 0x0C2C, 0x40 }, + { 0x0C2D, 0x41 }, { 0x0C2E, 0x42 }, { 0x0C2F, 0x43 }, { 0x0C30, 0x44 }, + { 0x0C31, 0x45 }, { 0x0C32, 0x46 }, { 0x0C33, 0x47 }, { 0x0C35, 0x49 }, + { 0x0C36, 0x4A }, { 0x0C37, 0x4B }, { 0x0C38, 0x4C }, { 0x0C39, 0x4D }, + { 0x0C3D, 0x4F }, { 0x0C3E, 0x50 }, { 0x0C3F, 0x51 }, { 0x0C40, 0x52 }, + { 0x0C41, 0x53 }, { 0x0C42, 0x54 }, { 0x0C43, 0x55 }, { 0x0C44, 0x56 }, + { 0x0C46, 0x58 }, { 0x0C47, 0x59 }, { 0x0C48, 0x5A }, { 0x0C4A, 0x5C }, + { 0x0C4B, 0x5D }, { 0x0C4C, 0x5E }, { 0x0C4D, 0x5F }, { 0x0C55, 0x60 }, + { 0x0C56, 0x7B }, { 0x0C60, 0x7C }, { 0x0C61, 0x7D }, { 0x0C62, 0x7E }, + { 0x0C63, 0x7F } +}; + +/* Appendix A.3.13 in 3GPP TS23.038 */ +static const unsigned short urd_gsm[] = { + 0x0627, 0x0622, 0x0628, 0x067B, 0x0680, 0x067E, 0x06A6, 0x062A, + 0x06C2, 0x067F, 0x000A, 0x0679, 0x067D, 0x000D, 0x067A, 0x067C, + 0x062B, 0x062C, 0x0681, 0x0684, 0x0683, 0x0685, 0x0686, 0x0687, + 0x062D, 0x062E, 0x062F, 0x00A0, 0x068C, 0x0688, 0x0689, 0x068A, + 0x0020, 0x0021, 0x068F, 0x068D, 0x0630, 0x0631, 0x0691, 0x0693, + 0x0029, 0x0028, 0x0699, 0x0632, 0x002C, 0x0696, 0x002E, 0x0698, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x069A, 0x0633, 0x0634, 0x003F, + 0x0635, 0x0636, 0x0637, 0x0638, 0x0639, 0x0641, 0x0642, 0x06A9, + 0x06AA, 0x06AB, 0x06AF, 0x06B3, 0x06B1, 0x0644, 0x0645, 0x0646, + 0x06BA, 0x06BB, 0x06BC, 0x0648, 0x06C4, 0x06D5, 0x06C1, 0x06BE, + 0x0621, 0x06CC, 0x06D0, 0x06D2, 0x064D, 0x0650, 0x064F, 0x0657, + 0x0654, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x0655, 0x0651, 0x0653, 0x0656, 0x0670 +}; + +const struct codepoint urd_unicode[] = { + { 0x000A, 0x0A }, { 0x000D, 0x0D }, { 0x0020, 0x20 }, { 0x0021, 0x21 }, + { 0x0028, 0x29 }, { 0x0029, 0x28 }, { 0x002C, 0x2C }, { 0x002E, 0x2E }, + { 0x0030, 0x30 }, { 0x0031, 0x31 }, { 0x0032, 0x32 }, { 0x0033, 0x33 }, + { 0x0034, 0x34 }, { 0x0035, 0x35 }, { 0x0036, 0x36 }, { 0x0037, 0x37 }, + { 0x0038, 0x38 }, { 0x0039, 0x39 }, { 0x003A, 0x3A }, { 0x003B, 0x3B }, + { 0x003F, 0x3F }, { 0x0061, 0x61 }, { 0x0062, 0x62 }, { 0x0063, 0x63 }, + { 0x0064, 0x64 }, { 0x0065, 0x65 }, { 0x0066, 0x66 }, { 0x0067, 0x67 }, + { 0x0068, 0x68 }, { 0x0069, 0x69 }, { 0x006A, 0x6A }, { 0x006B, 0x6B }, + { 0x006C, 0x6C }, { 0x006D, 0x6D }, { 0x006E, 0x6E }, { 0x006F, 0x6F }, + { 0x0070, 0x70 }, { 0x0071, 0x71 }, { 0x0072, 0x72 }, { 0x0073, 0x73 }, + { 0x0074, 0x74 }, { 0x0075, 0x75 }, { 0x0076, 0x76 }, { 0x0077, 0x77 }, + { 0x0078, 0x78 }, { 0x0079, 0x79 }, { 0x007A, 0x7A }, { 0x00A0, 0x20 }, + { 0x0621, 0x58 }, { 0x0622, 0x01 }, { 0x0627, 0x00 }, { 0x0628, 0x02 }, + { 0x062A, 0x07 }, { 0x062B, 0x10 }, { 0x062C, 0x11 }, { 0x062D, 0x18 }, + { 0x062E, 0x19 }, { 0x062F, 0x1A }, { 0x0630, 0x24 }, { 0x0631, 0x25 }, + { 0x0632, 0x2B }, { 0x0633, 0x3D }, { 0x0634, 0x3E }, { 0x0635, 0x40 }, + { 0x0636, 0x41 }, { 0x0637, 0x42 }, { 0x0638, 0x43 }, { 0x0639, 0x44 }, + { 0x0641, 0x45 }, { 0x0642, 0x46 }, { 0x0644, 0x4D }, { 0x0645, 0x4E }, + { 0x0646, 0x4F }, { 0x0648, 0x53 }, { 0x064D, 0x5C }, { 0x064F, 0x5E }, + { 0x0650, 0x5D }, { 0x0651, 0x7C }, { 0x0653, 0x7D }, { 0x0654, 0x60 }, + { 0x0655, 0x7B }, { 0x0656, 0x7E }, { 0x0657, 0x5F }, { 0x0670, 0x7F }, + { 0x0679, 0x0B }, { 0x067A, 0x0E }, { 0x067B, 0x03 }, { 0x067C, 0x0F }, + { 0x067D, 0x0C }, { 0x067E, 0x05 }, { 0x067F, 0x09 }, { 0x0680, 0x04 }, + { 0x0681, 0x12 }, { 0x0683, 0x14 }, { 0x0684, 0x13 }, { 0x0685, 0x15 }, + { 0x0686, 0x16 }, { 0x0687, 0x17 }, { 0x0688, 0x1D }, { 0x0689, 0x1E }, + { 0x068A, 0x1F }, { 0x068C, 0x1C }, { 0x068D, 0x23 }, { 0x068F, 0x22 }, + { 0x0691, 0x26 }, { 0x0693, 0x27 }, { 0x0696, 0x2D }, { 0x0698, 0x2F }, + { 0x0699, 0x2A }, { 0x069A, 0x3C }, { 0x06A6, 0x06 }, { 0x06A9, 0x47 }, + { 0x06AA, 0x48 }, { 0x06AB, 0x49 }, { 0x06AF, 0x4A }, { 0x06B1, 0x4C }, + { 0x06B3, 0x4B }, { 0x06BA, 0x50 }, { 0x06BB, 0x51 }, { 0x06BC, 0x52 }, + { 0x06BE, 0x57 }, { 0x06C1, 0x56 }, { 0x06C2, 0x08 }, { 0x06C4, 0x54 }, + { 0x06CC, 0x59 }, { 0x06D0, 0x5A }, { 0x06D2, 0x5B }, { 0x06D5, 0x55 } +}; + static int compare_codepoints(const void *a, const void *b) { const struct codepoint *ca = (const struct codepoint *) a; @@ -523,7 +2712,67 @@ t->locking_u = por_unicode; t->locking_len_u = TABLE_SIZE(por_unicode); return TRUE; - } + + case GSM_DIALECT_BENGALI: + t->locking_g = ben_gsm; + t->locking_u = ben_unicode; + t->locking_len_u = TABLE_SIZE(ben_unicode); + return TRUE; + + case GSM_DIALECT_GUJARATI: + t->locking_g = guj_gsm; + t->locking_u = guj_unicode; + t->locking_len_u = TABLE_SIZE(guj_unicode); + return TRUE; + + case GSM_DIALECT_HINDI: + t->locking_g = hin_gsm; + t->locking_u = hin_unicode; + t->locking_len_u = TABLE_SIZE(hin_unicode); + return TRUE; + + case GSM_DIALECT_KANNADA: + t->locking_g = kan_gsm; + t->locking_u = kan_unicode; + t->locking_len_u = TABLE_SIZE(kan_unicode); + return TRUE; + + case GSM_DIALECT_MALAYALAM: + t->locking_g = mal_gsm; + t->locking_u = mal_unicode; + t->locking_len_u = TABLE_SIZE(mal_unicode); + return TRUE; + + case GSM_DIALECT_ORIYA: + t->locking_g = ori_gsm; + t->locking_u = ori_unicode; + t->locking_len_u = TABLE_SIZE(ori_unicode); + return TRUE; + + case GSM_DIALECT_PUNJABI: + t->locking_g = pun_gsm; + t->locking_u = pun_unicode; + t->locking_len_u = TABLE_SIZE(pun_unicode); + return TRUE; + + case GSM_DIALECT_TAMIL: + t->locking_g = tam_gsm; + t->locking_u = tam_unicode; + t->locking_len_u = TABLE_SIZE(tam_unicode); + return TRUE; + + case GSM_DIALECT_TELUGU: + t->locking_g = tel_gsm; + t->locking_u = tel_unicode; + t->locking_len_u = TABLE_SIZE(tel_unicode); + return TRUE; + + case GSM_DIALECT_URDU: + t->locking_g = urd_gsm; + t->locking_u = urd_unicode; + t->locking_len_u = TABLE_SIZE(urd_unicode); + return TRUE; + } return FALSE; } @@ -559,7 +2808,77 @@ t->single_u = por_ext_unicode; t->single_len_u = TABLE_SIZE(por_ext_unicode); return TRUE; - } + + case GSM_DIALECT_BENGALI: + t->single_g = ben_ext_gsm; + t->single_len_g = TABLE_SIZE(ben_ext_gsm); + t->single_u = ben_ext_unicode; + t->single_len_u = TABLE_SIZE(ben_ext_unicode); + return TRUE; + + case GSM_DIALECT_GUJARATI: + t->single_g = guj_ext_gsm; + t->single_len_g = TABLE_SIZE(guj_ext_gsm); + t->single_u = guj_ext_unicode; + t->single_len_u = TABLE_SIZE(guj_ext_unicode); + return TRUE; + + case GSM_DIALECT_HINDI: + t->single_g = hin_ext_gsm; + t->single_len_g = TABLE_SIZE(hin_ext_gsm); + t->single_u = hin_ext_unicode; + t->single_len_u = TABLE_SIZE(hin_ext_unicode); + return TRUE; + + case GSM_DIALECT_KANNADA: + t->single_g = kan_ext_gsm; + t->single_len_g = TABLE_SIZE(kan_ext_gsm); + t->single_u = kan_ext_unicode; + t->single_len_u = TABLE_SIZE(kan_ext_unicode); + return TRUE; + + case GSM_DIALECT_MALAYALAM: + t->single_g = mal_ext_gsm; + t->single_len_g = TABLE_SIZE(mal_ext_gsm); + t->single_u = mal_ext_unicode; + t->single_len_u = TABLE_SIZE(mal_ext_unicode); + return TRUE; + + case GSM_DIALECT_ORIYA: + t->single_g = ori_ext_gsm; + t->single_len_g = TABLE_SIZE(ori_ext_gsm); + t->single_u = ori_ext_unicode; + t->single_len_u = TABLE_SIZE(ori_ext_unicode); + return TRUE; + + case GSM_DIALECT_PUNJABI: + t->single_g = pun_ext_gsm; + t->single_len_g = TABLE_SIZE(pun_ext_gsm); + t->single_u = pun_ext_unicode; + t->single_len_u = TABLE_SIZE(pun_ext_unicode); + return TRUE; + + case GSM_DIALECT_TAMIL: + t->single_g = tam_ext_gsm; + t->single_len_g = TABLE_SIZE(tam_ext_gsm); + t->single_u = tam_ext_unicode; + t->single_len_u = TABLE_SIZE(tam_ext_unicode); + return TRUE; + + case GSM_DIALECT_TELUGU: + t->single_g = tel_ext_gsm; + t->single_len_g = TABLE_SIZE(tel_ext_gsm); + t->single_u = tel_ext_unicode; + t->single_len_u = TABLE_SIZE(tel_ext_unicode); + return TRUE; + + case GSM_DIALECT_URDU: + t->single_g = urd_ext_gsm; + t->single_len_g = TABLE_SIZE(urd_ext_gsm); + t->single_u = urd_ext_unicode; + t->single_len_u = TABLE_SIZE(urd_ext_unicode); + return TRUE; + } return FALSE; } | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/util.h ^ |
@@ -24,6 +24,16 @@ GSM_DIALECT_TURKISH, GSM_DIALECT_SPANISH, GSM_DIALECT_PORTUGUESE, + GSM_DIALECT_BENGALI, + GSM_DIALECT_GUJARATI, + GSM_DIALECT_HINDI, + GSM_DIALECT_KANNADA, + GSM_DIALECT_MALAYALAM, + GSM_DIALECT_ORIYA, + GSM_DIALECT_PUNJABI, + GSM_DIALECT_TAMIL, + GSM_DIALECT_TELUGU, + GSM_DIALECT_URDU, }; char *convert_gsm_to_utf8(const unsigned char *text, long len, long *items_read, | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/test/change-pin ^ |
@@ -10,7 +10,7 @@ pin_type = sys.argv[2] old_pin = sys.argv[3] new_pin = sys.argv[4] -elif len(sys.argv) == 3: +elif len(sys.argv) == 4: manager = dbus.Interface(bus.get_object('org.ofono', '/'), 'org.ofono.Manager') modems = manager.GetModems() | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/test/set-ddr ^ |
@@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import sys import dbus | ||
[-] [+] | Added | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/test/set-sms-alphabet ^ |
@@ -0,0 +1,27 @@ +#!/usr/bin/python3 + +import dbus +import sys + +bus = dbus.SystemBus() + +if len(sys.argv) == 3: + path = sys.argv[1] + alphabet = sys.argv[2] +elif len(sys.argv) == 2: + manager = dbus.Interface(bus.get_object('org.ofono', '/'), + 'org.ofono.Manager') + modems = manager.GetModems() + path = modems[0][0] + alphabet = sys.argv[1] +else: + print("%s [PATH] turkish|spanish|portuguese|bengali|gujarati|hindi \ + |kannada|malayalam|oriya|punjabi|tamil|telugu|urdu" % + (sys.argv[0])) + sys.exit(1) + +print("Setting alphabet for modem %s..." % path) +sms = dbus.Interface(bus.get_object('org.ofono', path), + 'org.ofono.MessageManager') + +sms.SetProperty("Alphabet", dbus.String(alphabet)); | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/rilmodem-test-engine.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <stdio.h> #include <netinet/in.h> #include <sys/socket.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/rilmodem-test-server.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <netinet/in.h> #include <sys/socket.h> #include <sys/un.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-cb.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <glib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-cs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <glib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-gprs.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <glib.h> | ||
[-] [+] | Changed | _service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-sms.c ^ |
@@ -23,7 +23,6 @@ #include <config.h> #endif -#define _GNU_SOURCE #include <assert.h> #include <errno.h> #include <glib.h> |