aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Gardner <tim.gardner@canonical.com>2011-08-08 10:49:49 -0600
committerLuis R. Rodriguez <mcgrof@qca.qualcomm.com>2011-08-09 16:36:19 -0700
commitc1b10e69fc8ab3209313d5189a08e335afa0c752 (patch)
tree00082a7a701f3a17447331c5e0c666fc68ca54f5
parent52300e7ed595cc15305fbfbc28c6ee146ceff1ee (diff)
downloadcrda-c1b10e69fc8ab3209313d5189a08e335afa0c752.tar.gz
crda: add nested support for libnl-3.0v1.1.2
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
-rw-r--r--Makefile21
-rw-r--r--crda.c4
2 files changed, 16 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index b8bc7d3..084d8e5 100644
--- a/Makefile
+++ b/Makefile
@@ -47,15 +47,22 @@ INSTALL ?= install
NL1FOUND := $(shell pkg-config --atleast-version=1 libnl-1 && echo Y)
NL2FOUND := $(shell pkg-config --atleast-version=2 libnl-2.0 && echo Y)
+NL3FOUND := $(shell pkg-config --atleast-version=3 libnl-3.0 && echo Y)
-ifeq ($(NL1FOUND),Y)
-NLLIBNAME = libnl-1
-endif
-
-ifeq ($(NL2FOUND),Y)
-CFLAGS += -DCONFIG_LIBNL20
+ifeq ($(NL3FOUND),Y)
+CFLAGS += -DCONFIG_LIBNL30
NLLIBS += -lnl-genl
-NLLIBNAME = libnl-2.0
+NLLIBNAME = libnl-3.0
+else
+ ifeq ($(NL2FOUND),Y)
+ CFLAGS += -DCONFIG_LIBNL20
+ NLLIBS += -lnl-genl
+ NLLIBNAME = libnl-2.0
+ else
+ ifeq ($(NL1FOUND),Y)
+ NLLIBNAME = libnl-1
+ endif
+ endif
endif
ifeq ($(NLLIBNAME),)
diff --git a/crda.c b/crda.c
index d2ba29a..6857e3f 100644
--- a/crda.c
+++ b/crda.c
@@ -21,7 +21,7 @@
#include "regdb.h"
#include "reglib.h"
-#ifndef CONFIG_LIBNL20
+#if !defined(CONFIG_LIBNL20) && !defined(CONFIG_LIBNL30)
/* libnl 2.0 compatibility code */
static inline struct nl_handle *nl_socket_alloc(void)
{
@@ -44,7 +44,7 @@ static inline int __genl_ctrl_alloc_cache(struct nl_handle *h, struct nl_cache *
#define genl_ctrl_alloc_cache __genl_ctrl_alloc_cache
#define nl_sock nl_handle
-#endif /* CONFIG_LIBNL20 */
+#endif /* CONFIG_LIBNL20 && CONFIG_LIBNL30 */
struct nl80211_state {
struct nl_sock *nl_sock;