Re: PATCH: Auto-Enable WWAN after PIN entry



Den 20. juli 2012 07:16, skrev richter ecos de:
Hi,

there seems to be a lot of questions about automatically starting GSM connections, but not so much answers..

Here is a patch that solves it at least for me. It does the following:

- Wait for starting of the devices until all connections are read
- Check if there is any gsm connection that should be automatically started
- If yes, ask for the PIN (or use the saved one)
- After successful Pin entry, enable WWAN (which will in turn start the auto connections)
- If there is no auto start gsm connection, don't ask for the PIN and don't enable WWAN. This makes sure WWAN is only enable (and GSM cards powered up), if necessary and it will make sure the user will not be bother with a PIN dialog, unless it's necessary to start a connection (it's very annoying at least for me, if I get this PIN dialog, because I have a build in gsm modem when I am working via LAN or WLAN).

I tried testing this patch with Ubuntu Precise packages, but nm-applet crashes:

Program received signal SIGSEGV, Segmentation fault.
gsm_add_menu_item (device=0x811d380, n_devices=1, active=0x0, menu=0x81b72e8, applet=0x80e6038) at applet-device-gsm.c:463
463                    text = mobile_helper_get_connection_label (NULL,
(gdb) backtrace
#0  gsm_add_menu_item (device=0x811d380, n_devices=1, active=0x0, menu=0x81b72e8, applet=0x80e6038) at applet-device-gsm.c:463
#1  0x0805b821 in nma_menu_add_devices (applet=0x80e6038, menu=0x81b72e8) at applet.c:1643
#2  nma_menu_show_cb (applet=0x80e6038, menu=0x81b72e8) at applet.c:1886
#3  nma_menu_show_cb (menu=0x81b72e8, applet=0x80e6038) at applet.c:1867
#4  0x0805c1b1 in indicator_update_menu (applet=0x80e6038) at applet.c:2218
#5  applet_update_indicator_menu (user_data=0x80e6038) at applet.c:2235
#6  0xb7653850 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#7  0xb7655d86 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#8  0xb7656125 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#9  0xb765656b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#10 0x08057432 in main (argc=1, argv=0xbffff304) at main.c:106

Did you build it on the current git master head? Anyway, I find it strange to fix this bug in the nm-applet GUI, when I see changes related to this in network manager previously:

commit ac27e33f0c948cad916305ff9e32d1ac59cfb27e
Author: Daniel Gnoutcheff <daniel gnoutcheff name>
Date:   Tue Aug 2 15:48:24 2011 -0400

    policy: don't autoconnect disabled modems
   
    Normally, a device disabled via nm_device_interface_set_enabled() will
    shift into the UNAVAILABLE state.  Modems, however, don't do that.
    Rather, they pretend that they are in the DISCONNECTED state, presumably
    to make it easier to re-enable them.  To avoid accidentally re-enabling
    and autoconnecting a disabled modem, we need to explicitly make
    nm_device_interface_get_enabled() == true a prerequisite for
    autoconnecting.

commit 9152c304ff0f88308ae6176b8c2dddfb1988c434
Author: Dan Williams <dcbw redhat com>
Date:   Wed Apr 13 21:58:25 2011 -0500

    wwan: fix enabled state detection (bgo #647216)

[...]

--
Marius
If later on a connection is started manually and the PIN is not known, then the PIN is requested from the user.

BTW. Is there a reason why there exists two sorts of PIN dialogs? I think it would be better to use just one dialog and also to always tie the PIN to SIM ID like it is done in the startup dialog?

Hopefully this patch is helpful for somebody

Regards 

Gerald



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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]