bearer-qmi: bring master interface up on connection attempt
The user of the ModemManager API will bring up the data network interface exposed in the Bearer IP settings (i.e. the link interface when using multiplexing). But for instantiated network links, we also need to have the master interface brought up before any traffic can go through the link interface. We don't check whether the master interface is already up before attempting to bring it up, we just attempt to bring it up.
This commit is contained in:
@@ -417,6 +417,7 @@ typedef enum {
|
|||||||
CONNECT_STEP_OPEN_QMI_PORT,
|
CONNECT_STEP_OPEN_QMI_PORT,
|
||||||
CONNECT_STEP_SETUP_DATA_FORMAT,
|
CONNECT_STEP_SETUP_DATA_FORMAT,
|
||||||
CONNECT_STEP_SETUP_LINK,
|
CONNECT_STEP_SETUP_LINK,
|
||||||
|
CONNECT_STEP_SETUP_LINK_MASTER_UP,
|
||||||
CONNECT_STEP_IP_METHOD,
|
CONNECT_STEP_IP_METHOD,
|
||||||
CONNECT_STEP_IPV4,
|
CONNECT_STEP_IPV4,
|
||||||
CONNECT_STEP_WDS_CLIENT_IPV4,
|
CONNECT_STEP_WDS_CLIENT_IPV4,
|
||||||
@@ -1335,6 +1336,27 @@ qmi_port_allocate_client_ready (MMPortQmi *qmi,
|
|||||||
connect_context_step (task);
|
connect_context_step (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
master_interface_up_ready (MMPortNet *link,
|
||||||
|
GAsyncResult *res,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
ConnectContext *ctx;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
ctx = g_task_get_task_data (task);
|
||||||
|
|
||||||
|
if (!mm_port_net_link_setup_finish (link, res, &error)) {
|
||||||
|
g_prefix_error (&error, "Couldn't bring master interface up: ");
|
||||||
|
complete_connect (task, NULL, error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Keep on */
|
||||||
|
ctx->step++;
|
||||||
|
connect_context_step (task);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wait_link_port_ready (MMBaseModem *modem,
|
wait_link_port_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
@@ -1551,6 +1573,21 @@ connect_context_step (GTask *task)
|
|||||||
ctx->step++;
|
ctx->step++;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
|
case CONNECT_STEP_SETUP_LINK_MASTER_UP:
|
||||||
|
/* if the connection is done through a new link, we need to ifup the master interface */
|
||||||
|
if (ctx->link) {
|
||||||
|
mm_obj_dbg (self, "bringing master interface %s up...", mm_port_get_device (ctx->data));
|
||||||
|
mm_port_net_link_setup (MM_PORT_NET (ctx->data),
|
||||||
|
TRUE,
|
||||||
|
0, /* ignore */
|
||||||
|
g_task_get_cancellable (task),
|
||||||
|
(GAsyncReadyCallback) master_interface_up_ready,
|
||||||
|
task);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ctx->step++;
|
||||||
|
/* fall through */
|
||||||
|
|
||||||
case CONNECT_STEP_IP_METHOD:
|
case CONNECT_STEP_IP_METHOD:
|
||||||
/* Once the QMI port is open, we decide the IP method we're going
|
/* Once the QMI port is open, we decide the IP method we're going
|
||||||
* to request. If the LLP is raw-ip, we force Static IP, because not
|
* to request. If the LLP is raw-ip, we force Static IP, because not
|
||||||
|
Reference in New Issue
Block a user