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
This commit is contained in:
10
ChangeLog
10
ChangeLog
@@ -1,3 +1,13 @@
|
|||||||
|
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>
|
2005-03-29 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* src/NetworkManagerDevice.c
|
* 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)
|
gboolean nm_poll_and_update_wireless_link_state (NMData *data)
|
||||||
{
|
{
|
||||||
|
GSList *elt;
|
||||||
|
|
||||||
g_return_val_if_fail (data != NULL, TRUE);
|
g_return_val_if_fail (data != NULL, TRUE);
|
||||||
|
|
||||||
if ((data->wireless_enabled == FALSE) || (data->asleep == 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.
|
/* Attempt to acquire mutex for device list iteration.
|
||||||
* If the acquire fails, just ignore the device deletion entirely.
|
* 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;
|
nm_warning ("could not acquire device list mutex." );
|
||||||
for (elt = data->dev_list; elt; elt = g_slist_next (elt))
|
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))
|
nm_device_update_link_state (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
|
||||||
/* Is this the currently selected device?
|
* an active link. If it lost the link,
|
||||||
* If so, let's make sure it's still has
|
* find a better access point.
|
||||||
* an active link. If it lost the link,
|
*/
|
||||||
* find a better access point.
|
if ((dev == data->active_device) &&
|
||||||
*/
|
!nm_device_has_active_link (dev))
|
||||||
if ((dev == data->active_device) &&
|
nm_device_update_best_ap (dev);
|
||||||
!nm_device_has_active_link (dev))
|
|
||||||
nm_device_update_best_ap (dev);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
nm_unlock_mutex (data->dev_list_mutex, __FUNCTION__);
|
nm_unlock_mutex (data->dev_list_mutex, __FUNCTION__);
|
||||||
} else nm_warning ("could not acquire device list mutex." );
|
|
||||||
|
|
||||||
return (TRUE);
|
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_get_driver_support_level (dev) != NM_DRIVER_UNSUPPORTED)
|
||||||
{
|
{
|
||||||
if (nm_device_is_wireless (dev))
|
if (nm_device_is_wireless (dev))
|
||||||
{
|
|
||||||
nm_device_update_link_state (dev);
|
nm_device_update_link_state (dev);
|
||||||
nm_device_update_signal_strength (dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
nm_device_update_ip4_address (dev);
|
nm_device_update_ip4_address (dev);
|
||||||
nm_device_update_hw_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:
|
case DEVICE_TYPE_WIRELESS_ETHERNET:
|
||||||
nm_device_set_link_active (dev, nm_device_probe_wireless_link_state (dev));
|
nm_device_set_link_active (dev, nm_device_probe_wireless_link_state (dev));
|
||||||
|
nm_device_update_signal_strength (dev);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_TYPE_WIRED_ETHERNET:
|
case DEVICE_TYPE_WIRED_ETHERNET:
|
||||||
|
Reference in New Issue
Block a user