Hi,

starting with the commit b0d2854861de2f15671e633da11f42207d4357df
I get the following compile time error:

[...]
gcc -DHAVE_CONFIG_H -I. -I..  -D_FORTIFY_SOURCE=2       -g -O2 -MT 
tuning/powertop-iw.o -MD -MP -MF tuning/.deps/powertop-iw.Tpo -c -o 
tuning/powertop-iw.o
`test -f 'tuning/iw.c' || echo './'`tuning/iw.c
tuning/iw.c: In function ‘set_power_save’:
tuning/iw.c:129: error: storage size of ‘ps_state’ isn’t known
tuning/iw.c:131: error: ‘NL80211_PS_DISABLED’ undeclared (first use in this 
function)
tuning/iw.c:131: error: (Each undeclared identifier is reported only once
tuning/iw.c:131: error: for each function it appears in.)
tuning/iw.c:133: error: ‘NL80211_PS_ENABLED’ undeclared (first use in this 
function)
tuning/iw.c:135: error: ‘NL80211_ATTR_PS_STATE’ undeclared (first use in this 
function)
tuning/iw.c: In function ‘print_power_save_handler’:
tuning/iw.c:151: error: ‘NL80211_ATTR_PS_STATE’ undeclared (first use in this 
function)
tuning/iw.c:155: error: ‘NL80211_PS_ENABLED’ undeclared (first use in this 
function)
tuning/iw.c:158: error: ‘NL80211_PS_DISABLED’ undeclared (first use in this 
function)
tuning/iw.c: In function ‘__handle_cmd’:
tuning/iw.c:226: error: ‘NL80211_CMD_GET_POWER_SAVE’ undeclared (first use in 
this function)
tuning/iw.c:229: error: ‘NL80211_CMD_SET_POWER_SAVE’ undeclared (first use in 
this function)
make[3]: *** [tuning/powertop-iw.o] Error 1
make[3]: Leaving directory 
`/mnt/store/nmarci/src/powertop/powertop2/powertop/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory 
`/mnt/store/nmarci/src/powertop/powertop2/powertop/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/store/nmarci/src/powertop/powertop2/powertop'
make: *** [all] Error 2
$

This is the commit in question:

commit b0d2854861de2f15671e633da11f42207d4357df
Author: Sergey Senozhatsky <sergey.senozhat...@gmail.com>
Date:   Fri Apr 27 23:34:53 2012 +0300

    iw: handle HAVE_LIBNL20 properly

    iw: handle HAVE_LIBNL20 properly

    Move HAVE_CONFIG_H and config.h inclusion to iw header file, which is
    the right place for HAVE_LIBNL20 dependent `define nl_sock nl_handle'.

    Patch also change include of "nl80211.h" to <linux/nl80211.h>.

    Signed-off-by: Sergey Senozhatsky <sergey.senozhat...@gmail.com>

diff --git a/src/tuning/iw.c b/src/tuning/iw.c
index 36abc00..aeba3fd 100644
--- a/src/tuning/iw.c
+++ b/src/tuning/iw.c
@@ -45,10 +45,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 
SOFTWARE.
 #include <netlink/msg.h>
 #include <netlink/attr.h>

-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include "nl80211.h"
 #include <asm/errno.h>
 #include <linux/genetlink.h>
 #include "iw.h"
diff --git a/src/tuning/iw.h b/src/tuning/iw.h
index e0eef15..acf132d 100644
--- a/src/tuning/iw.h
+++ b/src/tuning/iw.h
@@ -32,19 +32,22 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 
SOFTWARE.

 */

-
 #include <stdbool.h>
 #include <netlink/netlink.h>
 #include <netlink/genl/genl.h>
 #include <netlink/genl/family.h>
 #include <netlink/genl/ctrl.h>

-#include "nl80211.h"
+#include <linux/nl80211.h>

 #define ETH_ALEN 6

-#ifndef CONFIG_LIBNL20
-#  define nl_sock nl_handle
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef HAVE_LIBNL20
+#define nl_sock nl_handle
 #endif

 struct nl80211_state {
@@ -69,5 +72,4 @@ enum id_input {
 int get_wifi_power_saving(const char *iface);
 int set_wifi_power_saving(const char *iface, int state);

-
 #endif /* __IW_H */

Also note that if I revert only this commit on top of the
current master (ab9e20f46c1bc04de9e74a51a398258522329764)
then powertop compiles cleanly.

$ dpkg -S /usr/include/linux/nl80211.h
linux-libc-dev: /usr/include/linux/nl80211.h

$ dpkg -l linux-libc-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                          Version                       Description
+++-=============================-=============================-==========================================================================
ii  linux-libc-dev                2.6.32-45                     Linux support 
headers for userspace development
$ lsb_release -a
LSB Version:
core-2.0-ia32:core-2.0-noarch:core-3.0-ia32:core-3.0-noarch:core-3.1-ia32:core-3.1-noarch:core-3.2-ia32:core-3.2-noarch:cxx-3.0-ia32:cxx-3.0-noarch:cxx-3.1-ia32:cxx-3.1-noarch:cxx-3.2-ia32:cxx-3.2-noarch:desktop-3.1-ia32:desktop-3.1-noarch:desktop-3.2-ia32:desktop-3.2-noarch:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch:graphics-3.1-ia32:graphics-3.1-noarch:graphics-3.2-ia32:graphics-3.2-noarch:qt4-3.1-ia32:qt4-3.1-noarch
Distributor ID: Debian
Description:    Debian GNU/Linux 6.0.5 (squeeze)
Release:        6.0.5
Codename:       squeeze

Regards,

        Márton Németh

_______________________________________________
Power mailing list
Power@bughost.org
https://bughost.org/mailman/listinfo/power

Reply via email to