2004-09-11 Dan Williams <dcbw@redhat.com>

* panel-applet/NMWirelessApplet.c
	  panel-applet/NMWirelessAppletDbus.c
		- Start using NetworkDevice/WirelessNetwork structures in more places
		- Update for unified device/network forcing in NetworkManager

	* src/NetworkManager.c
		- some code consolidation

	* src/NetworkManagerDbus.c
		- (nm_dbus_nm_set_active_device): "setActiveDevice" now takes either one
			or two arguments:  the first is the NM ID of the device to switch to,
			and the second (optional) argument is the ESSID of a wireless network
			to use as well.
		- Get rid of "setNetwork" method due to above change

	* src/NetworkManagerDevice.c
		- (nm_device_new): perform scan and update best AP on device creation
		- nm_device_activation_cancel_if_needed()->nm_device_activation_should_cancel()
		- nm_device_activation_signal_cancel()->nm_device_activation_cancel(), and
			spin waiting for cancellation to finish before returning

	* src/NetworkManagerPolicy.c
		- Changes here clarify the situations in which a device switch occurs, and
			make sure to keep using a forced device and network if the user gives
			us one
		- Remove old unused code


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@149 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2004-09-12 03:06:44 +00:00
parent f439ef259d
commit ae080994c7
10 changed files with 273 additions and 349 deletions

View File

@@ -176,7 +176,7 @@ void nm_remove_device_from_list (NMData *data, const char *udi)
data->user_device = NULL;
}
nm_device_activation_signal_cancel (dev);
nm_device_activation_cancel (dev);
nm_device_unref (dev);
/* Remove the device entry from the device list and free its data */
@@ -353,36 +353,20 @@ gboolean nm_link_state_monitor (gpointer user_data)
if (dev)
{
/* Wired cards are always up and active, because otherwise we cannot do
* link detection on them. A wireless card is only up if it's the active
* device, since we only do scanning and link detection on the active device
* anyway.
*/
switch (nm_device_get_type (dev))
{
case DEVICE_TYPE_WIRELESS_ETHERNET:
nm_device_update_link_active (dev, FALSE);
if ((dev == data->active_device) && !nm_device_get_link_active (dev))
{
/* If we loose a link to the access point, then
* look for another access point to connect to.
*/
nm_device_update_best_ap (dev);
}
break;
case DEVICE_TYPE_WIRED_ETHERNET:
if (!nm_device_is_up (dev))
nm_device_bring_up (dev);
nm_device_update_link_active (dev, FALSE);
break;
default:
break;
}
if (!nm_device_is_up (dev))
nm_device_bring_up (dev);
nm_device_update_link_active (dev, FALSE);
if (dev == data->active_device)
{
if (nm_device_is_wireless (dev) && !nm_device_get_link_active (dev))
{
/* If we loose a link to the access point, then
* look for another access point to connect to.
*/
nm_device_update_best_ap (dev);
}
/* Check if the device's IP address has changed
* (ie dhcp lease renew/address change)
*/