summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2005-04-04 16:22:03 +0000
committerDan Williams <dcbw@redhat.com>2005-04-04 16:22:03 +0000
commit737dce1fd7795fd7f98cd8284af6ccf3382e96c6 (patch)
treea8f5e505ce7cec081f3e10ebee7db9caedcdb1ec
parent402c5586122489effb2f9a336fc52b4baa7dab0b (diff)
downloadNetworkManager-737dce1fd7795fd7f98cd8284af6ccf3382e96c6.tar.gz
2005-04-01 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerDevice.c: - (nm_completion_scan_has_results): restore pre-completion-patch behavior of only erroring after the second consecutive scan times out. Also don't exit when the card requires more time than we can give it, just log the event and continue. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@552 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
-rw-r--r--ChangeLog8
-rw-r--r--src/NetworkManagerDevice.c22
2 files changed, 25 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4e0e1ca425..38ff03309a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-04-01 Dan Williams <dcbw@redhat.com>
+
+ * src/NetworkManagerDevice.c:
+ - (nm_completion_scan_has_results): restore pre-completion-patch behavior
+ of only erroring after the second consecutive scan times out. Also
+ don't exit when the card requires more time than we can give it, just
+ log the event and continue.
+
2005-04-01 Steve Murphy <murf@e-tools.com>
* configure.in: Added "rw" to ALL_LINGUAS.
diff --git a/src/NetworkManagerDevice.c b/src/NetworkManagerDevice.c
index 91a51b2e64..2341fab55e 100644
--- a/src/NetworkManagerDevice.c
+++ b/src/NetworkManagerDevice.c
@@ -3690,14 +3690,26 @@ static gboolean nm_completion_scan_has_results (int tries, va_list args)
g_return_val_if_fail (scan_results != NULL, TRUE);
rc = iw_scan(sk, (char *)nm_device_get_iface (dev), WIRELESS_EXT, &(scan_results->scan_head));
+ *err = FALSE;
if (rc == -1 && errno == ETIME)
{
- nm_error ("Warning: the wireless card (%s) requires too much time for scans. Its driver needs to be fixed.", nm_device_get_iface (dev));
- scan_results->scan_head.result = NULL;
- *err = TRUE;
- return TRUE;
+ /* Scans take time. iw_scan's timeout is 15 seconds, so if the card hasn't returned
+ * scan results after two consecutive runs of iw_scan(), the card sucks.
+ */
+ if (tries >= 1)
+ {
+ nm_warning ("Warning: the wireless card (%s) requires too much time for scans. Its driver needs to be fixed.", nm_device_get_iface (dev));
+ scan_results->scan_head.result = NULL;
+ *err = TRUE;
+ return TRUE;
+ }
+ else
+ {
+ /* Give the card one more chance to return scan results */
+ scan_results->scan_head.result = NULL;
+ return FALSE;
+ }
}
- *err = FALSE;
if ((rc == -1 && errno == ENODATA) || (rc == 0 && scan_results->scan_head.result == NULL))
{
/* Card hasn't had time yet to compile full access point list.