iface-modem: during init, fall down to next states directly
This commit is contained in:
@@ -1083,7 +1083,7 @@ static void
|
|||||||
interface_initialization_step (InitializationContext *ctx)
|
interface_initialization_step (InitializationContext *ctx)
|
||||||
{
|
{
|
||||||
switch (ctx->step) {
|
switch (ctx->step) {
|
||||||
case INITIALIZATION_STEP_FIRST: {
|
case INITIALIZATION_STEP_FIRST:
|
||||||
/* Load device if not done before */
|
/* Load device if not done before */
|
||||||
if (!mm_gdbus_modem_get_device (ctx->skeleton)) {
|
if (!mm_gdbus_modem_get_device (ctx->skeleton)) {
|
||||||
gchar *device;
|
gchar *device;
|
||||||
@@ -1114,8 +1114,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
mm_gdbus_modem_set_plugin (ctx->skeleton, plugin);
|
mm_gdbus_modem_set_plugin (ctx->skeleton, plugin);
|
||||||
g_free (plugin);
|
g_free (plugin);
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
}
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_CURRENT_CAPABILITIES:
|
case INITIALIZATION_STEP_CURRENT_CAPABILITIES:
|
||||||
/* Current capabilities may change during runtime, i.e. if new firmware reloaded; but we'll
|
/* Current capabilities may change during runtime, i.e. if new firmware reloaded; but we'll
|
||||||
@@ -1131,7 +1131,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_MODEM_CAPABILITIES:
|
case INITIALIZATION_STEP_MODEM_CAPABILITIES:
|
||||||
/* Modem capabilities are meant to be loaded only once during the whole
|
/* Modem capabilities are meant to be loaded only once during the whole
|
||||||
@@ -1151,7 +1152,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
mm_gdbus_modem_set_modem_capabilities (
|
mm_gdbus_modem_set_modem_capabilities (
|
||||||
ctx->skeleton,
|
ctx->skeleton,
|
||||||
mm_gdbus_modem_get_current_capabilities (ctx->skeleton));
|
mm_gdbus_modem_get_current_capabilities (ctx->skeleton));
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_MAX_BEARERS:
|
case INITIALIZATION_STEP_MAX_BEARERS:
|
||||||
/* Max bearers value is meant to be loaded only once during the whole
|
/* Max bearers value is meant to be loaded only once during the whole
|
||||||
@@ -1168,7 +1170,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
}
|
}
|
||||||
/* Default to one bearer */
|
/* Default to one bearer */
|
||||||
mm_gdbus_modem_set_max_bearers (ctx->skeleton, 1);
|
mm_gdbus_modem_set_max_bearers (ctx->skeleton, 1);
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_MAX_ACTIVE_BEARERS:
|
case INITIALIZATION_STEP_MAX_ACTIVE_BEARERS:
|
||||||
/* Max active bearers value is meant to be loaded only once during the
|
/* Max active bearers value is meant to be loaded only once during the
|
||||||
@@ -1188,7 +1191,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
mm_gdbus_modem_set_max_active_bearers (
|
mm_gdbus_modem_set_max_active_bearers (
|
||||||
ctx->skeleton,
|
ctx->skeleton,
|
||||||
mm_gdbus_modem_get_max_bearers (ctx->skeleton));
|
mm_gdbus_modem_get_max_bearers (ctx->skeleton));
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_MANUFACTURER:
|
case INITIALIZATION_STEP_MANUFACTURER:
|
||||||
/* Manufacturer is meant to be loaded only once during the whole
|
/* Manufacturer is meant to be loaded only once during the whole
|
||||||
@@ -1203,7 +1207,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_MODEL:
|
case INITIALIZATION_STEP_MODEL:
|
||||||
/* Model is meant to be loaded only once during the whole
|
/* Model is meant to be loaded only once during the whole
|
||||||
@@ -1218,7 +1223,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_REVISION:
|
case INITIALIZATION_STEP_REVISION:
|
||||||
/* Revision is meant to be loaded only once during the whole
|
/* Revision is meant to be loaded only once during the whole
|
||||||
@@ -1233,7 +1239,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_EQUIPMENT_ID:
|
case INITIALIZATION_STEP_EQUIPMENT_ID:
|
||||||
/* Equipment ID is meant to be loaded only once during the whole
|
/* Equipment ID is meant to be loaded only once during the whole
|
||||||
@@ -1248,7 +1255,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_DEVICE_ID:
|
case INITIALIZATION_STEP_DEVICE_ID:
|
||||||
/* Device ID is meant to be loaded only once during the whole
|
/* Device ID is meant to be loaded only once during the whole
|
||||||
@@ -1263,7 +1271,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_UNLOCK_REQUIRED:
|
case INITIALIZATION_STEP_UNLOCK_REQUIRED:
|
||||||
/* Only check unlock required if we were previously not unlocked */
|
/* Only check unlock required if we were previously not unlocked */
|
||||||
@@ -1273,7 +1282,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_UNLOCK_RETRIES:
|
case INITIALIZATION_STEP_UNLOCK_RETRIES:
|
||||||
if ((MMModemLock)mm_gdbus_modem_get_unlock_required (ctx->skeleton) == MM_MODEM_LOCK_NONE) {
|
if ((MMModemLock)mm_gdbus_modem_get_unlock_required (ctx->skeleton) == MM_MODEM_LOCK_NONE) {
|
||||||
@@ -1292,7 +1302,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
/* Default to 999 when we cannot check it */
|
/* Default to 999 when we cannot check it */
|
||||||
mm_gdbus_modem_set_unlock_retries (ctx->skeleton, 999);
|
mm_gdbus_modem_set_unlock_retries (ctx->skeleton, 999);
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_SIM: {
|
case INITIALIZATION_STEP_SIM: {
|
||||||
MMSim *sim = NULL;
|
MMSim *sim = NULL;
|
||||||
@@ -1331,7 +1342,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_SUPPORTED_BANDS:
|
case INITIALIZATION_STEP_SUPPORTED_BANDS:
|
||||||
/* Supported bands are meant to be loaded only once during the whole
|
/* Supported bands are meant to be loaded only once during the whole
|
||||||
@@ -1346,7 +1358,8 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
ctx);
|
ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
/* Fall down to next step */
|
||||||
|
ctx->step++;
|
||||||
|
|
||||||
case INITIALIZATION_STEP_LAST:
|
case INITIALIZATION_STEP_LAST:
|
||||||
/* We are done without errors! */
|
/* We are done without errors! */
|
||||||
@@ -1357,9 +1370,7 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Go on to next step */
|
g_assert_not_reached ();
|
||||||
ctx->step++;
|
|
||||||
interface_initialization_step (ctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user