Re: Initial integration of the new MM iface in NM

2012-10-30 Thread Dan Williams
On Wed, 2012-10-24 at 19:26 +0200, Aleksander Morgado wrote:
> This series of patches add the basic integration needed in NetworkManager in
> order to handle the new 'ModemManager1' interface.
> 
> The first 9 patches basically prepare the codebase to easier integrate the new
> interface. Some additional cleanup is done in several places.

1 - 9 applied and tested with a bunch of my hardware.  I fixed up one
error before pushing; the g_return_val_if_fail() in nm-device-bt.c when
a modem got added mistakenly checked that *both* the control and data
ports were set, when that's not the case with the old MM.  I'll try to
review the new API bits soon.

Cheers,
Dan

> [PATCH 01/15] modem-manager: split the `NMModem' object
> [PATCH 02/15] modem-manager: remove the `device' property from
> [PATCH 03/15] modem-manager: switch the `state' property from
> [PATCH 04/15] modem-manager: let the `NMDeviceModem' handle
> [PATCH 05/15] modem-manager: rework interface related properties in
> [PATCH 06/15] modem-manager,gsm: keep the "Connect" DBus call
> [PATCH 07/15] modem-manager,gsm,cdma: remove 'signal_quality'
> [PATCH 08/15] modem-manager: fix several code alignment issues
> [PATCH 09/15] manager: trivial fix in object type in signal callback
> 
> The remaining 6 patches introduce the new ModemManager support, implemented by
> using the new `libmm-glib' library provided by ModemManager itself.
> 
> [PATCH 10/15] build: new `--with-modem-manager-1' to check for new
> [PATCH 11/15] modem-manager: new `NMModemBroadband'
> [PATCH 12/15] manager: create a new GDBus-based `MMManager' if
> [PATCH 13/15] device-bt,device-modem: listen for data port changes
> [PATCH 14/15] modem-manager: don't report the data interface along
> [PATCH 15/15] device-bt: watch both old and new ModemManager
> 
> But beware!
> 
> The UI applications making use of ModemManager directly are not yet updated. 
> For the specific case of the gnome-control-center, it will let you 
> enable/disable modems directly from the "Mobile Broadband" switch only if the 
> modem is already unlocked or if it doesn't need a PIN. If you add the PIN 
> number in the NM settings, it will let you activate the connection directly, 
> though.
> 
> If your modem is locked, you can always run:
>$> sudo mmcli -i 0 --pin=1234
> (assuming 0 is the index of the SIM card in the Modem object.
> 
> `mmcli' now has a manpage, so you can also see further examples there.
> 
> Comments very welcome!
> 
> Cheers.
> ___
> networkmanager-list mailing list
> networkmanager-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/networkmanager-list


___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down

2012-10-30 Thread Dan Williams
On Tue, 2012-10-30 at 18:53 +0100, Marius Kotsbak wrote:
> Den 30. okt. 2012 18:54, skrev Dan Williams:
> > On Tue, 2012-10-30 at 18:07 +0100, Marius Kotsbak wrote:
> >> Den 09. sep. 2012 21:56, skrev Marius Kotsbak:
> >>> Den 09. sep. 2012 17:39, skrev Marius Kotsbak:
>  See patch attached.
> 
>  sierra: use +CFUN=4 for powering down
> 
>    plugins/mm-modem-sierra-gsm.c |   32 
>    1 file changed, 32 insertions(+)
> >> See attached patch to avoid that this change causes reset when changing
> >> to cfun=1 (as we avoid running +cfun=1 if it is already in mode 1 and
> >> with this change it will be in mode 4).
> > Pushed, thanks!  Bonus points for a patch for MM_06?  You'll have to
> > override MM_GENERIC_GSM_PROP_POWER_UP_CMD like plugins/mm-modem-nokia.c
> > does by implementing get_property/set_property in the sierra plugin but
> > that's about it.
> 
> Of course, already done, attached! :)

So I'd love to do this, and I actually pushed it along with a fix to
Sierra.  But then when testing it out with my 8775 and 8781, they both
crash when going from CFUN=4 -> CFUN=1.  I've always had
reliability/crashing issues with the 8775, and I've even bought 4
separate devices to figure out if the hardware was the problem.  I even
tried them in 3 different carriers, including one with external power,
to ensure that they were getting enough current when powering on the
radios.  No luck.  The USB sticks and CardBus devices I have seem to do
just fine though.  Thoughts?  If anyone has an internal Sierra card,
maybe they could test and see if they have the same problems I do.

Dan

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down

2012-10-30 Thread Marius Kotsbak

Den 30. okt. 2012 18:54, skrev Dan Williams:

On Tue, 2012-10-30 at 18:07 +0100, Marius Kotsbak wrote:

Den 09. sep. 2012 21:56, skrev Marius Kotsbak:

Den 09. sep. 2012 17:39, skrev Marius Kotsbak:

See patch attached.

sierra: use +CFUN=4 for powering down

  plugins/mm-modem-sierra-gsm.c |   32 
  1 file changed, 32 insertions(+)

See attached patch to avoid that this change causes reset when changing
to cfun=1 (as we avoid running +cfun=1 if it is already in mode 1 and
with this change it will be in mode 4).

Pushed, thanks!  Bonus points for a patch for MM_06?  You'll have to
override MM_GENERIC_GSM_PROP_POWER_UP_CMD like plugins/mm-modem-nokia.c
does by implementing get_property/set_property in the sierra plugin but
that's about it.


Of course, already done, attached! :)

--
Marius




Dan



>From 2ec4e4efcde67403f6bbaa1fc218f5416a12dc77 Mon Sep 17 00:00:00 2001
From: "Marius B. Kotsbak" 
Date: Tue, 30 Oct 2012 18:31:52 +0100
Subject: [PATCH 2/2] sierra: avoid reset when setting cfun=1

Some Sierra modems trigger a reset of the modem when sending +cfun=1,
which is more likely when +cfun=4 is used for powering down since +cfun=1 is
skipped if mode is already 1. All sierra modems supports a second parameter
to indicate that no reset is to be done: "+cfun=1,0".
---
 plugins/mm-modem-sierra-gsm.c |8 
 1 file changed, 8 insertions(+)

diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c
index b4f5b15..3737bf5 100644
--- a/plugins/mm-modem-sierra-gsm.c
+++ b/plugins/mm-modem-sierra-gsm.c
@@ -1090,6 +1090,10 @@ get_property (GObject *object,
 /* Use AT+CFUN=4 for power down (low power mode) */
 g_value_set_string (value, "+CFUN=4");
 break;
+case MM_GENERIC_GSM_PROP_POWER_UP_CMD:
+/* Use AT+CFUN=1,0 for power up, to avoid reset that +cfun=1 can trigger in some modems */
+g_value_set_string (value, "+CFUN=1,0");
+break;
 default:
 break;
 }
@@ -1112,6 +1116,10 @@ mm_modem_sierra_gsm_class_init (MMModemSierraGsmClass *klass)
   MM_GENERIC_GSM_PROP_POWER_DOWN_CMD,
   MM_GENERIC_GSM_POWER_DOWN_CMD);
 
+g_object_class_override_property (object_class,
+  MM_GENERIC_GSM_PROP_POWER_UP_CMD,
+  MM_GENERIC_GSM_POWER_UP_CMD);
+
 gsm_class->port_grabbed = port_grabbed;
 gsm_class->do_enable_power_up_check_needed = do_enable_power_up_check_needed;
 gsm_class->do_enable_power_up_done = real_do_enable_power_up_done;
-- 
1.7.10.4

>From d4b07afb7ef8a576ae7b54255d201a90fd52c438 Mon Sep 17 00:00:00 2001
From: "Marius B. Kotsbak" 
Date: Sun, 9 Sep 2012 16:17:46 +0200
Subject: [PATCH 1/2] sierra: use +CFUN=4 for powering down

---
 plugins/mm-modem-sierra-gsm.c |   32 
 1 file changed, 32 insertions(+)

diff --git a/plugins/mm-modem-sierra-gsm.c b/plugins/mm-modem-sierra-gsm.c
index 7a241b3..b4f5b15 100644
--- a/plugins/mm-modem-sierra-gsm.c
+++ b/plugins/mm-modem-sierra-gsm.c
@@ -1071,6 +1071,31 @@ dispose (GObject *object)
 }
 
 static void
+set_property (GObject *object,
+  guint prop_id,
+  const GValue *value,
+  GParamSpec *pspec)
+{
+/* Do nothing... see set_property() in parent, which also does nothing */
+}
+
+static void
+get_property (GObject *object,
+  guint prop_id,
+  GValue *value,
+  GParamSpec *pspec)
+{
+switch (prop_id) {
+case MM_GENERIC_GSM_PROP_POWER_DOWN_CMD:
+/* Use AT+CFUN=4 for power down (low power mode) */
+g_value_set_string (value, "+CFUN=4");
+break;
+default:
+break;
+}
+}
+
+static void
 mm_modem_sierra_gsm_class_init (MMModemSierraGsmClass *klass)
 {
 GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -1080,6 +1105,13 @@ mm_modem_sierra_gsm_class_init (MMModemSierraGsmClass *klass)
 g_type_class_add_private (object_class, sizeof (MMModemSierraGsmPrivate));
 
 object_class->dispose = dispose;
+object_class->get_property = get_property;
+object_class->set_property = set_property;
+
+g_object_class_override_property (object_class,
+  MM_GENERIC_GSM_PROP_POWER_DOWN_CMD,
+  MM_GENERIC_GSM_POWER_DOWN_CMD);
+
 gsm_class->port_grabbed = port_grabbed;
 gsm_class->do_enable_power_up_check_needed = do_enable_power_up_check_needed;
 gsm_class->do_enable_power_up_done = real_do_enable_power_up_done;
-- 
1.7.10.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down

2012-10-30 Thread Dan Williams
On Tue, 2012-10-30 at 18:07 +0100, Marius Kotsbak wrote:
> Den 09. sep. 2012 21:56, skrev Marius Kotsbak:
> > Den 09. sep. 2012 17:39, skrev Marius Kotsbak:
> >> See patch attached.
> >>
> >> sierra: use +CFUN=4 for powering down
> >>
> >>  plugins/mm-modem-sierra-gsm.c |   32 
> >>  1 file changed, 32 insertions(+)
> >
> 
> See attached patch to avoid that this change causes reset when changing 
> to cfun=1 (as we avoid running +cfun=1 if it is already in mode 1 and 
> with this change it will be in mode 4).

Pushed, thanks!  Bonus points for a patch for MM_06?  You'll have to
override MM_GENERIC_GSM_PROP_POWER_UP_CMD like plugins/mm-modem-nokia.c
does by implementing get_property/set_property in the sierra plugin but
that's about it.

Dan

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [MM master] Re: [MM06] [PATCH] sierra: use +CFUN=4 for powering down

2012-10-30 Thread Marius Kotsbak

Den 09. sep. 2012 21:56, skrev Marius Kotsbak:

Den 09. sep. 2012 17:39, skrev Marius Kotsbak:

See patch attached.

sierra: use +CFUN=4 for powering down

 plugins/mm-modem-sierra-gsm.c |   32 
 1 file changed, 32 insertions(+)




See attached patch to avoid that this change causes reset when changing 
to cfun=1 (as we avoid running +cfun=1 if it is already in mode 1 and 
with this change it will be in mode 4).


--
Marius

>From ed89bf5874d248d9841da0457eb7075e1417895b Mon Sep 17 00:00:00 2001
From: "Marius B. Kotsbak" 
Date: Tue, 30 Oct 2012 18:01:23 +0100
Subject: [PATCH] sierra: avoid reset when setting cfun=1

Some Sierra modems trigger a reset of the modem when sending +cfun=1.
All sierra modems supports a second parameter to indicate that no
reset is to be done: "+cfun=1,0".
---
 plugins/sierra/mm-common-sierra.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/sierra/mm-common-sierra.c b/plugins/sierra/mm-common-sierra.c
index 1af64af..e76c366 100644
--- a/plugins/sierra/mm-common-sierra.c
+++ b/plugins/sierra/mm-common-sierra.c
@@ -115,7 +115,7 @@ get_current_functionality_status_ready (MMBaseModem *self,
  * Works well if we previously switched off the power with CFUN=4
  */
 mm_base_modem_at_command (MM_BASE_MODEM (self),
-  "+CFUN=1",
+  "+CFUN=1,0", /* ",0" ensures no reset */
   3,
   FALSE,
   (GAsyncReadyCallback)full_functionality_status_ready,
-- 
1.7.10.4

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: review request: pavlix/build

2012-10-30 Thread Colin Walters
On Mon, 2012-10-29 at 18:54 -0400, Pavel Simerda wrote:

> > In that case, also worth stating explicitly.
> 
> What would you like to see there if we're just tidying up?

Exactly that - add "Just tidying up." in the commit message then.

___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list