port-qmi: WDS clients also mux-id specific
In addition to differentiating between IPv4 and IPv6 clients, we also need to explicitly allocate different clients in different bearer objects when in multiplexing.
This commit is contained in:
@@ -1323,13 +1323,15 @@ qmi_port_allocate_client_ready (MMPortQmi *qmi,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->running_ipv4)
|
if (ctx->running_ipv4)
|
||||||
ctx->client_ipv4 = QMI_CLIENT_WDS (mm_port_qmi_get_client (qmi,
|
ctx->client_ipv4 = QMI_CLIENT_WDS (mm_port_qmi_get_client (
|
||||||
|
qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WDS_IPV4));
|
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV4, ctx->mux_id)));
|
||||||
else
|
else
|
||||||
ctx->client_ipv6 = QMI_CLIENT_WDS (mm_port_qmi_get_client (qmi,
|
ctx->client_ipv6 = QMI_CLIENT_WDS (mm_port_qmi_get_client (
|
||||||
|
qmi,
|
||||||
QMI_SERVICE_WDS,
|
QMI_SERVICE_WDS,
|
||||||
MM_PORT_QMI_FLAG_WDS_IPV6));
|
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV6, ctx->mux_id)));
|
||||||
|
|
||||||
/* Keep on */
|
/* Keep on */
|
||||||
ctx->step++;
|
ctx->step++;
|
||||||
@@ -1621,12 +1623,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_WDS_IPV4);
|
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV4, ctx->mux_id));
|
||||||
if (!client) {
|
if (!client) {
|
||||||
mm_obj_dbg (self, "allocating IPv4-specific WDS client");
|
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_WDS_IPV4,
|
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV4, ctx->mux_id),
|
||||||
g_task_get_cancellable (task),
|
g_task_get_cancellable (task),
|
||||||
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
||||||
task);
|
task);
|
||||||
@@ -1757,12 +1759,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_WDS_IPV6);
|
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV6, ctx->mux_id));
|
||||||
if (!client) {
|
if (!client) {
|
||||||
mm_obj_dbg (self, "allocating IPv6-specific WDS client");
|
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_WDS_IPV6,
|
MM_PORT_QMI_FLAG_WITH_MUX_ID (MM_PORT_QMI_FLAG_WDS_IPV6, ctx->mux_id),
|
||||||
g_task_get_cancellable (task),
|
g_task_get_cancellable (task),
|
||||||
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
|
||||||
task);
|
task);
|
||||||
|
@@ -46,7 +46,7 @@ static GParamSpec *properties[PROP_LAST];
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
QmiService service;
|
QmiService service;
|
||||||
QmiClient *client;
|
QmiClient *client;
|
||||||
MMPortQmiFlag flag;
|
guint flag;
|
||||||
} ServiceInfo;
|
} ServiceInfo;
|
||||||
|
|
||||||
struct _MMPortQmiPrivate {
|
struct _MMPortQmiPrivate {
|
||||||
@@ -80,7 +80,7 @@ struct _MMPortQmiPrivate {
|
|||||||
static QmiClient *
|
static QmiClient *
|
||||||
lookup_client (MMPortQmi *self,
|
lookup_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
MMPortQmiFlag flag,
|
guint flag,
|
||||||
gboolean steal)
|
gboolean steal)
|
||||||
{
|
{
|
||||||
GList *l;
|
GList *l;
|
||||||
@@ -106,7 +106,7 @@ lookup_client (MMPortQmi *self,
|
|||||||
QmiClient *
|
QmiClient *
|
||||||
mm_port_qmi_peek_client (MMPortQmi *self,
|
mm_port_qmi_peek_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
MMPortQmiFlag flag)
|
guint flag)
|
||||||
{
|
{
|
||||||
return lookup_client (self, service, flag, FALSE);
|
return lookup_client (self, service, flag, FALSE);
|
||||||
}
|
}
|
||||||
@@ -114,7 +114,7 @@ mm_port_qmi_peek_client (MMPortQmi *self,
|
|||||||
QmiClient *
|
QmiClient *
|
||||||
mm_port_qmi_get_client (MMPortQmi *self,
|
mm_port_qmi_get_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
MMPortQmiFlag flag)
|
guint flag)
|
||||||
{
|
{
|
||||||
QmiClient *client;
|
QmiClient *client;
|
||||||
|
|
||||||
@@ -259,7 +259,7 @@ allocate_client_ready (QmiDevice *qmi_device,
|
|||||||
void
|
void
|
||||||
mm_port_qmi_allocate_client (MMPortQmi *self,
|
mm_port_qmi_allocate_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
MMPortQmiFlag flag,
|
guint flag,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
|
@@ -91,13 +91,18 @@ void mm_port_qmi_set_net_driver (MMPortQmi *self,
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MM_PORT_QMI_FLAG_DEFAULT = 0,
|
MM_PORT_QMI_FLAG_DEFAULT = 0,
|
||||||
MM_PORT_QMI_FLAG_WDS_IPV4 = 100,
|
MM_PORT_QMI_FLAG_WDS_IPV4 = 1,
|
||||||
MM_PORT_QMI_FLAG_WDS_IPV6 = 101
|
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,
|
||||||
MMPortQmiFlag flag,
|
guint flag,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -107,14 +112,14 @@ gboolean mm_port_qmi_allocate_client_finish (MMPortQmi *self,
|
|||||||
|
|
||||||
void mm_port_qmi_release_client (MMPortQmi *self,
|
void mm_port_qmi_release_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
MMPortQmiFlag flag);
|
guint flag);
|
||||||
|
|
||||||
QmiClient *mm_port_qmi_peek_client (MMPortQmi *self,
|
QmiClient *mm_port_qmi_peek_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
MMPortQmiFlag flag);
|
guint flag);
|
||||||
QmiClient *mm_port_qmi_get_client (MMPortQmi *self,
|
QmiClient *mm_port_qmi_get_client (MMPortQmi *self,
|
||||||
QmiService service,
|
QmiService service,
|
||||||
MMPortQmiFlag flag);
|
guint flag);
|
||||||
|
|
||||||
QmiDevice *mm_port_qmi_peek_device (MMPortQmi *self);
|
QmiDevice *mm_port_qmi_peek_device (MMPortQmi *self);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user