mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 04:24:32 +00:00
2008-10-27 Tambet Ingo <tambet@gmail.com>
* src/nm-device-ethernet.c (nm_device_ethernet_get_speed): Implement correct speed reporting for fast devices (kernel >= 2.6.27). git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4226 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
9702d72d8d
commit
efdf6bab77
|
@ -1,3 +1,8 @@
|
||||||
|
2008-10-27 Tambet Ingo <tambet@gmail.com>
|
||||||
|
|
||||||
|
* src/nm-device-ethernet.c (nm_device_ethernet_get_speed): Implement
|
||||||
|
correct speed reporting for fast devices (kernel >= 2.6.27).
|
||||||
|
|
||||||
2008-10-26 Dan Williams <dcbw@redhat.com>
|
2008-10-26 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
Attempt to compensate for modems that don't enable full AT parsing before
|
Attempt to compensate for modems that don't enable full AT parsing before
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
|
#include <linux/version.h>
|
||||||
#include <linux/ethtool.h>
|
#include <linux/ethtool.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -453,7 +454,14 @@ nm_device_ethernet_get_speed (NMDeviceEthernet *self)
|
||||||
if (ioctl (fd, SIOCETHTOOL, &ifr) == -1)
|
if (ioctl (fd, SIOCETHTOOL, &ifr) == -1)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
speed = edata.speed != G_MAXUINT16 ? edata.speed : 0;
|
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
|
||||||
|
speed = edata.speed;
|
||||||
|
#else
|
||||||
|
speed = ethtool_cmd_speed (&edata);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (speed == G_MAXUINT16 || speed == G_MAXUINT32)
|
||||||
|
speed = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
close (fd);
|
close (fd);
|
||||||
|
|
Loading…
Reference in a new issue