aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-bearer-qmi.c9
-rw-r--r--src/mm-broadband-modem-qmi.c5
-rw-r--r--src/mm-qmi-port.c16
-rw-r--r--src/mm-qmi-port.h11
-rw-r--r--src/mm-sim-qmi.c4
5 files changed, 34 insertions, 11 deletions
diff --git a/src/mm-bearer-qmi.c b/src/mm-bearer-qmi.c
index 8bf5fb89..dc712452 100644
--- a/src/mm-bearer-qmi.c
+++ b/src/mm-bearer-qmi.c
@@ -248,7 +248,9 @@ qmi_port_allocate_client_ready (MMQmiPort *qmi,
return;
}
- ctx->client = QMI_CLIENT_WDS (mm_qmi_port_get_client (qmi, QMI_SERVICE_WDS));
+ ctx->client = QMI_CLIENT_WDS (mm_qmi_port_get_client (qmi,
+ QMI_SERVICE_WDS,
+ MM_QMI_PORT_FLAG_DEFAULT));
/* Keep on */
ctx->step++;
@@ -309,10 +311,13 @@ connect_context_step (ConnectContext *ctx)
case CONNECT_STEP_WDS_CLIENT: {
QmiClient *client;
- client = mm_qmi_port_get_client (ctx->qmi, QMI_SERVICE_WDS);
+ client = mm_qmi_port_get_client (ctx->qmi,
+ QMI_SERVICE_WDS,
+ MM_QMI_PORT_FLAG_DEFAULT);
if (!client) {
mm_qmi_port_allocate_client (ctx->qmi,
QMI_SERVICE_WDS,
+ MM_QMI_PORT_FLAG_DEFAULT,
ctx->cancellable,
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
ctx);
diff --git a/src/mm-broadband-modem-qmi.c b/src/mm-broadband-modem-qmi.c
index cd0bc406..5d16e292 100644
--- a/src/mm-broadband-modem-qmi.c
+++ b/src/mm-broadband-modem-qmi.c
@@ -90,7 +90,9 @@ ensure_qmi_client (MMBroadbandModemQmi *self,
{
QmiClient *client;
- client = mm_qmi_port_peek_client (mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self)), service);
+ client = mm_qmi_port_peek_client (mm_base_modem_peek_port_qmi (MM_BASE_MODEM (self)),
+ service,
+ MM_QMI_PORT_FLAG_DEFAULT);
if (!client) {
g_simple_async_report_error_in_idle (G_OBJECT (self),
callback,
@@ -5097,6 +5099,7 @@ allocate_next_client (InitializationStartedContext *ctx)
/* Otherwise, allocate next client */
mm_qmi_port_allocate_client (ctx->qmi,
ctx->services[ctx->service_index],
+ MM_QMI_PORT_FLAG_DEFAULT,
NULL,
(GAsyncReadyCallback)qmi_port_allocate_client_ready,
ctx);
diff --git a/src/mm-qmi-port.c b/src/mm-qmi-port.c
index 1465b8ea..6318724d 100644
--- a/src/mm-qmi-port.c
+++ b/src/mm-qmi-port.c
@@ -29,6 +29,7 @@ G_DEFINE_TYPE (MMQmiPort, mm_qmi_port, MM_TYPE_PORT)
typedef struct {
QmiService service;
QmiClient *client;
+ MMQmiPortFlag flag;
} ServiceInfo;
struct _MMQmiPortPrivate {
@@ -41,14 +42,16 @@ struct _MMQmiPortPrivate {
QmiClient *
mm_qmi_port_peek_client (MMQmiPort *self,
- QmiService service)
+ QmiService service,
+ MMQmiPortFlag flag)
{
GList *l;
for (l = self->priv->services; l; l = g_list_next (l)) {
ServiceInfo *info = l->data;
- if (info->service == service)
+ if (info->service == service &&
+ info->flag == flag)
return info->client;
}
@@ -57,11 +60,12 @@ mm_qmi_port_peek_client (MMQmiPort *self,
QmiClient *
mm_qmi_port_get_client (MMQmiPort *self,
- QmiService service)
+ QmiService service,
+ MMQmiPortFlag flag)
{
QmiClient *client;
- client = mm_qmi_port_peek_client (self, service);
+ client = mm_qmi_port_peek_client (self, service, flag);
return (client ? g_object_ref (client) : NULL);
}
@@ -120,13 +124,14 @@ allocate_client_ready (QmiDevice *qmi_device,
void
mm_qmi_port_allocate_client (MMQmiPort *self,
QmiService service,
+ MMQmiPortFlag flag,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
AllocateClientContext *ctx;
- if (!!mm_qmi_port_peek_client (self, service)) {
+ if (!!mm_qmi_port_peek_client (self, service, flag)) {
g_simple_async_report_error_in_idle (G_OBJECT (self),
callback,
user_data,
@@ -145,6 +150,7 @@ mm_qmi_port_allocate_client (MMQmiPort *self,
mm_qmi_port_allocate_client);
ctx->info = g_new0 (ServiceInfo, 1);
ctx->info->service = service;
+ ctx->info->flag = flag;
qmi_device_allocate_client (self->priv->qmi_device,
service,
diff --git a/src/mm-qmi-port.h b/src/mm-qmi-port.h
index 6ce16aa6..792ccc48 100644
--- a/src/mm-qmi-port.h
+++ b/src/mm-qmi-port.h
@@ -58,8 +58,13 @@ gboolean mm_qmi_port_open_finish (MMQmiPort *self,
gboolean mm_qmi_port_is_open (MMQmiPort *self);
void mm_qmi_port_close (MMQmiPort *self);
+typedef enum {
+ MM_QMI_PORT_FLAG_DEFAULT = 0
+} MMQmiPortFlag;
+
void mm_qmi_port_allocate_client (MMQmiPort *self,
QmiService service,
+ MMQmiPortFlag flag,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
@@ -68,8 +73,10 @@ gboolean mm_qmi_port_allocate_client_finish (MMQmiPort *self,
GError **error);
QmiClient *mm_qmi_port_peek_client (MMQmiPort *self,
- QmiService service);
+ QmiService service,
+ MMQmiPortFlag flag);
QmiClient *mm_qmi_port_get_client (MMQmiPort *self,
- QmiService service);
+ QmiService service,
+ MMQmiPortFlag flag);
#endif /* MM_QMI_PORT_H */
diff --git a/src/mm-sim-qmi.c b/src/mm-sim-qmi.c
index b524a90b..c2f28c63 100644
--- a/src/mm-sim-qmi.c
+++ b/src/mm-sim-qmi.c
@@ -45,7 +45,9 @@ ensure_qmi_client (MMSimQmi *self,
NULL);
g_assert (MM_IS_BASE_MODEM (modem));
- client = mm_qmi_port_peek_client (mm_base_modem_peek_port_qmi (modem), service);
+ client = mm_qmi_port_peek_client (mm_base_modem_peek_port_qmi (modem),
+ service,
+ MM_QMI_PORT_FLAG_DEFAULT);
if (!client)
g_simple_async_report_error_in_idle (G_OBJECT (self),
callback,