[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -1,8 +1,8 @@
<services>
<service name="tar_git">
- <param name="url">https://github.com/sailfishos-oneplus5/ofono-ril-binder-plugin.git</param>
+ <param name="url">https://github.com/mer-hybris/ofono-ril-binder-plugin.git</param>
<param name="branch">master</param>
- <param name="revision">HEAD</param>
+ <param name="revision">1.2.1</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
[-]
[+]
|
Added |
_service:tar_git:ofono-ril-binder-plugin-1.2.1.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.1.tar.bz2/Makefile
^
|
@@ -31,8 +31,8 @@
#
VERSION_MAJOR = 1
-VERSION_MINOR = 0
-VERSION_RELEASE = 14
+VERSION_MINOR = 2
+VERSION_RELEASE = 1
# Version for pkg-config
PCVERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE)
@@ -262,13 +262,13 @@
INSTALL_DIRS = $(INSTALL) -d
INSTALL_FILES = $(INSTALL) -m 644
-INSTALL_PLUGIN_DIR = $(DESTDIR)/usr/lib/ofono/plugins
INSTALL_INCLUDE_DIR = $(DESTDIR)/usr/include/$(NAME)
INSTALL_LIB_DIR = $(DESTDIR)$(ABS_LIBDIR)
+INSTALL_PLUGIN_DIR = $(INSTALL_LIB_DIR)/ofono/plugins
INSTALL_PKGCONFIG_DIR = $(DESTDIR)$(ABS_LIBDIR)/pkgconfig
install: $(INSTALL_LIB_DIR) $(INSTALL_PLUGIN_DIR)
- $(INSTALL_FILES) $(RELEASE_PLUGIN) $(INSTALL_PLUGIN_DIR)
+ $(INSTALL) -m 755 $(RELEASE_PLUGIN) $(INSTALL_PLUGIN_DIR)
$(INSTALL_FILES) $(RELEASE_LIB) $(INSTALL_LIB_DIR)
ln -sf $(LIB_SO) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK2)
ln -sf $(LIB_SYMLINK2) $(INSTALL_LIB_DIR)/$(LIB_SYMLINK1)
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-ril-binder-plugin-1.2.1.tar.bz2/src/ril_binder_radio.c
^
|
@@ -1,6 +1,6 @@
/*
- * 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>
*
* You may use this file under the terms of BSD license as follows:
*
@@ -96,17 +96,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 +215,47 @@
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);
+ }
+}
+
/*==========================================================================*
* Encoders (plugin -> binder)
*==========================================================================*/
@@ -411,6 +456,45 @@
return ok;
}
+static
+gboolean
+ril_binder_radio_encode_deactivate_data_call_1_2(
+ GRilIoRequest* in,
+ GBinderLocalRequest* out)
+{
+ gboolean ok = FALSE;
+ GRilIoParser parser;
+ gint32 count, cid, reason;
+ char* cid_str = NULL;
+ char* reason_str = NULL;
+
+ ril_binder_radio_init_parser(&parser, in);
+ if (grilio_parser_get_int32(&parser, &count) && count == 2 &&
+ (cid_str = grilio_parser_get_utf8(&parser)) != NULL &&
+ (reason_str = grilio_parser_get_utf8(&parser)) != NULL &&
+ gutil_parse_int(cid_str, 10, &cid) &&
+ gutil_parse_int(reason_str, 10, &reason)) {
+ GBinderWriter writer;
+
+ if (reason == 0) {
+ reason = RADIO_DATA_REQUEST_REASON_NORMAL;
+ } else if (reason == 1) {
+ reason = RADIO_DATA_REQUEST_REASON_SHUTDOWN;
+ } else {
+ reason = RADIO_DATA_REQUEST_REASON_HANDOVER;
+ }
+
+ gbinder_local_request_init_writer(out, &writer);
+ gbinder_writer_append_int32(&writer, grilio_request_serial(in));
+ gbinder_writer_append_int32(&writer, cid);
+ gbinder_writer_append_int32(&writer, reason);
+ ok = TRUE;
+ }
+ g_free(cid_str);
+ g_free(reason_str);
+ return ok;
+}
+
/**
* @param int32_t Serial number of request.
* @param dialInfo Dial struct
@@ -599,6 +683,135 @@
/**
* @param int32_t Serial number of request.
+ * @param RadioTechnology Radio technology to use.
+ * @param DataProfileInfo Data profile info.
+ * @param bool modemCognitive Indicating this profile was sent to the modem
+ * through setDataProfile earlier.
+ * @param bool roamingAllowed Indicating data roaming is allowed or not.
+ * @param bool isRoaming Indicating the device is roaming or not.
+ */
+static
+gboolean
+ril_binder_radio_encode_setup_data_call_1_2(
+ GRilIoRequest* in,
+ GBinderLocalRequest* out)
+{
+ gboolean ok = FALSE;
+ GRilIoParser parser;
+ gint32 count, tech, auth, profile_id;
+ char* profile_str = NULL;
+ char* tech_str = NULL;
+ char* auth_str = NULL;
+ char* apn = NULL;
+ char* user = NULL;
+ char* password = NULL;
+ char* proto = NULL;
+
+ ril_binder_radio_init_parser(&parser, in);
+ if (grilio_parser_get_int32(&parser, &count) && count == 7 &&
+ (tech_str = grilio_parser_get_utf8(&parser)) != NULL &&
+ gutil_parse_int(tech_str, 10, &tech) &&
+ (profile_str = grilio_parser_get_utf8(&parser)) != NULL &&
+ gutil_parse_int(profile_str, 10, &profile_id) &&
+ (apn = grilio_parser_get_utf8(&parser)) != NULL &&
+ (user = grilio_parser_get_utf8(&parser)) != NULL &&
+ (password = grilio_parser_get_utf8(&parser)) != NULL &&
+ (auth_str = grilio_parser_get_utf8(&parser)) != NULL &&
+ gutil_parse_int(auth_str, 10, &auth) &&
+ (proto = grilio_parser_get_utf8(&parser)) != NULL) {
+ GBinderWriter writer;
+ RadioDataProfile* profile;
+
+ /* ril.h has this to say about the radio tech parameter:
+ *
+ * ((const char **)data)[0] Radio technology to use: 0-CDMA,
+ * 1-GSM/UMTS, 2... for values above 2
+ * this is RIL_RadioTechnology + 2.
+ *
+ * Makes little sense but it is what it is.
+ */
+ if (tech > 4) {
+ tech -= 2;
+ }
+
+ tech = RADIO_ACCESS_NETWORK_UNKNOWN;
+ switch ((RADIO_TECH)tech) {
+ case RADIO_TECH_GPRS:
+ case RADIO_TECH_EDGE:
+ case RADIO_TECH_GSM:
+ tech = RADIO_ACCESS_NETWORK_GERAN;
+ break;
+ case RADIO_TECH_UMTS:
+ case RADIO_TECH_HSDPA:
+ case RADIO_TECH_HSPAP:
+ case RADIO_TECH_HSUPA:
+ case RADIO_TECH_HSPA:
+ case RADIO_TECH_TD_SCDMA:
+ tech = RADIO_ACCESS_NETWORK_UTRAN;
+ break;
+ case RADIO_TECH_IS95A:
+ case RADIO_TECH_IS95B:
|