mm-bearer-qmi: allocate separate WDS client for each endpoint
Multiplexing currently does not work correctly for BAM-DMUX because ModemManager reuses the same WDS client for all data points. A second bearer can be created but it effectively disables the first one. Fix this similar to the existing checks for the mux-id by including the endpoint type and number in the QMI client flags.
This commit is contained in:
@@ -531,6 +531,14 @@ typedef struct {
|
|||||||
GError *error_ipv6;
|
GError *error_ipv6;
|
||||||
} ConnectContext;
|
} ConnectContext;
|
||||||
|
|
||||||
|
/* When using the WDS service, we may not only want to have explicit different
|
||||||
|
* clients for IPv4 or IPv6, but also for different mux ids/endpoints as well,
|
||||||
|
* so that different bearer objects never attempt to use the same WDS clients. */
|
||||||
|
#define MM_BEARER_QMI_PORT_FLAG(flag, ctx) \
|
||||||
|
(((ctx->endpoint.interface_number & 0xFF) << 24) | \
|
||||||
|
((ctx->endpoint.type & 0xFF) << 16) | \
|
||||||
|
((ctx->mux_id & 0xFF) << 8) | (flag & 0xFF))
|
||||||
|
|
||||||
static void
|
static void
|
||||||
connect_context_free (ConnectContext *ctx)
|
connect_context_free (ConnectContext *ctx)
|
||||||
{
|
{
|
||||||
@@ -1434,12 +1442,12 @@ qmi_port_allocate_client_ready (MMPortQmi *qmi,
|
|||||||
ctx->client_ipv4 = QMI_CLIENT_WDS (mm_port_qmi_get_client (
|
ctx->client_ipv4 = QMI_CLIENT_WDS (mm_port_qmi_get_client (
|
||||||
qmi,
|
qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV4, ctx->mux_id)));
|
MM_BEARER_QMI_PORT_FLAG (MM_PORT_QMI_FLAG_WDS_IPV4, ctx)));
|
||||||
else
|
else
|
||||||
ctx->client_ipv6 = QMI_CLIENT_WDS (mm_port_qmi_get_client (
|
ctx->client_ipv6 = QMI_CLIENT_WDS (mm_port_qmi_get_client (
|
||||||
qmi,
|
qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV6, ctx->mux_id)));
|
MM_BEARER_QMI_PORT_FLAG (MM_PORT_QMI_FLAG_WDS_IPV6, ctx)));
|
||||||
|
|
||||||
/* Keep on */
|
/* Keep on */
|
||||||
ctx->step++;
|
ctx->step++;
|
||||||
@@ -1803,12 +1811,12 @@ connect_context_step (GTask *task)
|
|||||||
|
|
||||||
client = mm_port_qmi_get_client (ctx->qmi,
|
client = mm_port_qmi_get_client (ctx->qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV4, ctx->mux_id));
|
MM_BEARER_QMI_PORT_FLAG (MM_PORT_QMI_FLAG_WDS_IPV4, ctx));
|
||||||
if (!client) {
|
if (!client) {
|
||||||
mm_obj_dbg (self, "allocating IPv4-specific WDS client (mux id %u)", ctx->mux_id);
|
mm_obj_dbg (self, "allocating IPv4-specific WDS client (mux id %u)", ctx->mux_id);
|
||||||
mm_port_qmi_allocate_client (ctx->qmi,
|
mm_port_qmi_allocate_client (ctx->qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV4, ctx->mux_id),
|
MM_BEARER_QMI_PORT_FLAG (MM_PORT_QMI_FLAG_WDS_IPV4, ctx),
|
||||||
g_task_get_cancellable (task),
|
g_task_get_cancellable (task),
|
||||||
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
||||||
task);
|
task);
|
||||||
@@ -1939,12 +1947,12 @@ connect_context_step (GTask *task)
|
|||||||
|
|
||||||
client = mm_port_qmi_get_client (ctx->qmi,
|
client = mm_port_qmi_get_client (ctx->qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV6, ctx->mux_id));
|
MM_BEARER_QMI_PORT_FLAG (MM_PORT_QMI_FLAG_WDS_IPV6, ctx));
|
||||||
if (!client) {
|
if (!client) {
|
||||||
mm_obj_dbg (self, "allocating IPv6-specific WDS client (mux id %u)", ctx->mux_id);
|
mm_obj_dbg (self, "allocating IPv6-specific WDS client (mux id %u)", ctx->mux_id);
|
||||||
mm_port_qmi_allocate_client (ctx->qmi,
|
mm_port_qmi_allocate_client (ctx->qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV6, ctx->mux_id),
|
MM_BEARER_QMI_PORT_FLAG (MM_PORT_QMI_FLAG_WDS_IPV6, ctx),
|
||||||
g_task_get_cancellable (task),
|
g_task_get_cancellable (task),
|
||||||
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
||||||
task);
|
task);
|
||||||
|
@@ -100,11 +100,6 @@ typedef enum {
|
|||||||
MM_PORT_QMI_FLAG_WDS_IPV6 = 2,
|
MM_PORT_QMI_FLAG_WDS_IPV6 = 2,
|
||||||
} MMPortQmiFlag;
|
} MMPortQmiFlag;
|
||||||
|
|
||||||
/* When using the WDS service, we may not only want to have explicit different
|
|
||||||
* clients for IPv4 or IPv6, but also for different mux ids as well, so that
|
|
||||||
* different bearer objects never attempt to use the same WDS clients. */
|
|
||||||
#define MM_PORT_QMI_FLAG_WITH_MUX_ID(flag, mux_id) ((mux_id << 8) | (flag & 0xFF))
|
|
||||||
|
|
||||||
void mm_port_qmi_allocate_client (MMPortQmi *self,
|
void mm_port_qmi_allocate_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
guint flag,
|
guint flag,
|
||||||
|
Reference in New Issue
Block a user