[-]
[+]
|
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.merproject.org/slava/ofono.git</param>
<param name="branch">master</param>
- <param name="revision">1025a6c</param>
+ <param name="revision">49b752f0</param>
</service>
</services>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git18.tar.bz2/ofono/drivers/ril/ril_data.c
^
|
@@ -37,7 +37,8 @@
enum ril_data_priv_flags {
RIL_DATA_FLAG_ALLOWED = 0x01,
- RIL_DATA_FLAG_ON = 0x02
+ RIL_DATA_FLAG_MAX_SPEED = 0x02,
+ RIL_DATA_FLAG_ON = 0x04
};
/*
@@ -48,8 +49,13 @@
*
* There's one ril_data per slot.
*
- * RIL_DATA_FLAG_ALLOWED is set for the last SIM for which ril_data_allow(TRUE)
- * was called. No more than one SIM at a time has this flag set.
+ * RIL_DATA_FLAG_ALLOWED is set for the last SIM for which ril_data_allow()
+ * was called with non-zero role. No more than one SIM at a time has this
+ * flag set.
+ *
+ * RIL_DATA_FLAG_MAX_SPEED is set for the last SIM for which ril_data_allow()
+ * was called with RIL_DATA_ROLE_INTERNET. No more than one SIM at a time has
+ * this flag set.
*
* RIL_DATA_FLAG_ON is set for the active SIM after RIL_REQUEST_ALLOW_DATA
* has successfully completed. For RIL version < 10 it's set immediately.
@@ -167,8 +173,6 @@
static gboolean ril_data_manager_handover(struct ril_data_manager *dm);
static void ril_data_manager_check_data(struct ril_data_manager *dm);
static void ril_data_manager_check_network_mode(struct ril_data_manager *dm);
-static void ril_data_manager_disallow_all_except(struct ril_data_manager *dm,
- struct ril_data *allowed);
static void ril_data_power_update(struct ril_data *self);
static void ril_data_signal_emit(struct ril_data *self, enum ril_data_signal id)
@@ -842,7 +846,7 @@
/*
* If RIL_REQUEST_DEACTIVATE_DATA_CALL succeeds, some RILs don't
* send RIL_UNSOL_DATA_CALL_LIST_CHANGED even though the list of
- * calls has change. Update the list of calls to account for that.
+ * calls has changed. Update the list of calls to account for that.
*/
if (ril_status == RIL_E_SUCCESS) {
struct ril_data_call_list *list = data->data_calls;
@@ -1138,22 +1142,76 @@
ril_data_power_update(self);
}
-void ril_data_allow(struct ril_data *self, gboolean allow)
+static void ril_data_max_speed_cb(gpointer data, gpointer max_speed)
+{
+ if (data != max_speed) {
+ ((struct ril_data *)data)->priv->flags &=
+ ~RIL_DATA_FLAG_MAX_SPEED;
+ }
+}
+
+static void ril_data_disallow_cb(gpointer data_ptr, gpointer allowed)
+{
+ if (data_ptr != allowed) {
+ struct ril_data *data = data_ptr;
+
+ if (data->priv->flags & RIL_DATA_FLAG_ALLOWED) {
+ const gboolean was_allowed = ril_data_allowed(data);
+ ril_data_disallow(data);
+ if (was_allowed) {
+ ril_data_signal_emit(data,
+ SIGNAL_ALLOW_CHANGED);
+ }
+ }
+ }
+}
+
+void ril_data_allow(struct ril_data *self, enum ril_data_role role)
{
if (G_LIKELY(self)) {
struct ril_data_priv *priv = self->priv;
struct ril_data_manager *dm = priv->dm;
- DBG_(self, "%s", allow ? "yes" : "no");
- if (allow) {
- if (!(priv->flags & RIL_DATA_FLAG_ALLOWED)) {
+ DBG_(self, "%s", (role == RIL_DATA_ROLE_NONE) ? "none" :
+ (role == RIL_DATA_ROLE_MMS) ? "mms" : "internet");
+
+ if (role != RIL_DATA_ROLE_NONE) {
+ gboolean speed_changed = FALSE;
+ if (role == RIL_DATA_ROLE_INTERNET &&
+ !(priv->flags & RIL_DATA_FLAG_MAX_SPEED)) {
+ priv->flags |= RIL_DATA_FLAG_MAX_SPEED;
+ speed_changed = TRUE;
+
+ /*
+ * Clear RIL_DATA_FLAG_MAX_SPEED for
+ * all other slots
+ */
+ g_slist_foreach(dm->data_list,
+ ril_data_max_speed_cb, self);
+ }
+ if (priv->flags & RIL_DATA_FLAG_ALLOWED) {
+ /*
+ * Data is already allowed for this slot,
+ * just adjust the speed if necessary.
+ */
+ if (speed_changed) {
+ ril_data_manager_check_network_mode(dm);
+ }
+ } else {
priv->flags |= RIL_DATA_FLAG_ALLOWED;
priv->flags &= ~RIL_DATA_FLAG_ON;
+
+ /*
+ * Clear RIL_DATA_FLAG_ALLOWED for all
+ * other slots
+ */
+ g_slist_foreach(dm->data_list,
+ ril_data_disallow_cb, self);
+
ril_data_cancel_requests(self,
DATA_REQUEST_FLAG_CANCEL_WHEN_ALLOWED);
- ril_data_power_update(self);
- ril_data_manager_disallow_all_except(dm, self);
ril_data_manager_check_data(dm);
+ ril_data_power_update(self);
}
} else {
if (priv->flags & RIL_DATA_FLAG_ALLOWED) {
@@ -1285,34 +1343,6 @@
}
}
-static void ril_data_manager_disallow_all_except(struct ril_data_manager *self,
- struct ril_data *allowed)
-{
- GSList *l;
-
- for (l= self->data_list; l; l = l->next) {
- struct ril_data *data = l->data;
-
- if (data != allowed &&
- (data->priv->flags & RIL_DATA_FLAG_ALLOWED)) {
- const gboolean was_allowed = ril_data_allowed(data);
-
- /*
- * Since there cannot be more than one active data
- * SIM at a time, no more than one at a time can
- * get disallowed. We could break the loop once we
- * have found it but since the list is quite small,
- * why bother.
- */
- ril_data_disallow(data);
- if (was_allowed) {
- ril_data_signal_emit(data,
- SIGNAL_ALLOW_CHANGED);
- }
- }
- }
-}
-
static gboolean ril_data_manager_requests_pending(struct ril_data_manager *self)
{
GSList *l;
@@ -1332,7 +1362,7 @@
GSList *l;
if (ril_data_manager_handover(self)) {
- gboolean non_gsm_selected = FALSE;
+ gboolean need_fast_access = FALSE;
int non_gsm_count = 0;
/*
@@ -1346,25 +1376,25 @@
if (sim->pref_mode != OFONO_RADIO_ACCESS_MODE_GSM &&
sim->imsi) {
non_gsm_count++;
- if (priv->flags & RIL_DATA_FLAG_ALLOWED) {
- non_gsm_selected = TRUE;
+ if (priv->flags & RIL_DATA_FLAG_MAX_SPEED) {
+ need_fast_access = TRUE;
}
}
}
/*
- * If the selected data SIM has non-GSM mode enabled and
- * non-GSM mode is enabled for more than one SIM, then
- * we need to limit other SIMs to GSM. Otherwise, turn
- * all the limits off.
+ * If the SIM selected for internet access has non-GSM mode
+ * enabled and non-GSM mode is enabled for more than one SIM,
+ * then we need to limit other SIMs to GSM. Otherwise, turn
+ * all limits off.
*/
- if (non_gsm_selected && non_gsm_count > 1) {
+ if (need_fast_access && non_gsm_count > 1) {
for (l= self->data_list; l; l = l->next) {
struct ril_data *data = l->data;
struct ril_data_priv *priv = data->priv;
ril_network_set_max_pref_mode(priv->network,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git18.tar.bz2/ofono/drivers/ril/ril_data.h
^
|
@@ -54,6 +54,12 @@
RIL_DATA_MANAGER_3GLTE_HANDOVER = 0x01
};
+enum ril_data_role {
+ RIL_DATA_ROLE_NONE, /* Data not allowed */
+ RIL_DATA_ROLE_MMS, /* Data is allowed at any speed */
+ RIL_DATA_ROLE_INTERNET /* Data is allowed at full speed */
+};
+
struct ril_data_manager;
struct ril_data_manager *ril_data_manager_new(enum ril_data_manager_flags flg);
struct ril_data_manager *ril_data_manager_ref(struct ril_data_manager *dm);
@@ -79,7 +85,7 @@
ril_data_cb_t cb, void *arg);
void ril_data_remove_handler(struct ril_data *data, gulong id);
-void ril_data_allow(struct ril_data *data, gboolean allow);
+void ril_data_allow(struct ril_data *data, enum ril_data_role role);
struct ril_data_request;
struct ril_data_request *ril_data_call_setup(struct ril_data *data,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git18.tar.bz2/ofono/drivers/ril/ril_gprs_context.c
^
|
@@ -105,24 +105,6 @@
}
}
-static void ril_gprs_context_call_done(struct ril_gprs_context_call *call,
- gboolean ok)
-{
- ofono_gprs_context_cb_t cb = call->cb;
- gpointer data = call->data;
-
- ril_data_request_cancel(call->req);
-
- call->req = NULL;
- call->cb = NULL;
- call->data = NULL;
-
- if (cb) {
- struct ofono_error error;
- cb(ok ? ril_error_ok(&error) : ril_error_failure(&error), data);
- }
-}
-
static void ril_gprs_context_free_active_call(struct ril_gprs_context *gcd)
{
if (gcd->active_call) {
@@ -159,7 +141,17 @@
if (gcd->active_call) {
ril_gprs_context_free_active_call(gcd);
if (gcd->deactivate.req) {
- ril_gprs_context_call_done(&gcd->deactivate, TRUE);
+ /* Complete the deactivate request */
+ ofono_gprs_context_cb_t cb = gcd->deactivate.cb;
+ gpointer data = gcd->deactivate.data;
+
+ ril_data_request_cancel(gcd->deactivate.req);
+ memset(&gcd->deactivate, 0, sizeof(gcd->deactivate));
+ if (cb) {
+ struct ofono_error error;
+ ofono_info("Deactivated data call");
+ cb(ril_error_ok(&error), data);
+ }
}
}
if (gcd->active_ctx_cid != CTX_ID_NONE) {
@@ -549,32 +541,37 @@
int ril_status, void *user_data)
{
struct ril_gprs_context *gcd = user_data;
- struct ofono_error error;
- ofono_gprs_context_cb_t cb;
- gpointer cb_data;
- if (ril_status == RIL_E_SUCCESS) {
- GASSERT(gcd->active_call);
- ril_error_init_ok(&error);
- ofono_info("Deactivated data call");
- } else {
- ril_error_init_failure(&error);
- ofono_error("Deactivate failure: %s",
- ril_error_to_string(ril_status));
- }
+ /*
+ * Data call list may change before the completion of the deactivate
+ * request, in that case ril_gprs_context_set_disconnected will be
+ * invoked and gcd->deactivate.req will be NULL.
+ */
+ if (gcd->deactivate.req) {
+ struct ofono_error error;
+ ofono_gprs_context_cb_t cb = gcd->deactivate.cb;
+ gpointer cb_data = gcd->deactivate.data;
- cb = gcd->deactivate.cb;
- cb_data = gcd->deactivate.data;
- GASSERT(gcd->deactivate.req);
- memset(&gcd->deactivate, 0, sizeof(gcd->deactivate));
+ if (ril_status == RIL_E_SUCCESS) {
+ GASSERT(gcd->active_call);
+ ril_error_init_ok(&error);
+ ofono_info("Deactivated data call");
+ } else {
+ ril_error_init_failure(&error);
+ ofono_error("Deactivate failure: %s",
+ ril_error_to_string(ril_status));
+ }
- if (cb) {
- ril_gprs_context_free_active_call(gcd);
- cb(&error, cb_data);
- } else {
- /* Have to tell ofono that the call has been disconnected */
- ril_gprs_context_set_disconnected(gcd);
+ memset(&gcd->deactivate, 0, sizeof(gcd->deactivate));
+ if (cb) {
+ ril_gprs_context_free_active_call(gcd);
+ cb(&error, cb_data);
+ return;
+ }
}
+
+ /* Make sure we are in the disconnected state */
+ ril_gprs_context_set_disconnected(gcd);
}
static void ril_gprs_context_deactivate_primary(struct ofono_gprs_context *gc,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.17+git18.tar.bz2/ofono/drivers/ril/ril_plugin.c
^
|
@@ -244,7 +244,7 @@
}
if (slot->data) {
- ril_data_allow(slot->data, FALSE);
+ ril_data_allow(slot->data, RIL_DATA_ROLE_NONE);
ril_data_unref(slot->data);
slot->data = NULL;
}
@@ -454,10 +454,12 @@
if (old_data_slot != new_data_slot) {
/* Yes we are switching data SIMs */
if (old_data_slot) {
- ril_data_allow(old_data_slot->data, FALSE);
+ ril_data_allow(old_data_slot->data, RIL_DATA_ROLE_NONE);
}
if (new_data_slot) {
- ril_data_allow(new_data_slot->data, TRUE);
+ ril_data_allow(new_data_slot->data,
+ (new_data_slot == plugin->data_slot) ?
+ RIL_DATA_ROLE_INTERNET : RIL_DATA_ROLE_MMS);
}
}
@@ -648,7 +650,7 @@
slot->modem = NULL;
ril_radio_set_online(slot->radio, FALSE);
- ril_data_allow(slot->data, FALSE);
+ ril_data_allow(slot->data, RIL_DATA_ROLE_NONE);
ril_plugin_update_modem_paths_full(slot->plugin);
}
|