diff --git a/ChangeLog b/ChangeLog index 41b069a496..f2cc69b5c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-10-21 Dan Williams + + * src/NetworkManagerDevice.c + - Don't try to activate/bring up/down unsupported + devices + + * src/NetworkManagerUtils.c + - Fix case of PCI ID checks for driver support levels + 2004-10-21 Dan Williams * NetworkManager.h diff --git a/src/NetworkManagerDevice.c b/src/NetworkManagerDevice.c index 3230bfdcc0..3c81400387 100644 --- a/src/NetworkManagerDevice.c +++ b/src/NetworkManagerDevice.c @@ -348,13 +348,16 @@ NMDevice *nm_device_new (const char *iface, const char *udi, gboolean test_dev, dev->driver_support_level = nm_get_driver_support_level (dev->app_data->hal_ctx, dev); - /* Grab IP config data for this device from the system configuration files */ - nm_device_update_ip4_address (dev); - nm_system_device_update_config_info (dev); + if (nm_device_get_driver_support_level (dev) != NM_DRIVER_UNSUPPORTED) + { + /* Grab IP config data for this device from the system configuration files */ + nm_device_update_ip4_address (dev); + nm_system_device_update_config_info (dev); - /* Have to bring the device up before checking link status. */ - nm_device_bring_up (dev); - nm_device_update_link_active (dev, TRUE); + /* Have to bring the device up before checking link status. */ + nm_device_bring_up (dev); + nm_device_update_link_active (dev, TRUE); + } return (dev); } @@ -1047,6 +1050,9 @@ static void nm_device_set_up_down (NMDevice *dev, gboolean up) return; } + if (nm_device_get_driver_support_level (dev) == NM_DRIVER_UNSUPPORTED) + return; + iface_fd = nm_get_network_control_socket (); if (iface_fd < 0) return; @@ -1211,6 +1217,12 @@ gboolean nm_device_activation_begin (NMDevice *dev) return (TRUE); } + if (nm_device_get_driver_support_level (dev) == NM_DRIVER_UNSUPPORTED) + { + dev->activating = FALSE; + return (FALSE); + } + /* Reset communication flags between worker and main thread */ dev->activating = TRUE; dev->just_activated = FALSE; @@ -1638,6 +1650,9 @@ gboolean nm_device_deactivate (NMDevice *dev, gboolean just_added) nm_device_activation_cancel (dev); + if (nm_device_get_driver_support_level (dev) == NM_DRIVER_UNSUPPORTED) + return (TRUE); + /* Take out any entries in the routing table and any IP address the old device had. */ nm_system_device_flush_routes (dev); nm_system_device_flush_addresses (dev); diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c index d57ca6b272..ef7991d7c0 100644 --- a/src/NetworkManagerUtils.c +++ b/src/NetworkManagerUtils.c @@ -284,7 +284,7 @@ char *nm_get_device_driver_name (LibHalContext *ctx, NMDevice *dev) char buf[200]; char id[9]; - snprintf (&id[0], 9, "%4X%4X", vendor, product); + snprintf (&id[0], 9, "%4x%4x", vendor, product); id[8] = '\0'; while (fgets (&buf[0], 200, f) && !feof (f)) {