Commit d00e9981 authored by Dan Williams's avatar Dan Williams
Browse files

2005-02-10 Dan Williams <dcbw@redhat.com>

	* src/NetworkManager.c
		- (nm_create_device_and_add_to_list): change the add message slightly

	* src/NetworkManagerUtils.c
		- (nm_get_wireless_driver_support_level, nm_get_wired_driver_support_level):
			Return driver name to calling function
		- (nm_get_driver_support_level): print out the driver a device is using
			during the support check

	Patch from Dave Woodhouse:
	* dhcpcd/udpipgen.c
		- (in_cksum): copy last byte of odd-sized packets into a
			'u_short' rather than a 'u_char', should fix wrong checksums
			on big-endian platforms


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@427 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
parent 2fa2299b
2005-02-10 Dan Williams <dcbw@redhat.com>
* src/NetworkManager.c
- (nm_create_device_and_add_to_list): change the add message slightly
* src/NetworkManagerUtils.c
- (nm_get_wireless_driver_support_level, nm_get_wired_driver_support_level):
Return driver name to calling function
- (nm_get_driver_support_level): print out the driver a device is using
during the support check
Patch from Dave Woodhouse:
* dhcpcd/udpipgen.c
- (in_cksum): copy last byte of odd-sized packets into a
'u_short' rather than a 'u_char', should fix wrong checksums
on big-endian platforms
2005-02-09 Dan Williams <dcbw@redhat.com>
* Clean up usage of GSList objects and looping through their members
......
......@@ -36,7 +36,7 @@ unsigned short in_cksum(unsigned short *addr, int len)
}
if ( nleft == 1 )
{
u_char a = 0;
u_short a = 0;
memcpy(&a,w,1);
sum += a;
}
......
......@@ -125,8 +125,8 @@ NMDevice * nm_create_device_and_add_to_list (NMData *data, const char *udi, cons
*/
if (nm_try_acquire_mutex (data->dev_list_mutex, __FUNCTION__))
{
syslog (LOG_INFO, "Adding device '%s' (%s) to our list.",
nm_device_get_iface (dev), nm_device_is_wireless (dev) ? "wireless" : "wired");
syslog (LOG_INFO, "Now managing %s device '%s'.",
nm_device_is_wireless (dev) ? "wireless" : "wired", nm_device_get_iface (dev));
data->dev_list = g_slist_append (data->dev_list, dev);
nm_device_deactivate (dev, TRUE);
......
......@@ -303,26 +303,28 @@ char *nm_get_device_driver_name (LibHalContext *ctx, NMDevice *dev)
* Blacklist certain wireless devices.
*
*/
NMDriverSupportLevel nm_get_wireless_driver_support_level (LibHalContext *ctx, NMDevice *dev)
NMDriverSupportLevel nm_get_wireless_driver_support_level (LibHalContext *ctx, NMDevice *dev, char **driver)
{
NMDriverSupportLevel level = NM_DRIVER_FULLY_SUPPORTED;
char *driver_name = NULL;
g_return_val_if_fail (ctx != NULL, FALSE);
g_return_val_if_fail (dev != NULL, FALSE);
g_return_val_if_fail (ctx != NULL, NM_DRIVER_UNSUPPORTED);
g_return_val_if_fail (dev != NULL, NM_DRIVER_UNSUPPORTED);
g_return_val_if_fail (driver != NULL, NM_DRIVER_UNSUPPORTED);
g_return_val_if_fail (*driver == NULL, NM_DRIVER_UNSUPPORTED);
if ((driver_name = nm_get_device_driver_name (ctx, dev)))
{
driver_support *driver = &wireless_driver_blacklist[0];
while (driver->name != NULL)
driver_support *drv;
for (drv = &wireless_driver_blacklist[0]; drv->name; drv++)
{
if (!strcmp (driver->name, driver_name))
if (!strcmp (drv->name, driver_name))
{
level = driver->level;
level = drv->level;
break;
}
driver++;
}
*driver = g_strdup (driver_name);
g_free (driver_name);
}
......@@ -336,28 +338,30 @@ NMDriverSupportLevel nm_get_wireless_driver_support_level (LibHalContext *ctx, N
* Blacklist certain devices.
*
*/
NMDriverSupportLevel nm_get_wired_driver_support_level (LibHalContext *ctx, NMDevice *dev)
NMDriverSupportLevel nm_get_wired_driver_support_level (LibHalContext *ctx, NMDevice *dev, char **driver)
{
NMDriverSupportLevel level = NM_DRIVER_FULLY_SUPPORTED;
char *driver_name = NULL;
char *usb_test;
char *udi;
g_return_val_if_fail (ctx != NULL, FALSE);
g_return_val_if_fail (dev != NULL, FALSE);
g_return_val_if_fail (ctx != NULL, NM_DRIVER_UNSUPPORTED);
g_return_val_if_fail (dev != NULL, NM_DRIVER_UNSUPPORTED);
g_return_val_if_fail (driver != NULL, NM_DRIVER_UNSUPPORTED);
g_return_val_if_fail (*driver == NULL, NM_DRIVER_UNSUPPORTED);
if ((driver_name = nm_get_device_driver_name (ctx, dev)))
{
driver_support *driver = &wired_driver_blacklist[0];
while (driver->name != NULL)
driver_support *drv;
for (drv = &wired_driver_blacklist[0]; drv->name; drv++)
{
if (!strcmp (driver->name, driver_name))
if (!strcmp (drv->name, driver_name))
{
level = driver->level;
level = drv->level;
break;
}
driver++;
}
*driver = g_strdup (driver_name);
g_free (driver_name);
}
......@@ -386,28 +390,33 @@ NMDriverSupportLevel nm_get_wired_driver_support_level (LibHalContext *ctx, NMDe
*/
NMDriverSupportLevel nm_get_driver_support_level (LibHalContext *ctx, NMDevice *dev)
{
NMDriverSupportLevel level = NM_DRIVER_UNSUPPORTED;
char *driver = NULL;
NMDriverSupportLevel level = NM_DRIVER_UNSUPPORTED;
g_return_val_if_fail (ctx != NULL, NM_DRIVER_UNSUPPORTED);
g_return_val_if_fail (dev != NULL, NM_DRIVER_UNSUPPORTED);
if (nm_device_is_wireless (dev))
level = nm_get_wireless_driver_support_level (ctx, dev);
level = nm_get_wireless_driver_support_level (ctx, dev, &driver);
else if (nm_device_is_wired (dev))
level = nm_get_wired_driver_support_level (ctx, dev);
level = nm_get_wired_driver_support_level (ctx, dev, &driver);
switch (level)
{
case NM_DRIVER_SEMI_SUPPORTED:
syslog (LOG_INFO, "%s: Driver support level is semi-supported", nm_device_get_iface (dev));
syslog (LOG_INFO, "%s: Driver support level for '%s' is semi-supported",
nm_device_get_iface (dev), driver);
break;
case NM_DRIVER_FULLY_SUPPORTED:
syslog (LOG_INFO, "%s: Driver support level is fully-supported", nm_device_get_iface (dev));
syslog (LOG_INFO, "%s: Driver support level for '%s' is fully-supported",
nm_device_get_iface (dev), driver);
break;
default:
syslog (LOG_INFO, "%s: Driver support level is unsupported", nm_device_get_iface (dev));
syslog (LOG_INFO, "%s: Driver support level for '%s' is unsupported",
nm_device_get_iface (dev), driver);
break;
}
g_free (driver);
return (level);
}
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