Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: qmi on huawei
Date: Mon, 26 Nov 2012 16:30:44 +0100	[thread overview]
Message-ID: <1353943844.1837.2.camel@aeonflux> (raw)
In-Reply-To: <CABvLYuAOC9uTod+r_bQZaDUrMibA64y2ApCZ_AWbLa6Lk+YWXg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]

Hi Cedric,

> I have a Huawei E398 dongle with a qmi interface, and i'm trying to make
> ofono use the qmi interface for the gprs-context atom. I have this working,
> but depending on how i unref the qmi_device in huawei_disable, ofono
> crashes or there's have a memory leak.
> 
> The first approach i've tried is the same as in the gobi plugin.
> I call qmi_device_shutdown() from huawei_disable(), and unref the
> qmi_device from the callback.
> The problem with this is: when i unplug the device ofono crashes.
> When the device is unplugged, first  huawei_disable() is called, then
> huawei_remove(), and
> afterwards shutdown_cb() is called. At that time the ofono_modem struct is
> already freed, shutdown_cb() tries to access it and crashes.
> 
> The second approach i've tried is to unref the qmi_device directly from
> huawei_disable.
> With this approach, i see a memory leak of the qmi_service.
> qmi_gprs_context_remove() is being called from flush_atoms(). And i can see
> release_client() is being called. But the service_release_callback(), which
> should free the service, is never being called.
> I think the request get's canceled because qmi_device_unref() is being
> called from huawei_disable(). The request is destroyed and the callback
> which should free the qmi_service is never called.
> 
> Does anyone have thoughts/ideas on how i can fix this?

actually what I am doing with the E398 is just to switch the driver to
"gobi" instead of "huawei". For testing you can just hardcode it.

diff --git a/plugins/udevng.c b/plugins/udevng.c
index afb02ca..53b12b3 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -338,6 +338,9 @@ static gboolean setup_huawei(struct modem_info *modem)
                }
        }
 
+       qmi = "/dev/cdc-wdm0";
+       net = "wwan0";
+
        if (qmi != NULL && net != NULL) {
                ofono_modem_set_driver(modem->modem, "gobi");
                goto done;

The ofono.git HEAD already sets the driver, but the qmi and net
detection is not always correct. So just overwrite the values for the
device nodes and see if that works for you.

Regards

Marcel



  reply	other threads:[~2012-11-26 15:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-26 15:32 qmi on huawei Cedric Jehasse
2012-11-26 15:30 ` Marcel Holtmann [this message]
2012-11-26 16:42   ` Cedric Jehasse
2012-11-26 16:42     ` Marcel Holtmann
2012-11-27  9:04       ` Cedric Jehasse
  -- strict thread matches above, loose matches on Subject: below --
2012-11-26 15:32 Cedric Jehasse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1353943844.1837.2.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox