Commit 66039f43 authored by Dan Williams's avatar Dan Williams
Browse files

2005-03-29 Dan Williams <dcbw@redhat.com>

	* src/NetworkManager.c
		- (nm_poll_and_update_wireless_link_state): make code less indented

	Patch from Bill Moss:
	* src/NetworkManager.c
		- (nm_device_update_link_state): Update signal strength on wireless
			devices every time we update link state too.


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@531 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 17fd25cc
2005-03-29 Dan Williams <dcbw@redhat.com>
* src/NetworkManager.c
- (nm_poll_and_update_wireless_link_state): make code less indented
Patch from Bill Moss:
* src/NetworkManager.c
- (nm_device_update_link_state): Update signal strength on wireless
devices every time we update link state too.
2005-03-29 Dan Williams <dcbw@redhat.com>
* src/NetworkManagerDevice.c
......
......@@ -375,6 +375,8 @@ void nm_schedule_status_signal_broadcast (NMData *data)
*/
gboolean nm_poll_and_update_wireless_link_state (NMData *data)
{
GSList *elt;
g_return_val_if_fail (data != NULL, TRUE);
if ((data->wireless_enabled == FALSE) || (data->asleep == TRUE))
......@@ -383,33 +385,34 @@ gboolean nm_poll_and_update_wireless_link_state (NMData *data)
/* Attempt to acquire mutex for device list iteration.
* If the acquire fails, just ignore the device deletion entirely.
*/
if (nm_try_acquire_mutex (data->dev_list_mutex, __FUNCTION__))
if (!nm_try_acquire_mutex (data->dev_list_mutex, __FUNCTION__))
{
GSList *elt;
for (elt = data->dev_list; elt; elt = g_slist_next (elt))
nm_warning ("could not acquire device list mutex." );
return TRUE;
}
for (elt = data->dev_list; elt; elt = g_slist_next (elt))
{
NMDevice *dev = (NMDevice *)(elt->data);
if (dev && nm_device_is_wireless (dev))
{
NMDevice *dev = (NMDevice *)(elt->data);
if (!nm_device_is_up (dev))
nm_device_bring_up (dev);
if (dev && nm_device_is_wireless (dev))
{
if (!nm_device_is_up (dev))
nm_device_bring_up (dev);
nm_device_update_link_state (dev);
/* Is this the currently selected device?
* If so, let's make sure it's still has
* an active link. If it lost the link,
* find a better access point.
*/
if ((dev == data->active_device) &&
!nm_device_has_active_link (dev))
nm_device_update_best_ap (dev);
}
}
nm_device_update_link_state (dev);
nm_unlock_mutex (data->dev_list_mutex, __FUNCTION__);
} else nm_warning ("could not acquire device list mutex." );
/* Is this the currently selected device?
* If so, let's make sure it's still has
* an active link. If it lost the link,
* find a better access point.
*/
if ((dev == data->active_device) &&
!nm_device_has_active_link (dev))
nm_device_update_best_ap (dev);
}
}
nm_unlock_mutex (data->dev_list_mutex, __FUNCTION__);
return (TRUE);
}
......
......@@ -312,10 +312,7 @@ NMDevice *nm_device_new (const char *iface, const char *udi, gboolean test_dev,
if (nm_device_get_driver_support_level (dev) != NM_DRIVER_UNSUPPORTED)
{
if (nm_device_is_wireless (dev))
{
nm_device_update_link_state (dev);
nm_device_update_signal_strength (dev);
}
nm_device_update_ip4_address (dev);
nm_device_update_hw_address (dev);
......@@ -835,6 +832,7 @@ void nm_device_update_link_state (NMDevice *dev)
{
case DEVICE_TYPE_WIRELESS_ETHERNET:
nm_device_set_link_active (dev, nm_device_probe_wireless_link_state (dev));
nm_device_update_signal_strength (dev);
break;
case DEVICE_TYPE_WIRED_ETHERNET:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment