From b8f2200c7ff9cccb87ae0af88db3fb394e422d1f Mon Sep 17 00:00:00 2001 From: Robert Love Date: Thu, 2 Mar 2006 19:19:27 +0000 Subject: [PATCH] 2006-03-02 Robert Love Commit Dan's update of my previous commit: * src/nm-device-802-11-wireless.c: Always set the mode, because the set_mode() function itself does the check. But do only set the frequency if in Ad-Hoc mode. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@1537 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 14 +++++++++++--- src/nm-device-802-11-wireless.c | 13 +++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0b9c799ce..c5da16ed5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,17 @@ +2006-03-02 Robert Love + + Commit Dan's update of my previous commit: + * src/nm-device-802-11-wireless.c: Always set the mode, because the + set_mode() function itself does the check. But do only set the + frequency if in Ad-Hoc mode. + 2006-03-02 Robert Love Patch by Brian Magnuson : - * src/nm-device-802-11-wireless.c: During scanning, only set the wireless - mode to infrastructure if it is not currently in infrastructure mode. - For some driver, setting the mode is a costly operation, apparently. + * src/nm-device-802-11-wireless.c: During scanning, only set the + wireless mode to infrastructure if it is not currently in + infrastructure mode. For some driver, setting the mode is a costly + operation, apparently. 2006-03-01 Rodrigo Moya diff --git a/src/nm-device-802-11-wireless.c b/src/nm-device-802-11-wireless.c index b63460cf9b..ec0db79d85 100644 --- a/src/nm-device-802-11-wireless.c +++ b/src/nm-device-802-11-wireless.c @@ -1825,13 +1825,14 @@ nm_device_802_11_wireless_scan (gpointer user_data) /* Must be in infrastructure mode during scan, otherwise we don't get a full * list of scan results. Scanning doesn't work well in Ad-Hoc mode :( - * - * We only set the mode if it needs setting, in case it is a costly operation - * for the driver. */ - if (orig_mode != IW_MODE_INFRA) - nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA); - nm_device_802_11_wireless_set_frequency (self, 0); + nm_device_802_11_wireless_set_mode (self, IW_MODE_INFRA); + + /* We only unlock the frequency if the card is in adhoc mode, in case it is + * a costly operation for the driver. + */ + if (orig_mode == IW_MODE_ADHOC) + nm_device_802_11_wireless_set_frequency (self, 0); wrq.u.data.pointer = NULL; wrq.u.data.flags = 0;