<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>132332</bug_id>
          
          <creation_ts>2006-05-05 04:55 0000</creation_ts>
          <short_desc>sys-kernel/linux-headers - ethtool.h broken (typedef u32)</short_desc>
          <delta_ts>2006-07-28 14:32:47 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Core system</component>
          <version>2006.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P4</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>dick@mrns.nl</reporter>
          <assigned_to>plasmaroo@gentoo.org</assigned_to>
          <cc>kernel@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>dick@mrns.nl</who>
            <bug_when>2006-05-05 04:55:25 0000</bug_when>
            <thetext>$ echo &quot;#include &lt;linux/ethtool.h&gt;&quot; &gt; test.c

$ gcc -c test.c
In file included from test.c:1:
/usr/include/linux/ethtool.h:330: error: syntax error before &quot;u32&quot;
/usr/include/linux/ethtool.h:343: error: syntax error before &quot;u32&quot;
/usr/include/linux/ethtool.h:345: error: syntax error before &quot;u32&quot;
/usr/include/linux/ethtool.h:347: error: syntax error before &quot;u32&quot;
/usr/include/linux/ethtool.h:349: error: syntax error before &quot;u32&quot;
/usr/include/linux/ethtool.h:353: error: syntax error before &quot;u32&quot;

I&apos;ve rsync-ed and re-emerged sys-kernel/linux-headers-2.6.11-r5 today. Replacing the broken u32 to __u32 seems to fix these issues. I&apos;m running ~x86.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dick@mrns.nl</who>
            <bug_when>2006-05-05 08:25:17 0000</bug_when>
            <thetext>maybe:
sed &apos;s/\(__\)\?\([us]\(8\|16\|32\|64\)\)/__\2/g&apos; 

would fix the problem?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dick@mrns.nl</who>
            <bug_when>2006-05-05 09:25:32 0000</bug_when>
            <thetext>Created an attachment (id=86205)
kernel-2.eclass.patch

diff -ud orig/linux/ethtool.h linux/ethtool.h
--- orig/linux/ethtool.h        2006-05-05 17:04:26.000000000 +0200
+++ linux/ethtool.h     2006-05-05 17:31:20.000000000 +0200
@@ -42,7 +42,7 @@
                                /* For PCI devices, use pci_name(pci_dev). */
        char    reserved1[32];
        char    reserved2[16];
-       __u32   n_stats;        /* number of u64&apos;s from ETHTOOL_GSTATS */
+       __u32   n_stats;        /* number of __u64&apos;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) */
@@ -248,7 +248,7 @@
 /* for dumping NIC-specific statistics */
 struct ethtool_stats {
        __u32   cmd;            /* ETHTOOL_GSTATS */
-       __u32   n_stats;        /* number of u64&apos;s being returned */
+       __u32   n_stats;        /* number of __u64&apos;s being returned */
        __u64   data[0];
 };

@@ -327,7 +327,7 @@
        void    (*get_wol)(struct net_device *, struct ethtool_wolinfo *);
        int     (*set_wol)(struct net_device *, struct ethtool_wolinfo *);
        __u32   (*get_msglevel)(struct net_device *);
-       void    (*set_msglevel)(struct net_device *, u32);
+       void    (*set_msglevel)(struct net_device *, __u32);
        int     (*nway_reset)(struct net_device *);
        __u32   (*get_link)(struct net_device *);
        int     (*get_eeprom_len)(struct net_device *);
@@ -340,17 +340,17 @@
        void    (*get_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
        int     (*set_pauseparam)(struct net_device *, struct ethtool_pauseparam*);
        __u32   (*get_rx_csum)(struct net_device *);
-       int     (*set_rx_csum)(struct net_device *, u32);
+       int     (*set_rx_csum)(struct net_device *, __u32);
        __u32   (*get_tx_csum)(struct net_device *);
-       int     (*set_tx_csum)(struct net_device *, u32);
+       int     (*set_tx_csum)(struct net_device *, __u32);
        __u32   (*get_sg)(struct net_device *);
-       int     (*set_sg)(struct net_device *, u32);
+       int     (*set_sg)(struct net_device *, __u32);
        __u32   (*get_tso)(struct net_device *);
-       int     (*set_tso)(struct net_device *, u32);
+       int     (*set_tso)(struct net_device *, __u32);
        int     (*self_test_count)(struct net_device *);
        void    (*self_test)(struct net_device *, struct ethtool_test *, __u64 *);
        void    (*get_strings)(struct net_device *, __u32 stringset, __u8 *);
-       int     (*phys_id)(struct net_device *, u32);
+       int     (*phys_id)(struct net_device *, __u32);
        int     (*get_stats_count)(struct net_device *);
        void    (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, __u64 *);
        int     (*begin)(struct net_device *);</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dick@mrns.nl</who>
            <bug_when>2006-05-06 02:37:19 0000</bug_when>
            <thetext>Created an attachment (id=86243)
kernel-2.eclass.patch

symbols like __fs16 are safe now.

Please note sys-kernel/linux-headers-2.6.16 needs to be instructed to ignore asm/types.h.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plasmaroo@gentoo.org</who>
            <bug_when>2006-05-06 06:43:06 0000</bug_when>
            <thetext>&apos;s:\&lt;\([us]\(8\|16\|32\|64\)\)\&gt;:__\1:g&apos;

^^ Want to just try that instead? I&apos;m not sure where the fsXX types are used (and if types.h defines those I doubt they&apos;d conflict in userspace anyway).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dick@mrns.nl</who>
            <bug_when>2006-05-06 08:29:00 0000</bug_when>
            <thetext>word match, smart! ethtool.h seems to be fixed correctly.

you are right about asm/types.h which doesn&apos;t break userspace but the kernel-2.eclass seems to run &apos;make oldconfig&apos; which defines __KERNEL__.

There are more headers broken, I&apos;m also having the same problems with mii.h and ext3_fs.h.

fsXX isn&apos;t a problem with your regexp either, you can find them by using: egrep &apos;[A-Za-z0-9][us](8|16|32|64)&apos; /usr/include/linux -r</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plasmaroo@gentoo.org</who>
            <bug_when>2006-05-06 08:30:41 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; There are more headers broken, I&apos;m also having the same problems with mii.h and
&gt; ext3_fs.h.

Hmm, did you rerun the updated sed on those headers as well? If they still break post compiler errors please.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dick@mrns.nl</who>
            <bug_when>2006-05-06 10:28:54 0000</bug_when>
            <thetext>I&apos;m commenting about linux-headers-2.6.11-r5 which seems to patch jiffies.h and ethtool.h, could you please add mii.h and ext3_fs.h to this list?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>plasmaroo@gentoo.org</who>
            <bug_when>2006-07-28 14:32:47 0000</bug_when>
            <thetext>Now fixed in CVS; sorry about the delay! Thanks...</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>86205</attachid>
            <date>2006-05-05 09:25 0000</date>
            <desc>kernel-2.eclass.patch</desc>
            <filename>kernel-2.eclass.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGtlcm5lbC0yLmVjbGFzcy5vcmlnCTIwMDYtMDUtMDUgMTc6Mjg6NDAuMDAwMDAwMDAwICsw
MjAwCisrKyBrZXJuZWwtMi5lY2xhc3MJMjAwNi0wNS0wNSAxNzoyOToyNi4wMDAwMDAwMDAgKzAy
MDAKQEAgLTk4MSwxMCArOTgxLDcgQEAKIAkjIFZvb2RvbyB0byBwYXJ0aWFsbHkgZml4IGJyb2tl
biB1cHN0cmVhbSBoZWFkZXJzLgogCSMgSXNzdWVzIHdpdGggdGhpcyBmdW5jdGlvbiBzaG91bGQg
Z28gdG8gcGxhc21hcm9vLgogCXNlZCAtaSBcCi0JCS1lICJzL1woWyAiJCdcdCciXVwpXCh1XHxz
XClcKDhcfDE2XHwzMlx8NjRcKVwoWyAiJCdcdCciXVwpL1wxX19cMlwzXDQvZzsiIFwKLQkJLWUg
J3MvIFwodVx8c1wpXCg4XHwxNlx8MzJcfDY0XCkkLyBfX1wxXDIvZycgXAotCQktZSAncy9cKFso
LCBdXClcKHVcfHNcKTY0XChbLCApXVwpL1wxX19cMjY0XDMvZycgXAotCQktZSAicy9eXCh1XHxz
XClcKDhcfDE2XHwzMlx8NjRcKVwoWyAiJCdcdCciXVwpL19fXDFcMlwzL2c7IiBcCisJCS1lICJz
L1woX19cKVw/XChbdXNdXCg4XHwxNlx8MzJcfDY0XClcKS9fX1wyL2ciIFwKIAkJLWUgInMvIGlu
bGluZSAvIF9faW5saW5lX18gL2ciIFwKIAkJIiRAIgogfQo=
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>86243</attachid>
            <date>2006-05-06 02:37 0000</date>
            <desc>kernel-2.eclass.patch</desc>
            <filename>kernel-2.eclass.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIGtlcm5lbC0yLmVjbGFzcy5vcmlnCTIwMDYtMDUtMDUgMTc6Mjg6NDAuMDAwMDAwMDAwICsw
MjAwCisrKyBrZXJuZWwtMi5lY2xhc3MJMjAwNi0wNS0wNiAxMTowMDo1Ny4wMDAwMDAwMDAgKzAy
MDAKQEAgLTk4MSwxMCArOTgxLDcgQEAKIAkjIFZvb2RvbyB0byBwYXJ0aWFsbHkgZml4IGJyb2tl
biB1cHN0cmVhbSBoZWFkZXJzLgogCSMgSXNzdWVzIHdpdGggdGhpcyBmdW5jdGlvbiBzaG91bGQg
Z28gdG8gcGxhc21hcm9vLgogCXNlZCAtaSBcCi0JCS1lICJzL1woWyAiJCdcdCciXVwpXCh1XHxz
XClcKDhcfDE2XHwzMlx8NjRcKVwoWyAiJCdcdCciXVwpL1wxX19cMlwzXDQvZzsiIFwKLQkJLWUg
J3MvIFwodVx8c1wpXCg4XHwxNlx8MzJcfDY0XCkkLyBfX1wxXDIvZycgXAotCQktZSAncy9cKFso
LCBdXClcKHVcfHNcKTY0XChbLCApXVwpL1wxX19cMjY0XDMvZycgXAotCQktZSAicy9eXCh1XHxz
XClcKDhcfDE2XHwzMlx8NjRcKVwoWyAiJCdcdCciXVwpL19fXDFcMlwzL2c7IiBcCisJCS1lICdz
L1woW15BLVphLXowLTlfXVx8XlwpXChfX1wpXD9cKFt1c11cKDhcfDE2XHwzMlx8NjRcKVwpL1wx
X19cMy9nJyBcCiAJCS1lICJzLyBpbmxpbmUgLyBfX2lubGluZV9fIC9nIiBcCiAJCSIkQCIKIH0K
</data>        

          </attachment>
    </bug>

</bugzilla>