[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -6,7 +6,7 @@
<service name="tar_git">
<param name="url">https://github.com/mer-hybris/ofono-ril-binder-plugin.git</param>
<param name="branch">master</param>
- <param name="revision">20402845052db81ebe804293e4a6229804ea4dbe</param>
+ <param name="revision">b5050bc79fbbe8d8f5c268466128fc8bce275de4</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Added |
_service:tar_git:ofono-ril-binder-plugin-1.2.6.tar.bz2/LICENSE
^
|
@@ -0,0 +1,33 @@
+Copyright (C) 2018-2021 Jolla Ltd.
+Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
+
+You may use this file under the terms of the BSD license as follows:
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the names of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation
+are those of the authors and should not be interpreted as representing
+any official policies, either expressed or implied.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin-1.2.6.tar.bz2/Makefile
^
|
@@ -31,8 +31,8 @@
#
VERSION_MAJOR = 1
-VERSION_MINOR = 0
-VERSION_RELEASE = 16
+VERSION_MINOR = 2
+VERSION_RELEASE = 6
# Version for pkg-config
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin-1.2.6.tar.bz2/src/ril_binder_radio.c
^
|
@@ -1,6 +1,7 @@
/*
- * Copyright (C) 2018-2020 Jolla Ltd.
- * Copyright (C) 2018-2020 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2018-2021 Jolla Ltd.
+ * Copyright (C) 2018-2021 Slava Monich <slava.monich@jolla.com>
+ * Copyright (C) 2021 Open Mobile Platform LLC.
*
* You may use this file under the terms of BSD license as follows:
*
@@ -58,10 +59,34 @@
#define RIL_BINDER_KEY_MODEM "modem"
#define RIL_BINDER_KEY_DEV "dev"
#define RIL_BINDER_KEY_NAME "name"
+#define RIL_BINDER_KEY_INTERFACE "interface"
-#define RIL_BINDER_DEFAULT_MODEM "/ril_0"
-#define RIL_BINDER_DEFAULT_DEV "/dev/hwbinder"
-#define RIL_BINDER_DEFAULT_NAME "slot1"
+#define RIL_BINDER_DEFAULT_MODEM "/ril_0"
+#define RIL_BINDER_DEFAULT_DEV "/dev/hwbinder"
+#define RIL_BINDER_DEFAULT_NAME "slot1"
+
+#define DEFAULT_INTERFACE RADIO_INTERFACE_1_2
+
+#define RIL_PROTO_IP_STR "IP"
+#define RIL_PROTO_IPV6_STR "IPV6"
+#define RIL_PROTO_IPV4V6_STR "IPV4V6"
+
+/* Preferred network types as defined in ril.h */
+enum ril_pref_net_type {
+ PREF_NET_TYPE_GSM_WCDMA = 0,
+ PREF_NET_TYPE_GSM_ONLY = 1,
+ PREF_NET_TYPE_WCDMA = 2,
+ PREF_NET_TYPE_GSM_WCDMA_AUTO = 3,
+ PREF_NET_TYPE_CDMA_EVDO_AUTO = 4,
+ PREF_NET_TYPE_CDMA_ONLY = 5,
+ PREF_NET_TYPE_EVDO_ONLY = 6,
+ PREF_NET_TYPE_GSM_WCDMA_CDMA_EVDO_AUTO = 7,
+ PREF_NET_TYPE_LTE_CDMA_EVDO = 8,
+ PREF_NET_TYPE_LTE_GSM_WCDMA = 9,
+ PREF_NET_TYPE_LTE_CMDA_EVDO_GSM_WCDMA = 10,
+ PREF_NET_TYPE_LTE_ONLY = 11,
+ PREF_NET_TYPE_LTE_WCDMA = 12
+};
enum {
RADIO_EVENT_INDICATION,
@@ -96,17 +121,21 @@
RilBinderOemHook* oemhook;
gulong oemhook_raw_response_id;
GUtilIdleQueue* idle;
- GHashTable* req_map; /* code -> RilBinderRadioCall */
- GHashTable* resp_map; /* resp_tx -> RilBinderRadioCall */
- GHashTable* unsol_map; /* unsol_tx -> RilBinderRadioEvent */
GByteArray* buf;
gulong radio_event_id[RADIO_EVENT_COUNT];
+ /* code -> RilBinderRadioCall */
+ GHashTable* req_map[RADIO_INTERFACE_COUNT];
+ /* resp_tx -> RilBinderRadioCall */
+ GHashTable* resp_map[RADIO_INTERFACE_COUNT];
+ /* unsol_tx -> RilBinderRadioEvent */
+ GHashTable* unsol_map[RADIO_INTERFACE_COUNT];
};
G_DEFINE_TYPE(RilBinderRadio, ril_binder_radio, GRILIO_TYPE_TRANSPORT)
#define PARENT_CLASS ril_binder_radio_parent_class
+#define ARRAY_AND_COUNT(a) a, G_N_ELEMENTS(a)
#define DBG_(self,fmt,args...) \
GDEBUG("%s" fmt, (self)->parent.log_prefix, ##args)
@@ -211,6 +240,125 @@
return (val && val[0]) ? val : def;
}
+static
+void
+ril_binder_radio_init_call_maps(
+ GHashTable* req_map,
+ GHashTable* resp_map,
+ const RilBinderRadioCall* calls,
+ guint count)
+{
+ guint i;
+
+ for (i = 0; i < count; i++) {
+ const RilBinderRadioCall* call = calls + i;
+
+ if (call->req_tx) {
+ g_hash_table_insert(req_map, GINT_TO_POINTER(call->code),
+ (gpointer) call);
+ }
+ if (call->resp_tx) {
+ g_hash_table_insert(resp_map, GINT_TO_POINTER(call->resp_tx),
+ (gpointer) call);
+ }
+ }
+}
+
+static
+void
+ril_binder_radio_init_unsol_map(
+ GHashTable* unsol_map,
+ const RilBinderRadioEvent* events,
+ guint count)
+{
+ guint i;
+
+ for (i = 0; i < count; i++) {
+ const RilBinderRadioEvent* event = events + i;
+
+ g_hash_table_insert(unsol_map, GINT_TO_POINTER(event->unsol_tx),
+ (gpointer) event);
+ }
+}
+
+static
+void
+ril_binder_radio_init_version(
+ RilBinderRadioPriv* priv,
+ RADIO_INTERFACE v,
+ const RilBinderRadioCall* calls,
+ guint num_calls,
+ const RilBinderRadioEvent* events,
+ guint num_events)
+{
+ priv->req_map[v] = g_hash_table_new(g_direct_hash, g_direct_equal);
+ priv->resp_map[v] = g_hash_table_new(g_direct_hash, g_direct_equal);
+ priv->unsol_map[v] = g_hash_table_new(g_direct_hash, g_direct_equal);
+ ril_binder_radio_init_unsol_map(priv->unsol_map[v], events, num_events);
+ ril_binder_radio_init_call_maps(priv->req_map[v], priv->resp_map[v],
+ calls, num_calls);
+}
+
+static
+RADIO_APN_TYPES
+ril_binder_radio_apn_types_for_profile(
+ RADIO_DATA_PROFILE_ID profile_id)
+{
+ switch (profile_id) {
+ case RADIO_DATA_PROFILE_INVALID:
+ return RADIO_APN_TYPE_NONE;
+ case RADIO_DATA_PROFILE_IMS:
+ return RADIO_APN_TYPE_IMS;
+ case RADIO_DATA_PROFILE_CBS:
+ return RADIO_APN_TYPE_CBS;
+ case RADIO_DATA_PROFILE_FOTA:
+ return RADIO_APN_TYPE_FOTA;
+ case RADIO_DATA_PROFILE_DEFAULT:
+ return (RADIO_APN_TYPE_DEFAULT |
+ RADIO_APN_TYPE_SUPL |
+ RADIO_APN_TYPE_IA);
+ default:
+ /*
+ * There's no standard profile id for MMS, OEM-specific profile ids
+ * are used for that.
+ */
+ return RADIO_APN_TYPE_MMS;
+ }
+}
+
+static
+const char *
+radio_pdp_protocol_type_to_str(enum radio_pdp_protocol_type type)
+{
+ switch (type) {
+ case RADIO_PDP_PROTOCOL_IP:
+ return RIL_PROTO_IP_STR;
+ case RADIO_PDP_PROTOCOL_IPV6:
+ return RIL_PROTO_IPV6_STR;
+ case RADIO_PDP_PROTOCOL_IPV4V6:
+ return RIL_PROTO_IPV4V6_STR;
+ default:
+ return "";
+ }
+}
+
+static
+const char*
+ril_binder_radio_interface_name(
+ RADIO_INTERFACE interface)
+{
+ switch (interface) {
+ case RADIO_INTERFACE_1_0: return "radio@1.0";
+ case RADIO_INTERFACE_1_1: return "radio@1.1";
+ case RADIO_INTERFACE_1_2: return "radio@1.2";
+ case RADIO_INTERFACE_1_3: return "radio@1.3";
+ case RADIO_INTERFACE_1_4: return "radio@1.4";
+ case RADIO_INTERFACE_COUNT:
+ break;
+ }
+ return NULL;
+}
+
/*==========================================================================*
* Encoders (plugin -> binder)
*==========================================================================*/
@@ -411,6 +559,45 @@
|