broadband-modem-qmi: set network port to 802.3/no-QoS mode
The kernel drivers expect this mode, so make sure we set it.
This commit is contained in:

committed by
Aleksander Morgado

parent
5f1a1cf834
commit
8213a09a34
@@ -368,6 +368,7 @@ connect_context_step (ConnectContext *ctx)
|
|||||||
case CONNECT_STEP_OPEN_QMI_PORT:
|
case CONNECT_STEP_OPEN_QMI_PORT:
|
||||||
if (!mm_qmi_port_is_open (ctx->qmi)) {
|
if (!mm_qmi_port_is_open (ctx->qmi)) {
|
||||||
mm_qmi_port_open (ctx->qmi,
|
mm_qmi_port_open (ctx->qmi,
|
||||||
|
TRUE,
|
||||||
ctx->cancellable,
|
ctx->cancellable,
|
||||||
(GAsyncReadyCallback)qmi_port_open_ready,
|
(GAsyncReadyCallback)qmi_port_open_ready,
|
||||||
ctx);
|
ctx);
|
||||||
|
@@ -5731,6 +5731,7 @@ initialization_started (MMBroadbandModem *self,
|
|||||||
|
|
||||||
/* Now open our QMI port */
|
/* Now open our QMI port */
|
||||||
mm_qmi_port_open (ctx->qmi,
|
mm_qmi_port_open (ctx->qmi,
|
||||||
|
TRUE,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback)qmi_port_open_ready,
|
(GAsyncReadyCallback)qmi_port_open_ready,
|
||||||
ctx);
|
ctx);
|
||||||
|
@@ -398,6 +398,7 @@ wdm_probe_qmi (MMPortProbe *self)
|
|||||||
/* Create a port and try to open it */
|
/* Create a port and try to open it */
|
||||||
task->qmi_port = mm_qmi_port_new (g_udev_device_get_name (self->priv->port));
|
task->qmi_port = mm_qmi_port_new (g_udev_device_get_name (self->priv->port));
|
||||||
mm_qmi_port_open (task->qmi_port,
|
mm_qmi_port_open (task->qmi_port,
|
||||||
|
FALSE,
|
||||||
NULL,
|
NULL,
|
||||||
(GAsyncReadyCallback)qmi_port_open_ready,
|
(GAsyncReadyCallback)qmi_port_open_ready,
|
||||||
self);
|
self);
|
||||||
|
@@ -165,6 +165,7 @@ mm_qmi_port_allocate_client (MMQmiPort *self,
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MMQmiPort *self;
|
MMQmiPort *self;
|
||||||
|
gboolean set_data_format;
|
||||||
GSimpleAsyncResult *result;
|
GSimpleAsyncResult *result;
|
||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
} PortOpenContext;
|
} PortOpenContext;
|
||||||
@@ -213,6 +214,7 @@ qmi_device_new_ready (GObject *unused,
|
|||||||
PortOpenContext *ctx)
|
PortOpenContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
QmiDeviceOpenFlags flags = QMI_DEVICE_OPEN_FLAGS_VERSION_INFO;
|
||||||
|
|
||||||
ctx->self->priv->qmi_device = qmi_device_new_finish (res, &error);
|
ctx->self->priv->qmi_device = qmi_device_new_finish (res, &error);
|
||||||
if (!ctx->self->priv->qmi_device) {
|
if (!ctx->self->priv->qmi_device) {
|
||||||
@@ -221,9 +223,12 @@ qmi_device_new_ready (GObject *unused,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx->set_data_format)
|
||||||
|
flags |= (QMI_DEVICE_OPEN_FLAGS_NET_802_3 | QMI_DEVICE_OPEN_FLAGS_NET_NO_QOS_HEADER);
|
||||||
|
|
||||||
/* Now open the QMI device */
|
/* Now open the QMI device */
|
||||||
qmi_device_open (ctx->self->priv->qmi_device,
|
qmi_device_open (ctx->self->priv->qmi_device,
|
||||||
QMI_DEVICE_OPEN_FLAGS_VERSION_INFO,
|
flags,
|
||||||
10,
|
10,
|
||||||
ctx->cancellable,
|
ctx->cancellable,
|
||||||
(GAsyncReadyCallback)qmi_device_open_ready,
|
(GAsyncReadyCallback)qmi_device_open_ready,
|
||||||
@@ -232,6 +237,7 @@ qmi_device_new_ready (GObject *unused,
|
|||||||
|
|
||||||
void
|
void
|
||||||
mm_qmi_port_open (MMQmiPort *self,
|
mm_qmi_port_open (MMQmiPort *self,
|
||||||
|
gboolean set_data_format,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@@ -244,6 +250,7 @@ mm_qmi_port_open (MMQmiPort *self,
|
|||||||
|
|
||||||
ctx = g_new0 (PortOpenContext, 1);
|
ctx = g_new0 (PortOpenContext, 1);
|
||||||
ctx->self = g_object_ref (self);
|
ctx->self = g_object_ref (self);
|
||||||
|
ctx->set_data_format = set_data_format;
|
||||||
ctx->result = g_simple_async_result_new (G_OBJECT (self),
|
ctx->result = g_simple_async_result_new (G_OBJECT (self),
|
||||||
callback,
|
callback,
|
||||||
user_data,
|
user_data,
|
||||||
|
@@ -49,6 +49,7 @@ GType mm_qmi_port_get_type (void);
|
|||||||
MMQmiPort *mm_qmi_port_new (const gchar *name);
|
MMQmiPort *mm_qmi_port_new (const gchar *name);
|
||||||
|
|
||||||
void mm_qmi_port_open (MMQmiPort *self,
|
void mm_qmi_port_open (MMQmiPort *self,
|
||||||
|
gboolean set_data_format,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
Reference in New Issue
Block a user