ethtool.h and mii.h (included in the new nm-device-802-3-ethernet.c)
define a bunch of structures with the kernel-internal u16, u32, etc.
types.
This basically means they don't work without defining these types.
Kernel headers are not supposed to leak these types to user-space,
polluting the name space, but instead use __u16, __u32, etc.
Dan, does Red Hat patch these files? If has __u32
instead of u32, then you do.
Patching these files is the right solution. I sent the attached two
patches upstream and they should go in the next kernel release. Then,
once glibc repopulates its headers from the kernel, everyone will be all
right. In the interim, distros can add these patches to their glibc
packages, if they are not doing so already.
As a temp hack, the attached patch against NM makes everything work by
defining the new types. Hacky, but it builds.
Just an FYI.
Robert Love
Index: src/nm-device-802-3-ethernet.h
===
RCS file: /cvs/gnome/NetworkManager/src/nm-device-802-3-ethernet.h,v
retrieving revision 1.1
diff -u -r1.1 nm-device-802-3-ethernet.h
--- src/nm-device-802-3-ethernet.h 31 Dec 2005 08:21:23 - 1.1
+++ src/nm-device-802-3-ethernet.h 4 Jan 2006 15:24:59 -
@@ -29,6 +29,12 @@
#include "nm-device.h"
+/* define the kernel types until mii.h and ethtool.h are fixed */
+#define u64 __u64
+#define u32 __u32
+#define u16 __u16
+#define u8 __u8
+
G_BEGIN_DECLS
#define NM_TYPE_DEVICE_802_3_ETHERNET (nm_device_802_3_ethernet_get_type ())
don't leak the kernel uX types to user-space, use __uX in lieu
include/linux/ethtool.h | 228
1 files changed, 114 insertions(+), 114 deletions(-)
diff -urN linux-2.6.15/include/linux/ethtool.h linux/include/linux/ethtool.h
--- linux-2.6.15/include/linux/ethtool.h 2006-01-02 22:21:10.0 -0500
+++ linux/include/linux/ethtool.h 2006-01-03 15:46:38.0 -0500
@@ -15,24 +15,24 @@
/* This should work for both 32 and 64 bit userland. */
struct ethtool_cmd {
- u32 cmd;
- u32 supported; /* Features this interface supports */
- u32 advertising; /* Features this interface advertises */
- u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
- u8 duplex; /* Duplex, half or full */
- u8 port; /* Which connector port */
- u8 phy_address;
- u8 transceiver; /* Which transceiver to use */
- u8 autoneg; /* Enable or disable autonegotiation */
- u32 maxtxpkt; /* Tx pkts before generating tx int */
- u32 maxrxpkt; /* Rx pkts before generating rx int */
- u32 reserved[4];
+ __u32 cmd;
+ __u32 supported; /* Features this interface supports */
+ __u32 advertising; /* Features this interface advertises */
+ __u16 speed; /* The forced speed, 10Mb, 100Mb, gigabit */
+ __u8 duplex; /* Duplex, half or full */
+ __u8 port; /* Which connector port */
+ __u8 phy_address;
+ __u8 transceiver; /* Which transceiver to use */
+ __u8 autoneg; /* Enable or disable autonegotiation */
+ __u32 maxtxpkt; /* Tx pkts before generating tx int */
+ __u32 maxrxpkt; /* Rx pkts before generating rx int */
+ __u32 reserved[4];
};
#define ETHTOOL_BUSINFO_LEN 32
/* these strings are set to whatever the driver author decides... */
struct ethtool_drvinfo {
- u32 cmd;
+ __u32 cmd;
char driver[32]; /* driver short name, "tulip", "eepro100" */
char version[32]; /* driver version string */
char fw_version[32]; /* firmware version string, if applicable */
@@ -40,53 +40,53 @@
/* For PCI devices, use pci_name(pci_dev). */
char reserved1[32];
char reserved2[16];
- u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */
- u32 testinfo_len;
- u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
- u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
+ __u32 n_stats; /* number of __u64's from ETHTOOL_GSTATS */
+ __u32 testinfo_len;
+ __u32 eedump_len; /* Size of data from ETHTOOL_GEEPROM (bytes) */
+ __u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
};
#define SOPASS_MAX 6
/* wake-on-lan settings */
struct ethtool_wolinfo {
- u32 cmd;
- u32 supported;
- u32 wolopts;
- u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
+ __u32 cmd;
+ __u32 supported;
+ __u32 wolopts;
+ __u8 sopass[SOPASS_MAX]; /* SecureOn(tm) password */
};
/* for passing single values */
struct ethtool_value {
- u32 cmd;
- u32 data;
+ __u32 cmd;
+ __u32 data;
};
/* for passing big chunks of data */
struct ethtool_regs {
- u32 cmd;
- u32 version; /* driver-specific, indicates different chips/revs */
- u32 len; /* bytes */
- u8 data[0];
+ __u32 cmd;
+ __u32 version; /* driver-specific, indicates different chips/revs */
+ __u32 len; /* bytes */
+ __u8 data[0];
};
/* for passing EEPROM chunks */
struct ethtool_eeprom {
- u32 cmd;
- u32 magic;
- u32 offset; /* in bytes */
- u32 len; /* in bytes */
- u8 data[0];
+ __u32 cmd;
+ __u32 magic;
+ __u32 offset; /* in bytes */
+ __u32 len; /* in bytes */
+ __u8 data[0];
};
/* for