What Am I Missing?
Jean Tourrilhes
jt
Wed Dec 18 16:13:24 PST 2002
On Thu, Dec 19, 2002 at 10:44:20AM +1100, Les Bell wrote:
>
> Jean Tourrilhes <jt at bougret.hpl.hp.com> wrote:
>
> >>
> Hu ? What's that ? I believe ethtool should not find it's way
> to user space, and it's never included from wireless.h.
> <<
>
> Jean, if anyone should know, you should - and yet, lines 65 - 70 of
> wireless.h read:
>
> /***************************** INCLUDES *****************************/
>
> #include <linux/types.h> /* for "caddr_t" et al */
> #include <linux/socket.h> /* for "struct sockaddr" et al */
> #include <linux/if.h> /* for IFNAMSIZ and co... */
> #include <linux/ethtool.h>
>
> The header reads:
>
> /*
> * This file define a set of standard wireless extensions
> *
> * Version : 13 6.12.01
> *
> * Authors : Jean Tourrilhes - HPL - <jt at hpl.hp.com>
> * Copyright (c) 1997-2001 Jean Tourrilhes, All Rights Reserved.
> */
>
> It appears to be part of the Red Hat kernel-source-2.4.18-18.7.x package.
> Perhaps RH have modified it?
Definitely. If you look into the Wireless Tool package, you
will find all version of wireless.h as I put them in the kernel. And
as far as can see, neither 2.5.51 nor 2.4.21-pre1 from kernel.org has
this change.
(And by the way, this change doesn't make much sense)
In the long term, I plan to remove all #include from
wireless.h, because it created problems in user space, but this will
probably take another year (time for the proper iwlib and fixes to go
in all user space package).
> Looking at where the compiler squawks on ethtool.h:
>
> /* 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 tranceiver 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];
> };
>
> It looks to me as though the compiler hasn't yet seen a #define or typedef
> for u32, u16, etc.
Correct, because they are kernel specific. Only the '_'
prefixed version are availalble in user space (that's why I say this
file should never go in user space).
> My next line of attack is going to be to find where they
> are defined, and get that #include'd. . .
Just nuke the offensive #include in wireless.h, that might
work fine.
> Thanks,
>
> Best,
>
> --- Les Bell, CISSP
Regards,
Jean
More information about the Hostap
mailing list