diff options
| author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
|---|---|---|
| committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
| commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
| tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/networkmanager | |
| parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) | |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/networkmanager')
39 files changed, 1622 insertions, 0 deletions
diff --git a/recipes/networkmanager/cnetworkmanager_git.bb b/recipes/networkmanager/cnetworkmanager_git.bb new file mode 100644 index 0000000000..2a8ba64a2b --- /dev/null +++ b/recipes/networkmanager/cnetworkmanager_git.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "Command line interface for Network Manager" +HOMEPAGE = "http://vidner.net/martin/software/cnetworkmanager/" +LICENSE = "GPL" +SECTION = "console/network" +RDEPENDS = "python-core python-crypt python-dbus python-math python-pygobject python-re python-textutils python-uuid python-xml" +PR = "r1" +PV = "0.8+git" + +SRC_URI = "git://repo.or.cz/r/cnetworkmanager.git;protocol=http;tag=801f95b5fd856cd8ec25dc56839f47c1a12e6041" + +S = "${WORKDIR}/git" + +do_compile() { +} + +do_install(){ + install -d ${D}${bindir} + install -m 755 cnetworkmanager ${D}${bindir} + install -d ${D}${sysconfdir}/dbus-1/system.d + install -m 644 cnetworkmanager.conf ${D}${sysconfdir}/dbus-1/system.d +} diff --git a/recipes/networkmanager/files/008-BACKEND-debian-fallback-to-generic-loopback.loom.patch b/recipes/networkmanager/files/008-BACKEND-debian-fallback-to-generic-loopback.loom.patch new file mode 100644 index 0000000000..f29fa77979 --- /dev/null +++ b/recipes/networkmanager/files/008-BACKEND-debian-fallback-to-generic-loopback.loom.patch @@ -0,0 +1,64 @@ +=== modified file 'ChangeLog' +--- + ChangeLog | 10 ++++++++++ + src/backends/NetworkManagerDebian.c | 6 +++++- + 2 files changed, 15 insertions(+), 1 deletion(-) + +Index: network-manager-0.7~~svn20081015t024626/ChangeLog +=================================================================== +--- network-manager-0.7~~svn20081015t024626.orig/ChangeLog ++++ network-manager-0.7~~svn20081015t024626/ChangeLog +@@ -120,16 +120,26 @@ + + 2008-10-10 Tambet Ingo <tambet@gmail.com> + + * src/nm-logging.c (nm_logging_setup): Don't use LOG_CONS when running as + a daemon to prevent NM logging spew on console on startup and shutdown (due + to dependency loop between NM and syslog). + + 2008-10-10 Alexander Sack <asac@ubuntu.com> ++ ++ Fallback to generic enable_loopback if /sbin/ifup isnt installed or ++ fails. ++ * src/backends/NetworkManagerDebian.c ++ - (nm_system_enable_loopback): test for /sbin/ifconfig binary ++ and fallback to nm_generic_enable_loopback if it ++ doesnt exist or when /sbin/ifconfig lo up fails for ++ whatever reason. ++ ++2008-10-10 Alexander Sack <asac@ubuntu.com> + + Implement managed mode. We bind devices configured in /etc/network/interfaces + to their connections by updating wired/wireless setting with the + mac address of the device. + + * system-settings/plugins/ifupdown/plugin.c + - (get_net_address_for_udi): implement function to retrieve MAC + address of udi from hal in GByteArray format +Index: network-manager-0.7~~svn20081015t024626/src/backends/NetworkManagerDebian.c +=================================================================== +--- network-manager-0.7~~svn20081015t024626.orig/src/backends/NetworkManagerDebian.c ++++ network-manager-0.7~~svn20081015t024626/src/backends/NetworkManagerDebian.c +@@ -39,17 +39,21 @@ + /* + * nm_system_enable_loopback + * + * Bring up the loopback interface + * + */ + void nm_system_enable_loopback (void) + { +- nm_spawn_process ("/sbin/ifup lo"); ++ // if wrapper fails we gonna try our own ++ if(!g_file_test ("/sbin/ifconfig", G_FILE_TEST_IS_EXECUTABLE) || ++ nm_spawn_process ("/sbin/ifconfig lo up") != 0) { ++ nm_generic_enable_loopback (); ++ } + } + + /* + * nm_system_update_dns + * + * Invalidate the nscd host cache, if it exists, since + * we changed resolv.conf. + * diff --git a/recipes/networkmanager/files/02-dbus_access_network_manager.patch b/recipes/networkmanager/files/02-dbus_access_network_manager.patch new file mode 100644 index 0000000000..7dc2ddd0eb --- /dev/null +++ b/recipes/networkmanager/files/02-dbus_access_network_manager.patch @@ -0,0 +1,14 @@ +diff -Nur bzr.debian.0.9.4.patchupdate/src/NetworkManager.conf bzr.debian.0.9.4.patchupdate.new/src/NetworkManager.conf +--- bzr.debian.0.9.4.patchupdate/src/NetworkManager.conf 2007-06-25 17:14:46.000000000 +0200 ++++ bzr.debian.0.9.4.patchupdate.new/src/NetworkManager.conf 2007-06-25 17:15:51.000000000 +0200 +@@ -8,6 +8,10 @@ + <allow send_destination="org.freedesktop.NetworkManager"/> + <allow send_interface="org.freedesktop.NetworkManager"/> + </policy> ++ <policy user="haldaemon"> ++ <allow send_destination="org.freedesktop.NetworkManager"/> ++ <allow send_interface="org.freedesktop.NetworkManager"/> ++ </policy> + <policy at_console="true"> + <allow send_destination="org.freedesktop.NetworkManager"/> + <allow send_interface="org.freedesktop.NetworkManager"/> diff --git a/recipes/networkmanager/files/25NetworkManager b/recipes/networkmanager/files/25NetworkManager new file mode 100644 index 0000000000..6b51bfa843 --- /dev/null +++ b/recipes/networkmanager/files/25NetworkManager @@ -0,0 +1,30 @@ +#!/bin/sh +# +# NetworkManager startup script + +. /etc/profile + +case $1 in + 'start') + echo -n "Starting NetworkManager daemon: NetworkManager" + /usr/sbin/NetworkManager + /usr/sbin/NetworkManagerDispatcher + echo "." + ;; + + 'stop') + echo -n "Stopping NetworkManager daemon: NetworkManager" + kill `pidof NetworkManagerDispatcher` + kill `pidof NetworkManager` + echo "." + ;; + + 'restart') + $0 stop + $0 start + ;; + + *) + echo "Usage: $0 { start | stop | restart }" + ;; +esac diff --git a/recipes/networkmanager/files/99_networkmanager b/recipes/networkmanager/files/99_networkmanager new file mode 100644 index 0000000000..20cbcc1bca --- /dev/null +++ b/recipes/networkmanager/files/99_networkmanager @@ -0,0 +1 @@ +d root root 0700 /var/run/NetworkManager none diff --git a/recipes/networkmanager/files/NetworkManager b/recipes/networkmanager/files/NetworkManager new file mode 100755 index 0000000000..0beff63081 --- /dev/null +++ b/recipes/networkmanager/files/NetworkManager @@ -0,0 +1,28 @@ +#!/bin/sh +# +# NetworkManager startup script + +. /etc/profile + +case $1 in + 'start') + echo -n "Starting NetworkManager daemon: NetworkManager" + /usr/sbin/NetworkManager + echo "." + ;; + + 'stop') + echo -n "Stopping NetworkManager daemon: NetworkManager" + kill `ps |grep /usr/sbin/NetworkManager | grep -v grep | cut "-d " -f2` + echo "." + ;; + + 'restart') + $0 stop + $0 start + ;; + + *) + echo "Usage: $0 { start | stop | restart }" + ;; +esac diff --git a/recipes/networkmanager/files/add_probe_for_v250_modems.patch b/recipes/networkmanager/files/add_probe_for_v250_modems.patch new file mode 100644 index 0000000000..011bf93d9d --- /dev/null +++ b/recipes/networkmanager/files/add_probe_for_v250_modems.patch @@ -0,0 +1,342 @@ +=== modified file 'src/Makefile.am' +--- + src/Makefile.am | 4 - + src/nm-hal-manager.c | 24 ++++++- + src/probe-modem.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++++ + src/probe-modem.h | 29 ++++++++ + 4 files changed, 220 insertions(+), 3 deletions(-) + +Index: network-manager.07.ubuntu/src/Makefile.am +=================================================================== +--- network-manager.07.ubuntu.orig/src/Makefile.am ++++ network-manager.07.ubuntu/src/Makefile.am +@@ -67,17 +67,19 @@ + nm-cdma-device.h \ + nm-hso-gsm-device.c \ + nm-hso-gsm-device.h \ + wpa.c \ + wpa.h \ + nm-netlink.c \ + nm-netlink.h \ + nm-dhcp4-config.c \ +- nm-dhcp4-config.h ++ nm-dhcp4-config.h \ ++ probe-modem.c \ ++ probe-modem.h + + nm-access-point-glue.h: $(top_srcdir)/introspection/nm-access-point.xml + dbus-binding-tool --prefix=nm_access_point --mode=glib-server --output=$@ $< + + nm-manager-glue.h: $(top_srcdir)/introspection/nm-manager.xml + dbus-binding-tool --prefix=nm_manager --mode=glib-server --output=$@ $< + + nm-device-interface-glue.h: $(top_srcdir)/introspection/nm-device.xml +Index: network-manager.07.ubuntu/src/nm-hal-manager.c +=================================================================== +--- network-manager.07.ubuntu.orig/src/nm-hal-manager.c ++++ network-manager.07.ubuntu/src/nm-hal-manager.c +@@ -12,16 +12,19 @@ + #include "nm-dbus-manager.h" + #include "nm-utils.h" + #include "nm-device-wifi.h" + #include "nm-device-ethernet.h" + #include "nm-gsm-device.h" + #include "nm-hso-gsm-device.h" + #include "nm-cdma-device.h" + ++#include "probe-modem.h" ++ ++ + /* Killswitch poll frequency in seconds */ + #define RFKILL_POLL_FREQUENCY 6 + + #define HAL_DBUS_SERVICE "org.freedesktop.Hal" + + typedef struct { + LibHalContext *hal_ctx; + NMDBusManager *dbus_mgr; +@@ -269,43 +272,51 @@ + modem_device_creator (NMHalManager *self, const char *udi, gboolean managed) + { + NMHalManagerPrivate *priv = NM_HAL_MANAGER_GET_PRIVATE (self); + char *serial_device; + char *parent_udi; + char *driver_name = NULL; + GObject *device = NULL; + char **capabilities, **iter; +- gboolean type_gsm = FALSE; +- gboolean type_cdma = FALSE; ++ gboolean type_gsm; ++ gboolean type_cdma; ++ gboolean type_v250; + char *netdev = NULL; + + serial_device = libhal_device_get_property_string (priv->hal_ctx, udi, "serial.device", NULL); + + /* Get the driver */ + parent_udi = libhal_device_get_property_string (priv->hal_ctx, udi, "info.parent", NULL); + if (parent_udi) { + driver_name = libhal_device_get_property_string (priv->hal_ctx, parent_udi, "info.linux.driver", NULL); + libhal_free_string (parent_udi); + } + + if (!serial_device || !driver_name) + goto out; + ++ type_gsm = FALSE; ++ type_cdma = FALSE; ++ type_v250 = FALSE; + capabilities = libhal_device_get_property_strlist (priv->hal_ctx, udi, "modem.command_sets", NULL); + /* 'capabilites' may be NULL */ + for (iter = capabilities; iter && *iter; iter++) { + if (!strcmp (*iter, "GSM-07.07")) { + type_gsm = TRUE; + break; + } + if (!strcmp (*iter, "IS-707-A")) { + type_cdma = TRUE; + break; + } ++ if (!strcmp (*iter, "V.250")) { ++ type_v250 = TRUE; ++ /* no break here! */ ++ } + } + g_strfreev (capabilities); + + /* Compatiblity with the pre-specification bits */ + if (!type_gsm && !type_cdma) { + capabilities = libhal_device_get_property_strlist (priv->hal_ctx, udi, "info.capabilities", NULL); + for (iter = capabilities; *iter; iter++) { + if (!strcmp (*iter, "gsm")) { +@@ -315,16 +326,25 @@ + if (!strcmp (*iter, "cdma")) { + type_cdma = TRUE; + break; + } + } + g_strfreev (capabilities); + } + ++ /* V.250 probe */ ++ if (!type_gsm && !type_cdma && type_v250) { ++ gint probed_type = probe_modem (serial_device, udi, priv->hal_ctx); ++ if (probed_type == 1) ++ type_gsm = TRUE; ++ else if (probed_type == 2) ++ type_cdma = TRUE; ++ } ++ + /* Special handling of 'hso' cards (until punted out to a modem manager) */ + if (type_gsm && !strcmp (driver_name, "hso")) + netdev = get_hso_netdev (priv->hal_ctx, udi); + + if (type_gsm) { + if (netdev) + device = (GObject *) nm_hso_gsm_device_new (udi, serial_device + strlen ("/dev/"), NULL, netdev, driver_name, managed); + else +Index: network-manager.07.ubuntu/src/probe-modem.c +=================================================================== +--- /dev/null ++++ network-manager.07.ubuntu/src/probe-modem.c +@@ -0,0 +1,166 @@ ++/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ ++/* Probe modem capabilities ++ * ++ * Copyright (c) 2008 Vitja Makarov, <vitja.makarov@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 ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#include <termios.h> ++#include <unistd.h> ++#include <fcntl.h> ++#include <errno.h> ++ ++#include <stdio.h> ++#include <string.h> ++#include <stdlib.h> ++ ++#include "nm-utils.h" ++#include "probe-modem.h" ++ ++ ++#define MODEM_CAP_GSM 0x0001 /* GSM commands */ ++#define MODEM_CAP_IS707_A 0x0002 /* CDMA circuit switched data commands */ ++#define MODEM_CAP_DS 0x0004 /* data compression */ ++#define MODEM_CAP_ES 0x0008 /* error control */ ++#define MODEM_CAP_FCLASS 0x0010 /* Fax commands */ ++#define MODEM_CAP_MS 0x0020 /* Modulation control commands */ ++#define MODEM_CAP_W 0x0040 /* Wireless commands */ ++ ++struct modem_caps { ++ char *name; ++ int bits; ++}; ++ ++static struct modem_caps modem_caps[] = { ++ {"+CGSM", MODEM_CAP_GSM}, ++ /* TODO: are they the same? */ ++ {"+CIS707-A", MODEM_CAP_IS707_A}, ++ {"+CIS707", MODEM_CAP_IS707_A}, ++ {"+CIS707P", MODEM_CAP_IS707_A}, ++ {NULL} ++} ; ++ ++#define AT_CAPS_PROBE "AT+GCAP\r\n" ++ ++static int modem_probe_caps(int fd) ++{ ++ char buf[200]; ++ char *ptr, *field = NULL; ++ int err, ret = 0; ++ ++ err = write(fd, AT_CAPS_PROBE, sizeof(AT_CAPS_PROBE) - 1); ++ ++ if (err != sizeof(AT_CAPS_PROBE) - 1) ++ return -1; ++ ++ /* 100ms is enough for modem to send all the data */ ++ usleep(100000); ++ ++ err = read(fd, buf, sizeof(buf) - 1); ++ if (err <= 0) ++ return -1; ++ buf[err] = 0; ++ ++ /* check okay reply */ ++ ptr = strstr(buf, "\r\nOK\r\n"); ++ if (!ptr) ++ return -1; ++ *ptr = 0; ++ ++ /* find +GCAP: string */ ++ ptr = strstr(buf, "\r\n+GCAP:"); ++ ++ if (ptr == NULL) ++ return -1; ++ ptr += 8; ++ ++ /* and parse it */ ++ do { ++ err = *ptr == '\0' || *ptr == '\r' || *ptr == '\n'; ++ if (*ptr == ' ' || *ptr == ',' || err) { ++ *ptr = 0; ++ if (field) { ++ struct modem_caps *cap = modem_caps; ++ ++ while (cap->name) { ++ if (!strcmp(cap->name, field)) ++ ret |= cap->bits; ++ cap++; ++ } ++ } ++ field = NULL; ++ } else if (NULL == field) { ++ field = ptr; ++ } ++ ptr++; ++ } while (!err); ++ ++ return ret; ++} ++ ++int probe_modem (const char* device, const char *udi, LibHalContext *ctx) ++{ ++ struct termios orig, attrs; ++ int fd, caps; ++ int rv = -1; ++ ++ fd = open(device, O_RDWR|O_NDELAY); ++ ++ if (-1 == fd) { ++ nm_warning ("open(%s): %s", device, strerror(errno)); ++ return rv; ++ } ++ ++ if (tcgetattr(fd, &orig)) ++ goto close_and_out; ++ ++ memcpy(&attrs, &orig, sizeof(attrs)); ++ attrs.c_iflag &= ~(IGNCR | ICRNL | IUCLC | INPCK | IXON | IXANY | IGNPAR); ++ attrs.c_oflag &= ~(OPOST | OLCUC | OCRNL | ONLCR | ONLRET); ++ attrs.c_lflag &= ~(ICANON | XCASE | ECHO | ECHOE | ECHONL); ++ attrs.c_lflag &= ~(ECHO | ECHOE); ++ attrs.c_cc[VMIN] = 1; ++ attrs.c_cc[VTIME] = 0; ++ attrs.c_cc[VEOF] = 1; ++ ++ tcsetattr(fd, TCSANOW, &attrs); ++ caps = modem_probe_caps(fd); ++ tcsetattr(fd, TCSANOW, &orig); ++ ++ if (caps < 0) { ++ nm_debug("Couldn't get caps"); ++ goto close_and_out; ++ } ++ ++ if (caps & MODEM_CAP_GSM) { ++ nm_debug("Found GSM modem"); ++ rv = 1; ++ goto close_and_out; ++ } ++ ++ if (caps & MODEM_CAP_IS707_A) { ++ nm_debug("Found CDMA modem"); ++ rv = 2; ++ goto close_and_out; ++ } ++ ++ rv = 0; ++ ++close_and_out: ++ close (fd); ++ return rv; ++} +Index: network-manager.07.ubuntu/src/probe-modem.h +=================================================================== +--- /dev/null ++++ network-manager.07.ubuntu/src/probe-modem.h +@@ -0,0 +1,29 @@ ++/* Copyright (c) 2008 Antti Kaijanmäki, <antti@kaijanmaki.net> ++ * ++ * 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 ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#ifndef PROBE_MODEM_H ++#define PROBE_MODEM_H ++ ++ ++#include <glib.h> ++#include <libhal.h> ++ ++/* returns '1' if properties were changed */ ++int probe_modem (const char* device, const char* udi, LibHalContext *ctx); ++ ++#endif /* PROBE_MODEM_H */ diff --git a/recipes/networkmanager/files/adding_no_scan_by_default.patch b/recipes/networkmanager/files/adding_no_scan_by_default.patch new file mode 100644 index 0000000000..31682c5c29 --- /dev/null +++ b/recipes/networkmanager/files/adding_no_scan_by_default.patch @@ -0,0 +1,12 @@ +Index: NetworkManager-0.6.6/initscript/Debian/NetworkManager +=================================================================== +--- NetworkManager-0.6.6.orig/initscript/Debian/NetworkManager 2008-09-03 17:44:23.000000000 -0300 ++++ NetworkManager-0.6.6/initscript/Debian/NetworkManager 2008-09-03 18:01:35.000000000 -0300 +@@ -18,6 +18,7 @@ + DESC="Network connection manager daemon" + NAME="NetworkManager" + DAEMON=/usr/sbin/$NAME ++DAEMON_OPTS=--no-scan + PIDFILE=/var/run/$NAME.pid + SCRIPTNAME=/etc/init.d/$NAME + USER=root diff --git a/recipes/networkmanager/files/applet-no-gnome.diff b/recipes/networkmanager/files/applet-no-gnome.diff new file mode 100644 index 0000000000..e098e8c9ed --- /dev/null +++ b/recipes/networkmanager/files/applet-no-gnome.diff @@ -0,0 +1,59 @@ +--- + configure.ac | 3 +-- + src/main.c | 8 ++++++++ + 2 files changed, 9 insertions(+), 2 deletions(-) + +Index: src/main.c +=================================================================== +--- src/main.c.orig 2007-09-26 10:39:16.000000000 +0100 ++++ src/main.c 2007-09-26 10:39:37.000000000 +0100 +@@ -27,7 +27,9 @@ + + #include <string.h> + #include <gtk/gtk.h> ++#if 0 + #include <libgnomeui/libgnomeui.h> ++#endif + #include <glib/gi18n-lib.h> + + #include "applet.h" +@@ -36,11 +38,15 @@ + int main (int argc, char *argv[]) + { + NMApplet * applet; ++#if 0 + GnomeProgram * program; + + program = gnome_program_init ("nm-applet", VERSION, LIBGNOMEUI_MODULE, + argc, argv, + GNOME_PARAM_NONE, GNOME_PARAM_NONE); ++#else ++ gtk_init (&argc, &argv); ++#endif + + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); +@@ -53,7 +59,9 @@ int main (int argc, char *argv[]) + gtk_main (); + + g_object_unref (applet); ++#if 0 + g_object_unref (program); ++#endif + + exit (0); + } +Index: configure.ac +=================================================================== +--- configure.ac.orig 2007-09-26 10:39:30.000000000 +0100 ++++ configure.ac 2007-09-26 10:39:37.000000000 +0100 +@@ -65,8 +65,7 @@ PKG_CHECK_MODULES(NMA, + gtk+-2.0 >= 2.6 + libglade-2.0 + gconf-2.0 +- gnome-keyring-1 +- libgnomeui-2.0]) ++ gnome-keyring-1]) + + ##### Find out the version of DBUS we're using + dbus_version=`pkg-config --modversion dbus-1` diff --git a/recipes/networkmanager/files/avoid_frequent_scan.patch b/recipes/networkmanager/files/avoid_frequent_scan.patch new file mode 100644 index 0000000000..43f84f7674 --- /dev/null +++ b/recipes/networkmanager/files/avoid_frequent_scan.patch @@ -0,0 +1,226 @@ +Index: NetworkManager-0.6.6/src/nm-device-802-11-wireless.c +=================================================================== +--- NetworkManager-0.6.6.orig/src/nm-device-802-11-wireless.c 2008-09-05 15:01:32.000000000 -0300 ++++ NetworkManager-0.6.6/src/nm-device-802-11-wireless.c 2008-09-08 11:37:23.000000000 -0300 +@@ -624,9 +624,12 @@ + NMDevice80211Wireless * self = NM_DEVICE_802_11_WIRELESS (dev); + GSource * source; + guint source_id; ++ NMData * app_data; ++ ++ app_data = nm_device_get_app_data (NM_DEVICE (self)); + + /* Start the scanning timeout for devices that can do scanning */ +- if (nm_device_get_capabilities (dev) & NM_DEVICE_CAP_WIRELESS_SCAN) { ++ if (!app_data->no_scan && nm_device_get_capabilities (dev) & NM_DEVICE_CAP_WIRELESS_SCAN) { + /* Stupid orinoco has problems scanning immediately after being up, + * so wait a bit before triggering a scan. + */ +@@ -1063,9 +1066,14 @@ + NMWirelessScanInterval interval) + { + guint8 seconds = nm_wireless_scan_interval_to_seconds (interval); ++ NMData *app_data; + + g_return_if_fail (self != NULL); + ++ app_data = nm_device_get_app_data (NM_DEVICE (self)); ++ if (app_data->no_scan) ++ return; ++ + self->priv->scan_interval = seconds; + + if (interval == NM_WIRELESS_SCAN_INTERVAL_ACTIVE && !self->priv->scanning) { +@@ -1974,9 +1982,13 @@ + scan_results_timeout (NMDevice80211Wireless *self) + { + GTimeVal cur_time; ++ NMData * app_data; + + g_return_val_if_fail (self != NULL, FALSE); + ++ app_data = nm_device_get_app_data (NM_DEVICE (self)); ++ g_assert (app_data); ++ + request_and_convert_scan_results (self); + + self->priv->scanning = FALSE; +@@ -1984,11 +1996,39 @@ + g_get_current_time (&cur_time); + self->priv->last_scan = cur_time.tv_sec; + +- /* After the first successful scan back down to the ACTIVE scan interval */ +- if (self->priv->scan_interval == nm_wireless_scan_interval_to_seconds (NM_WIRELESS_SCAN_INTERVAL_INIT)) +- nm_device_802_11_wireless_set_scan_interval (self, NM_WIRELESS_SCAN_INTERVAL_ACTIVE); +- else +- schedule_scan (self, 0); ++ if (!app_data->no_scan) ++ { ++ /* After the first successful scan back down to the ACTIVE scan interval */ ++ if (self->priv->scan_interval == nm_wireless_scan_interval_to_seconds (NM_WIRELESS_SCAN_INTERVAL_INIT)) ++ nm_device_802_11_wireless_set_scan_interval (self, NM_WIRELESS_SCAN_INTERVAL_ACTIVE); ++ else ++ schedule_scan (self, 0); ++ } ++ else |
