From patchwork Mon Aug 8 17:31:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 1046282 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p78HVQh8015373 for ; Mon, 8 Aug 2011 17:31:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752223Ab1HHRbY (ORCPT ); Mon, 8 Aug 2011 13:31:24 -0400 Received: from mail.tpi.com ([70.99.223.143]:4900 "EHLO mail.tpi.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079Ab1HHRbY (ORCPT ); Mon, 8 Aug 2011 13:31:24 -0400 Received: from sepang.rtg.net (mail.tpi.com [70.99.223.143]) by mail.tpi.com (Postfix) with ESMTP id 259302DF296; Mon, 8 Aug 2011 10:30:46 -0700 (PDT) Received: from [127.0.0.1] (lochsa [127.0.0.1]) by sepang.rtg.net (Postfix) with ESMTP id EDEFDF89F8; Mon, 8 Aug 2011 11:31:14 -0600 (MDT) Message-ID: <4E401D62.80800@canonical.com> Date: Mon, 08 Aug 2011 11:31:14 -0600 From: Tim Gardner User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11 MIME-Version: 1.0 To: mcgrof@gmail.com CC: linux-wireless@vger.kernel.org Subject: [PATCH] crda - Add nested support for libnl-1, libnl-2.0, and libnl-3.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 08 Aug 2011 17:34:42 +0000 (UTC) libnl-3.0 is the version used for Ubuntu Oneiric. From 339e3811bbb140253fc7c8225322a51420046df6 Mon Sep 17 00:00:00 2001 From: Tim Gardner Date: Mon, 8 Aug 2011 10:49:49 -0600 Subject: [PATCH] Add nested support for libnl-1, libnl-2.0, and libnl-3.0 Signed-off-by: Tim Gardner --- Makefile | 21 ++++++++++++++------- crda.c | 4 ++-- 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; -- 1.7.0.4