Re: What about the patch for USB gadgets?
Hi Dan, On 12/05/11 04:55, Dan Williams wrote: A quick question on these, are they properly represented in sysfs or are they virtual devices? Given that they are USB connected it would seem they should be properly presented, even in the case of platform drivers since there has to be a USB tree in sysfs to root things in... One thing you can do is grab the attached lsudev.c tool and run that like lsudev net when the device is present, and that'll give me more information about the sysfs layout that I can use to answer my question. output of lsudev net attached. /devices/platform/at91_ohci/usb1/1-1/1-1:1.0/net/eth1 is a usb ethernet adapter. The device we want to use is usb0. ifconfig and manual device configuration works: # ifconfig usb0 usb0 Link encap:Ethernet HWaddr 46:0d:9e:67:69:ec inet addr:10.0.0.40 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::440d:9eff:fe67:69ec/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:38 errors:0 dropped:0 overruns:0 frame:0 TX packets:6 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9245 (9.0 KiB) TX bytes:468 (468.0 B) Cheers, Tom -- Name: eth1 Type: (null) Subsys: net Number: 1 Path: /sys/devices/platform/at91_ohci/usb1/1-1/1-1:1.0/net/eth1 Driver: (null) Action: (null) Seq Num: 0 Dev File: (null) Properties: UDEV_LOG:3 DEVPATH: /devices/platform/at91_ohci/usb1/1-1/1-1:1.0/net/eth1 INTERFACE: eth1 IFINDEX: 3 SUBSYSTEM: net ID_VENDOR: Moschip_Semiconductor ID_VENDOR_ENC: Moschip\x20Semiconductor ID_VENDOR_ID:9710 ID_MODEL:USB-MAC_Controller ID_MODEL_ENC:USB-MAC\x20Controller\x20\x20\x20 ID_MODEL_ID: 7830 ID_REVISION: 0100 ID_SERIAL: Moschip_Semiconductor_USB-MAC_Controller_3b00082f ID_SERIAL_SHORT: 3b00082f ID_TYPE: generic ID_BUS: usb ID_USB_INTERFACES: :ff00ff: ID_USB_INTERFACE_NUM:00 ID_USB_DRIVER: MOSCHIP usb-ethernet driver ID_VENDOR_FROM_DATABASE: MosChip Semiconductor ID_MODEL_FROM_DATABASE: MCS7830 10/100 Mbps Ethernet adapter ID_MM_CANDIDATE: 1 -- Name: 1-1:1.0 Type: usb_interface Subsys: usb Number: 0 Path: /sys/devices/platform/at91_ohci/usb1/1-1/1-1:1.0 Driver: MOSCHIP usb-ethernet driver Action: (null) Seq Num: 0 Dev File: (null) Properties: UDEV_LOG: 3 DEVPATH: /devices/platform/at91_ohci/usb1/1-1/1-1:1.0 DEVTYPE: usb_interface DRIVER:MOSCHIP usb-ethernet driver PRODUCT: 9710/7830/100 TYPE: 255/0/255 INTERFACE: 255/0/255 MODALIAS: usb:v9710p7830d0100dcFFdsc00dpFFicFFisc00ipFF SUBSYSTEM: usb -- Name: 1-1 Type: usb_device Subsys: usb Number: 1 Path: /sys/devices/platform/at91_ohci/usb1/1-1 Driver: usb Action: (null) Seq Num: 0 Dev File: /dev/bus/usb/001/003 Properties: UDEV_LOG: 3 DEVPATH: /devices/platform/at91_ohci/usb1/1-1 MAJOR: 189 MINOR: 2 DEVNAME: /dev/bus/usb/001/003 DEVTYPE: usb_device DRIVER:usb PRODUCT: 9710/7830/100 TYPE: 255/0/255 BUSNUM:001 DEVNUM:003 SUBSYSTEM: usb ID_VENDOR: Moschip_Semiconductor ID_VENDOR_ENC: Moschip\x20Semiconductor ID_VENDOR_ID: 9710 ID_MODEL: USB-MAC_Controller ID_MODEL_ENC: USB-MAC\x20Controller\x20\x20\x20 ID_MODEL_ID: 7830 ID_REVISION: 0100 ID_SERIAL: Moschip_Semiconductor_USB-MAC_Controller_3b00082f ID_SERIAL_SHORT: 3b00082f ID_BUS:usb ID_USB_INTERFACES: :ff00ff: DEVLINKS: /dev/char/189:2 -- Name: usb1 Type: usb_device Subsys: usb Number: 1 Path: /sys/devices/platform/at91_ohci/usb1 Driver: usb Action: (null) Seq Num: 0 Dev File: /dev/bus/usb/001/001 Properties: UDEV_LOG: 3 DEVPATH: /devices/platform/at91_ohci/usb1
Re: ModemManager: MMCallbackInfo scheduled twice when device removed
Each MMCallbackInfo holds a weak reference to the MMModem to which the AT command was sent. When the MMModem is destroyed, mm-callback-info.c::modem_destroyed_cb() gets called and the modem pointer in the callback info is reset to NULL, to avoid having a pointer to an already disposed MMModem. See [1]. But, in addition to setting the modem pointer to NULL, an explicit error is just set directly in the callback info, and it gets scheduled. The problem here is that after destroying the modem, the ports it held also get closed as part of the destruction, and during port closing there's the task of finalizing all pending commands (see mm-serial-port.c::mm_serial_port_close()), which is done by passing an error to the specific response handler, and which will then (usually) propagate that error to the MMCallbackInfo and schedule it right away. That ends up in a memory leak (most response handlers will just set info-error without assuming there may already be a GError set); plus a critical in the second call to mm_callback_info_schedule() because a callback info can't be scheduled twice. I've been looking at this problem some time, and the best way to fix it seems to be to just avoid setting the first error and scheduling in modem_destroyed_cb(): diff --git a/src/mm-callback-info.c b/src/mm-callback-info.c index 1986bb5..8f8ecca 100644 --- a/src/mm-callback-info.c +++ b/src/mm-callback-info.c @@ -53,13 +53,9 @@ modem_destroyed_cb (gpointer data, GObject *destroyed) { MMCallbackInfo *info = data; +/* Just set the modem pointer to NULL, do not further process the + * callback info */ info-modem = NULL; -if (!info-pending_id) { -info-error = g_error_new_literal (MM_MODEM_ERROR, - MM_MODEM_ERROR_REMOVED, - The modem was removed.); -mm_callback_info_schedule (info); -} } Comments? How does that play into the mm_modem_check_removed() checks which I think are one of the more common places this error is looked for? I think the motivation here was to be *sure* that any callback handler waiting for the result got an error. The thing we want to ensure here is that if a D-Bus client of MM made a request when the modem was pulled out or crashed (which can happen pretty often) that the client gets a reply instead of a timed-out D-Bus method return error. I'm sure there's room for cleanup here, but that was the original motivation. Do we just need to audit the callback handlers to make sure they do the right thing with a ERROR_REMOVED? You're right, removing the error setting in modem_destroyed_cb() is not the right thing to do, if we want to keep the ERROR_REMOVED logic around. I will try to explain the issue with an example flow of execution, and suggest another approach below: (1) MM sends an AT command to the modem, like the periodic ones to get signal strength. (2) Modem is disconnected, reply to the sent AT command was not received yet, so it gets disconnected in the middle of a send-receive operation. (3) MMModem object destruction starts. Due to the weak reference to the modem in the MMCallbackInfo, modem_destroyed_cb() gets called. info-modem is set to NULL, info-error is set to ERROR_REMOVED and the callback info is scheduled. (4) During modem object destruction (in the same loop iteration as step 3!), ports in the modem also get destroyed. During port destruction, all pending commands which didn't get reply are processed, and a SEND_FAILED error is passed to the response-received callback. This callback then uses mm_modem_check_removed() (well, actually not all use it), and as info-modem is NULL, it will overwrite info-error with a newly created ERROR_REMOVED error. Once the new error is set, the callback info is scheduled, again. So always ends up with a memleak and a re-schedule of the callback info. From what I see, there are some things to fix here then: (a) Not all response-received callbacks use mm_modem_check_removed(), they should all use it. (b) The response-received callback should not overwrite info-error if already set (avoiding memleak). (c) If ERROR_REMOVED is already set in the MMCallbackInfo, the response-received callback should *not* re-schedule the callback info, it should assume it was already scheduled. Another option would be to modify mm_callback_info_schedule() to just allow being called twice, silently returning without doing anything the second time it gets called. What do you think of this? Cheers! -- Aleksander ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: What about the patch for USB gadgets?
On Wed, 2011-05-11 at 15:11 +0200, W. Martin Borgert wrote: Hi, there was a patch sent to the list in February: http://mail.gnome.org/archives/networkmanager-list/2011-February/msg00152.html However, I can't find any reaction on the list, neither approval nor rejection. Can someone comment on the patch or point me to existing comments, please? TIA! I just pushed a cleaned-up version of this patch to git master and NM_0_8. (thanks Thomas! sorry for the lag...) Dan ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
[PATCH 1/3] ADSL: Settings and initial scaffolding
This patch adds the settings code (NMSettingAdsl) and the initial scaffolding i.e., a tiny stub version of NMDeviceAdsl and the udev handler code to get the device detected. With this patch you should be able to see an atm device being detected by networkmanager in the logs, although of course it doesn't do anything useful yet. Extract from the logs: [1304668252.341354] [nm-udev-manager.c:562] adsl_add(): adsl_add: ATM Device detected from udev. Adding .. (ueagle-atm0): failed to look up interface index (ueagle-atm0): new ADSL device (driver: 'ueagle-atm' ifindex: -1) (ueagle-atm0): exported as /org/freedesktop/NetworkManager/Devices/2 (ueagle-atm0): now managed (ueagle-atm0): device state change: unmanaged - unavailable (reason 'managed') [10 20 2] (ueagle-atm0): deactivating device (reason: 2). [1304668252.345102] [nm-system.c:1349] flush_routes(): (ueagle-atm0) failed to lookup interface index [1304668252.347821] [nm-device.c:3912] nm_device_state_changed(): (ueagle-atm0): device is available, In this version, we hack the nm-device.c:nm_device_get_priority() to get better priority instead of changing the DeviceType enum. Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com --- include/NetworkManager.h |2 + introspection/Makefile.am|1 + introspection/nm-device-adsl.xml | 15 + libnm-util/Makefile.am |2 + libnm-util/libnm-util.ver| 12 + libnm-util/nm-setting-adsl.c | 540 ++ libnm-util/nm-setting-adsl.h | 97 +++ src/Makefile.am |6 + src/nm-device-adsl.c | 83 ++ src/nm-device-adsl.h | 57 src/nm-device.c |8 +- src/nm-udev-manager.c| 49 - 12 files changed, 869 insertions(+), 3 deletions(-) create mode 100644 introspection/nm-device-adsl.xml create mode 100644 libnm-util/nm-setting-adsl.c create mode 100644 libnm-util/nm-setting-adsl.h create mode 100644 src/nm-device-adsl.c create mode 100644 src/nm-device-adsl.h diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 17c3a11..6997771 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -101,6 +101,7 @@ typedef enum { * @NM_DEVICE_TYPE_WIMAX: an 802.16e Mobile WiMAX broadband device * @NM_DEVICE_TYPE_MODEM: a modem supporting analog telephone, CDMA/EVDO, * GSM/UMTS, or LTE network access protocols + * @NM_DEVICE_TYPE_ADSL: ADSL modem * * #NMState values indicate the current overall networking state. */ @@ -114,6 +115,7 @@ typedef enum { NM_DEVICE_TYPE_OLPC_MESH = 6, NM_DEVICE_TYPE_WIMAX = 7, NM_DEVICE_TYPE_MODEM = 8, + NM_DEVICE_TYPE_ADSL = 9, } NMDeviceType; /* General device capability flags */ diff --git a/introspection/Makefile.am b/introspection/Makefile.am index 320245e..4950e7d 100644 --- a/introspection/Makefile.am +++ b/introspection/Makefile.am @@ -8,6 +8,7 @@ EXTRA_DIST = \ nm-device-wifi.xml \ nm-device-olpc-mesh.xml \ nm-device-ethernet.xml \ + nm-device-adsl.xml \ nm-device-modem.xml \ nm-device-wimax.xml \ nm-device.xml \ diff --git a/introspection/nm-device-adsl.xml b/introspection/nm-device-adsl.xml new file mode 100644 index 000..9610f98 --- /dev/null +++ b/introspection/nm-device-adsl.xml @@ -0,0 +1,15 @@ +?xml version=1.0 encoding=UTF-8 ? + +node name=/ xmlns:tp=http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0; + interface name=org.freedesktop.NetworkManager.Device.Adsl + +signal name=PropertiesChanged +arg name=properties type=a{sv} tp:type=String_Variant_Map +tp:docstring +A dictionary mapping property names to variant boxed values +/tp:docstring +/arg +/signal + + /interface +/node diff --git a/libnm-util/Makefile.am b/libnm-util/Makefile.am index 0a29e9c..9f452a4 100644 --- a/libnm-util/Makefile.am +++ b/libnm-util/Makefile.am @@ -14,6 +14,7 @@ libnm_util_include_HEADERS = \ nm-connection.h \ nm-setting.h\ nm-setting-8021x.h \ + nm-setting-adsl.h \ nm-setting-bluetooth.h \ nm-setting-connection.h \ nm-setting-ip4-config.h \ @@ -43,6 +44,7 @@ libnm_util_la_csources = \ nm-param-spec-specialized.c \ nm-setting.c\ nm-setting-8021x.c \ + nm-setting-adsl.c \ nm-setting-bluetooth.c \ nm-setting-connection.c \ nm-setting-ip4-config.c \ diff --git a/libnm-util/libnm-util.ver b/libnm-util/libnm-util.ver index 4ff0838..f433d0a 100644 --- a/libnm-util/libnm-util.ver +++ b/libnm-util/libnm-util.ver @@ -27,6 +27,7 @@ global: nm_connection_get_setting_vpn; nm_connection_get_setting_wimax;
ADSL: Carrier Handling and PPP support
This is the juice of the patch series. Initial cut at carrier handling (by polling /sys/class/atm/$iface/carrier) and also support for calling pppd with the proper command-line to achieve a connection. Also implement the necessary boilerplate for the NM state machine to be happy with our device. With this patch, you can already test carrier management but not yet make a complete connection. Relevant extract from logs: info (ueagle-atm0): carrier now ON (device state 20) info (ueagle-atm0): device state change: unavailable - disconnected (reason 'carrier-changed') [20 30 40] Signed-off-by: Pantelis Koukousoulas pkt...@gmail.com --- include/NetworkManager.h |1 + src/nm-device-adsl.c | 519 +- src/nm-device-adsl.h |5 +- src/ppp-manager/nm-ppp-manager.c | 31 +++- src/settings/nm-settings.c |2 + 5 files changed, 553 insertions(+), 5 deletions(-) diff --git a/include/NetworkManager.h b/include/NetworkManager.h index 6997771..f2e4727 100644 --- a/include/NetworkManager.h +++ b/include/NetworkManager.h @@ -34,6 +34,7 @@ #defineNM_DBUS_INTERFACE org.freedesktop.NetworkManager #defineNM_DBUS_INTERFACE_DEVICENM_DBUS_INTERFACE .Device #define NM_DBUS_INTERFACE_DEVICE_WIRED NM_DBUS_INTERFACE_DEVICE .Wired +#define NM_DBUS_INTERFACE_DEVICE_ADSL NM_DBUS_INTERFACE_DEVICE .Adsl #define NM_DBUS_INTERFACE_DEVICE_WIRELESS NM_DBUS_INTERFACE_DEVICE .Wireless #define NM_DBUS_INTERFACE_DEVICE_BLUETOOTH NM_DBUS_INTERFACE_DEVICE .Bluetooth #define NM_DBUS_PATH_ACCESS_POINT NM_DBUS_PATH /AccessPoint diff --git a/src/nm-device-adsl.c b/src/nm-device-adsl.c index 212fec1..77e4d0a 100644 --- a/src/nm-device-adsl.c +++ b/src/nm-device-adsl.c @@ -1,5 +1,6 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ -/* NetworkManager -- Network link manager +/* + * Pantelis Koukousoulas pkt...@gmail.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,26 +16,153 @@ * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * - * Pantelis Koukousoulas pkt...@gmail.com */ #include glib.h +#include glib/gi18n.h +#include stdlib.h +#include string.h #include nm-glib-compat.h #include nm-device-adsl.h #include nm-device-interface.h +#include nm-device-private.h #include nm-properties-changed-signal.h +#include nm-glib-compat.h +#include NetworkManagerUtils.h +#include nm-logging.h + +#include ppp-manager/nm-ppp-manager.h +#include nm-setting-adsl.h #include nm-device-adsl-glue.h G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE) +#define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate)) + +typedef enum +{ + NM_ADSL_ERROR_CONNECTION_NOT_ADSL = 0, + NM_ADSL_ERROR_CONNECTION_INVALID, + NM_ADSL_ERROR_CONNECTION_INCOMPATIBLE, +} NMAdslError; + +#define NM_ADSL_ERROR (nm_adsl_error_quark ()) +#define NM_TYPE_ADSL_ERROR (nm_adsl_error_get_type ()) + +static GQuark +nm_adsl_error_quark (void) +{ + static GQuark quark = 0; + if (!quark) + quark = g_quark_from_static_string (nm-ethernet-error); + return quark; +} + +typedef struct { + gbooleandisposed; + gbooleancarrier; + guint carrier_poll_id; + + /* PPP */ + NMPPPManager *ppp_manager; + NMIP4Config *pending_ip4_config; +} NMDeviceAdslPrivate; + enum { PROPERTIES_CHANGED, LAST_SIGNAL }; + static guint signals[LAST_SIGNAL] = { 0 }; +enum { + PROP_0, + PROP_CARRIER, + + LAST_PROP +}; + +/* FIXME: Move it to nm-device.c and then get rid of all foo_device_get_setting() all around. + It's here now to keep the patch short. */ +static NMSetting * +device_get_setting (NMDevice *device, GType setting_type) +{ + NMActRequest *req; + NMSetting *setting = NULL; + + req = nm_device_get_act_request (device); + if (req) { + NMConnection *connection; + + connection = nm_act_request_get_connection (req); + if (connection) + setting = nm_connection_get_setting (connection, setting_type); + } + + return setting; +} + +static void +set_carrier(NMDeviceAdsl *self, const gboolean carrier) +{ + NMDeviceAdslPrivate *priv; + NMDeviceState state; + + g_return_if_fail (NM_IS_DEVICE (self)); + + priv = NM_DEVICE_ADSL_GET_PRIVATE (self); + + if (priv-carrier == carrier) + return; + + priv-carrier = carrier; + g_object_notify (G_OBJECT (self), NM_DEVICE_ADSL_CARRIER); + + state = nm_device_interface_get_state (NM_DEVICE_INTERFACE
[PATCH 3/3] ADSL: Add libnm-glib and nmcli code
For the finale, this is the libnm-glib and nmcli part of the support, with this you can now make a full pppoatm connection from NetworkManager by configuring it in system scope in a keyfile. As an example, here is mine: (password and username snipped for obvious reasons) [connection] id=MYISP uuid=34d04e69-fdd9-4231-af2c-25ed1f34dc1e type=adsl timestamp=1304621332 [adsl] username=u...@myisp.com password=mypassword vpi=8 vci=35 encapsulation=vcmux protocol=pppoa [ipv6] method=ignore [ipv4] method=auto Extract from logs: NetworkManager[29155]: info Activation (ueagle-atm0) starting connection 'MYISP' NetworkManager[29155]: info (ueagle-atm0): device state change: disconnected - prepare (reason 'none') [30 40 0] NetworkManager[29155]: info Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) scheduled... NetworkManager[29155]: info Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) started... NetworkManager[29155]: info Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) scheduled... NetworkManager[29155]: info Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) complete. NetworkManager[29155]: info Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) starting... NetworkManager[29155]: info (ueagle-atm0): device state change: prepare - config (reason 'none') [40 50 0] NetworkManager[29155]: info Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) successful. NetworkManager[29155]: info Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) scheduled. NetworkManager[29155]: info Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) complete. NetworkManager[29155]: info Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) started... NetworkManager[29155]: info (ueagle-atm0): device state change: config - ip-config (reason 'none') [50 70 0] NetworkManager[29155]: info starting PPP connection NetworkManager[29155]: debug [1304671146.590156] [nm-ppp-manager.c:1047] nm_ppp_manager_start(): command line: /usr/sbin/pppd nodetach lock nodefaultroute user u...@myisp.com plugin pppoatm.so 8.35 noipdefault noauth usepeerdns lcp-echo-failure 0 lcp-echo-interval 0 ipparam /org/freedesktop/NetworkManager/PPP/0 plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so NetworkManager[29155]: info pppd started with pid 29175 NetworkManager[29155]: debug [1304671146.591235] [NetworkManagerUtils.c:816] nm_utils_get_proc_sys_net_value(): (ueagle-atm0): error reading /proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra: (4) Failed to open file '/proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra': No such file or directory NetworkManager[29155]: info Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) complete. Plugin pppoatm.so loaded. Plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so loaded. ** Message: nm-ppp-plugin: (plugin_init): initializing ** Message: nm-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection' NetworkManager[29155]: debug [1304671146.612937] [nm-udev-manager.c:621] handle_uevent(): UDEV event: action 'add' subsys 'net' device 'ppp0' NetworkManager[29155]: debug [1304671146.613134] [nm-udev-manager.c:525] net_add(): ignoring interface with type 512 NetworkManager[29155]: debug [1304671146.617308] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x1090 Using interface ppp0 Connect: ppp0 -- 8.35 ** Message: nm-ppp-plugin: (nm_phasechange): status 5 / phase 'establish' ** Message: nm-ppp-plugin: (nm_phasechange): status 6 / phase 'authenticate' ** Message: nm-ppp-plugin: (get_credentials): passwd-hook, requesting credentials... NetworkManager[29155]: debug [1304671149.639511] [nm-agent-manager.c:1044] nm_agent_manager_get_secrets(): Secrets requested for connection /org/freedesktop/NetworkManager/Settings/0 (adsl) NetworkManager[29155]: debug [1304671149.639684] [nm-settings-connection.c:717] nm_settings_connection_get_secrets(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets requested flags 0x1 hint 'password' NetworkManager[29155]: debug [1304671149.640950] [nm-agent-manager.c:959] get_start(): (0x9b4ad10/adsl) system settings secrets sufficient NetworkManager[29155]: debug [1304671149.641332] [nm-settings-connection.c:573] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) existing secrets returned NetworkManager[29155]: debug [1304671149.641541] [nm-settings-connection.c:579] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets request completed NetworkManager[29155]: debug [1304671149.643074] [nm-settings-connection.c:618] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) new agent secrets processed ** Message: nm-ppp-plugin: (get_credentials): got credentials from NetworkManager PAP authentication succeeded ** Message: nm-ppp-plugin: (nm_phasechange): status 8 / phase 'network' local IP address 94.70.90.201 remote IP address 80.106.108.12 primary DNS address 195.170.0.1 secondary DNS address 195.170.2.2 **
[PATCH] ModemManager: Split the Samsung initialization sequence so that echoing is properly disabled
We were sometimes seeing the IMSI reported as AT+CIMI\n\r\n\r31026... because echoing was not always turned off at the point that the IMSI is requested. This patch fixes that by splitting the reset commands so that the second part of the command gets processed after the reset is complete. (This wasn't always a problem because the initial IMSI request usually fails since the SIM is not yet powered up. With the right enable/disable sequences, however, the initial AT+CIMI would succeed, and be echoed into the returned value.) - Nathan From fa69fc6d4019b909db77e387ab5c9a5765c85159 Mon Sep 17 00:00:00 2001 From: Nathan Williams n...@chromium.org Date: Thu, 12 May 2011 15:23:33 -0400 Subject: [PATCH] Split the Samsung initialization sequence from ATZ E0 V1 to ATZ and ATE0 V1 - the modem is allowed to ignore the rest of the line after Z, so echoing was not being turned off, leading to getting AT+CIMI\n\n as part of the IMSI when it is retrieved at startup. Change-Id: Icfd767174e779e472f8cde419acb163128e4715d --- plugins/mm-modem-samsung-gsm.c | 17 - 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/plugins/mm-modem-samsung-gsm.c b/plugins/mm-modem-samsung-gsm.c index 8b51ca8..6ee2e16 100755 --- a/plugins/mm-modem-samsung-gsm.c +++ b/plugins/mm-modem-samsung-gsm.c @@ -704,6 +704,21 @@ init_done (MMAtSerialPort *port, } static void +init_reset_done (MMAtSerialPort *port, + GString *response, + GError *error, + gpointer user_data) +{ +MMCallbackInfo *info = (MMCallbackInfo *) user_data; +MMModemSamsungGsm *self = MM_MODEM_SAMSUNG_GSM (info-modem); + +if (error) +mm_generic_gsm_enable_complete (MM_GENERIC_GSM (self), error, info); +else +mm_at_serial_port_queue_command (port, E0 V1, 3, init_done, info); +} + +static void do_enable (MMGenericGsm *modem, MMModemFn callback, gpointer user_data) { MMCallbackInfo *info; @@ -713,7 +728,7 @@ do_enable (MMGenericGsm *modem, MMModemFn callback, gpointer user_data) primary = mm_generic_gsm_get_at_port (modem, MM_PORT_TYPE_PRIMARY); g_assert (primary); -mm_at_serial_port_queue_command (primary, Z E0 V1, 3, init_done, info); +mm_at_serial_port_queue_command (primary, Z, 3, init_reset_done, info); } static void -- 1.7.3.1 ___ networkmanager-list mailing list networkmanager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list