2007-03-12 Dan Williams <dcbw@redhat.com>

Get rid of 2 second poll of sysfs 'carrier' file for wired devices.  Useless
	for non-carrier-detect capable devices, and useless for carrier-detect
	devices since we get notifications from netlink about carrier status anyway.

	* src/nm-device-802-3-ethernet.c
		- remove 'link_source_id' member from private data
		- (probe_link): remove and collapse into real_update_link()
		- (nm_device_802_3_periodic_update): remove
		- (real_is_up): check for sup_iface rather than link_source_id
		- (real_bring_up): return gboolean for success/fail; require that
			sup_iface be valid for device bringup to succeed
		- (real_bring_down): zero out link signal ids

	* src/nm-device.c
		- (nm_device_activate_stage2_device_config): fail activation if device
			bringup fails
		- (real_act_stage4_get_ip4_config): fail activation if device bringup
			fails
		- (nm_device_bring_up): return success/fail

	* src/nm-device.h
		- bring_up now returns success/fail

	* src/nm-device-802-11-wireless.c
		- (real_bring_up): return success from bringup



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2464 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams
2007-03-12 04:49:29 +00:00
parent d4fb095dd7
commit 06d43d3a62
5 changed files with 106 additions and 78 deletions

View File

@@ -487,7 +487,10 @@ nm_device_activate_stage2_device_config (gpointer user_data)
nm_info ("Activation (%s) Stage 2 of 5 (Device Configure) starting...", iface);
nm_device_state_changed (self, NM_DEVICE_STATE_CONFIG);
nm_device_bring_up (self, FALSE);
if (!nm_device_bring_up (self, FALSE)) {
nm_device_state_changed (self, NM_DEVICE_STATE_FAILED);
goto out;
}
ret = NM_DEVICE_GET_CLASS (self)->act_stage2_config (self, req);
if (ret == NM_ACT_STAGE_RETURN_POSTPONE)
@@ -698,7 +701,8 @@ real_act_stage4_get_ip4_config (NMDevice *self,
else
{
/* Make sure device is up even if config fails */
nm_device_bring_up (self, FALSE);
if (!nm_device_bring_up (self, FALSE))
ret = NM_ACT_STAGE_RETURN_FAILURE;
}
return ret;
@@ -1276,13 +1280,15 @@ nm_completion_device_is_up_test (int tries,
return FALSE;
}
void
gboolean
nm_device_bring_up (NMDevice *self, gboolean wait)
{
g_return_if_fail (NM_IS_DEVICE (self));
gboolean success;
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
if (nm_device_is_up (self))
return;
return TRUE;
nm_info ("Bringing up device %s", nm_device_get_iface (self));
@@ -1290,8 +1296,11 @@ nm_device_bring_up (NMDevice *self, gboolean wait)
nm_device_update_ip4_address (self);
nm_device_set_address (self);
if (NM_DEVICE_GET_CLASS (self)->bring_up)
NM_DEVICE_GET_CLASS (self)->bring_up (self);
if (NM_DEVICE_GET_CLASS (self)->bring_up) {
success = NM_DEVICE_GET_CLASS (self)->bring_up (self);
if (!success)
return FALSE;
}
if (wait) {
nm_completion_args args;
@@ -1301,6 +1310,8 @@ nm_device_bring_up (NMDevice *self, gboolean wait)
}
nm_device_state_changed (self, NM_DEVICE_STATE_DISCONNECTED);
return TRUE;
}
void