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:
Dan Williams
2012-09-05 16:11:51 -05:00
committed by Aleksander Morgado
parent 5f1a1cf834
commit 8213a09a34
5 changed files with 12 additions and 1 deletions

View File

@@ -368,6 +368,7 @@ connect_context_step (ConnectContext *ctx)
case CONNECT_STEP_OPEN_QMI_PORT:
if (!mm_qmi_port_is_open (ctx->qmi)) {
mm_qmi_port_open (ctx->qmi,
TRUE,
ctx->cancellable,
(GAsyncReadyCallback)qmi_port_open_ready,
ctx);

View File

@@ -5731,6 +5731,7 @@ initialization_started (MMBroadbandModem *self,
/* Now open our QMI port */
mm_qmi_port_open (ctx->qmi,
TRUE,
NULL,
(GAsyncReadyCallback)qmi_port_open_ready,
ctx);

View File

@@ -398,6 +398,7 @@ wdm_probe_qmi (MMPortProbe *self)
/* Create a port and try to open it */
task->qmi_port = mm_qmi_port_new (g_udev_device_get_name (self->priv->port));
mm_qmi_port_open (task->qmi_port,
FALSE,
NULL,
(GAsyncReadyCallback)qmi_port_open_ready,
self);

View File

@@ -165,6 +165,7 @@ mm_qmi_port_allocate_client (MMQmiPort *self,
typedef struct {
MMQmiPort *self;
gboolean set_data_format;
GSimpleAsyncResult *result;
GCancellable *cancellable;
} PortOpenContext;
@@ -213,6 +214,7 @@ qmi_device_new_ready (GObject *unused,
PortOpenContext *ctx)
{
GError *error = NULL;
QmiDeviceOpenFlags flags = QMI_DEVICE_OPEN_FLAGS_VERSION_INFO;
ctx->self->priv->qmi_device = qmi_device_new_finish (res, &error);
if (!ctx->self->priv->qmi_device) {
@@ -221,9 +223,12 @@ qmi_device_new_ready (GObject *unused,
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 */
qmi_device_open (ctx->self->priv->qmi_device,
QMI_DEVICE_OPEN_FLAGS_VERSION_INFO,
flags,
10,
ctx->cancellable,
(GAsyncReadyCallback)qmi_device_open_ready,
@@ -232,6 +237,7 @@ qmi_device_new_ready (GObject *unused,
void
mm_qmi_port_open (MMQmiPort *self,
gboolean set_data_format,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -244,6 +250,7 @@ mm_qmi_port_open (MMQmiPort *self,
ctx = g_new0 (PortOpenContext, 1);
ctx->self = g_object_ref (self);
ctx->set_data_format = set_data_format;
ctx->result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,

View File

@@ -49,6 +49,7 @@ GType mm_qmi_port_get_type (void);
MMQmiPort *mm_qmi_port_new (const gchar *name);
void mm_qmi_port_open (MMQmiPort *self,
gboolean set_data_format,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);