Sergey Senozhatsky
2012-04-27 20:34:53 UTC
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.senozhatsky-***@public.gmane.org>
---
src/tuning/iw.c | 4 ----
src/tuning/iw.h | 12 +++++++-----
2 files changed, 7 insertions(+), 9 deletions(-)
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 */
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.senozhatsky-***@public.gmane.org>
---
src/tuning/iw.c | 4 ----
src/tuning/iw.h | 12 +++++++-----
2 files changed, 7 insertions(+), 9 deletions(-)
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 */