linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH hostap/wpa_supplicant] Allow wpa_supplicant to use libnl-2.0
@ 2009-07-01 20:59 Jon Loeliger
  2009-07-02 12:29 ` Dan Williams
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Loeliger @ 2009-07-01 20:59 UTC (permalink / raw)
  To: jouni.malinen; +Cc: linux-wireless@vger.kernel.org

Introduce CONFIG_LIBNL20 .config parameter and propogate
that as a CFLAG in the Makefile.

Add forward-compatibility code to allow the existing code
to also use libnl-2.0.

Signed-off-by: Jon Loeliger <jdl@bigfootnetworks.com>
---

This patch applies to:
    git://w1.fi/srv/git/hostap-06.git
    fa4e296f542af01da135d997358d6d45a32dd59e

Also, I suspect that this define:

    +#define nl_handle nl_sock

may need to be added to the hostapd side as well, but
I'm not using that and haven't investigated or tested that.

jdl


 src/drivers/driver_nl80211.c |   17 +++++++++++++++++
 wpa_supplicant/Makefile      |    4 ++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index a7b351a..66288f6 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -47,6 +47,15 @@
 #endif
 
 
+#ifdef CONFIG_LIBNL20
+/* libnl 2.0 compatibility code */
+
+#define nl_handle nl_sock
+#define nl_handle_alloc_cb nl_socket_alloc_cb
+#define nl_handle_destroy nl_socket_free
+#endif /* CONFIG_LIBNL20 */
+
+
 struct wpa_driver_nl80211_data {
 	void *ctx;
 	int wext_event_sock;
@@ -1441,12 +1450,20 @@ static void * wpa_driver_nl80211_init(void *ctx, const char *ifname)
 		goto err3;
 	}
 
+#ifdef CONFIG_LIBNL20
+	if (genl_ctrl_alloc_cache(drv->nl_handle, &drv->nl_cache) < 0) {
+	    wpa_printf(MSG_ERROR, "nl80211: Failed to allocate generic "
+			   "netlink cache");
+		goto err3;
+	}
+#else
 	drv->nl_cache = genl_ctrl_alloc_cache(drv->nl_handle);
 	if (drv->nl_cache == NULL) {
 		wpa_printf(MSG_ERROR, "nl80211: Failed to allocate generic "
 			   "netlink cache");
 		goto err3;
 	}
+#endif
 
 	drv->nl80211 = genl_ctrl_search_by_name(drv->nl_cache, "nl80211");
 	if (drv->nl80211 == NULL) {
diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
index 45d6ada..fa43a0c 100644
--- a/wpa_supplicant/Makefile
+++ b/wpa_supplicant/Makefile
@@ -135,6 +135,10 @@ ifdef CONFIG_DRIVER_NL80211
 CFLAGS += -DCONFIG_DRIVER_NL80211
 OBJS_d += ../src/drivers/driver_nl80211.o
 LIBS += -lnl
+ifdef CONFIG_LIBNL20
+LIBS += -lnl-genl
+CFLAGS += -DCONFIG_LIBNL20
+endif
 ifdef CONFIG_CLIENT_MLME
 OBJS_d += ../src/drivers/radiotap.o
 endif
-- 
1.6.3.GIT




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH hostap/wpa_supplicant] Allow wpa_supplicant to use libnl-2.0
  2009-07-01 20:59 [PATCH hostap/wpa_supplicant] Allow wpa_supplicant to use libnl-2.0 Jon Loeliger
@ 2009-07-02 12:29 ` Dan Williams
  2009-07-02 15:09   ` Jon Loeliger
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Williams @ 2009-07-02 12:29 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: jouni.malinen, linux-wireless@vger.kernel.org

On Wed, 2009-07-01 at 15:59 -0500, Jon Loeliger wrote:
> Introduce CONFIG_LIBNL20 .config parameter and propogate
> that as a CFLAG in the Makefile.
> 
> Add forward-compatibility code to allow the existing code
> to also use libnl-2.0.
> 
> Signed-off-by: Jon Loeliger <jdl@bigfootnetworks.com>

You might actually want to post this to the hostap/wpa_supplicant
mailing list instead.  While developers involved in both projects are
subscribed to both lists, linux-wireless isn't the right place for
patches against hostap and wpa_supplicant.

http://lists.shmoo.com/mailman/listinfo/hostap

Dan

> ---
> 
> This patch applies to:
>     git://w1.fi/srv/git/hostap-06.git
>     fa4e296f542af01da135d997358d6d45a32dd59e
> 
> Also, I suspect that this define:
> 
>     +#define nl_handle nl_sock
> 
> may need to be added to the hostapd side as well, but
> I'm not using that and haven't investigated or tested that.
> 
> jdl
> 
> 
>  src/drivers/driver_nl80211.c |   17 +++++++++++++++++
>  wpa_supplicant/Makefile      |    4 ++++
>  2 files changed, 21 insertions(+), 0 deletions(-)
> 
> diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
> index a7b351a..66288f6 100644
> --- a/src/drivers/driver_nl80211.c
> +++ b/src/drivers/driver_nl80211.c
> @@ -47,6 +47,15 @@
>  #endif
>  
> 
> +#ifdef CONFIG_LIBNL20
> +/* libnl 2.0 compatibility code */
> +
> +#define nl_handle nl_sock
> +#define nl_handle_alloc_cb nl_socket_alloc_cb
> +#define nl_handle_destroy nl_socket_free
> +#endif /* CONFIG_LIBNL20 */
> +
> +
>  struct wpa_driver_nl80211_data {
>  	void *ctx;
>  	int wext_event_sock;
> @@ -1441,12 +1450,20 @@ static void * wpa_driver_nl80211_init(void *ctx, const char *ifname)
>  		goto err3;
>  	}
>  
> +#ifdef CONFIG_LIBNL20
> +	if (genl_ctrl_alloc_cache(drv->nl_handle, &drv->nl_cache) < 0) {
> +	    wpa_printf(MSG_ERROR, "nl80211: Failed to allocate generic "
> +			   "netlink cache");
> +		goto err3;
> +	}
> +#else
>  	drv->nl_cache = genl_ctrl_alloc_cache(drv->nl_handle);
>  	if (drv->nl_cache == NULL) {
>  		wpa_printf(MSG_ERROR, "nl80211: Failed to allocate generic "
>  			   "netlink cache");
>  		goto err3;
>  	}
> +#endif
>  
>  	drv->nl80211 = genl_ctrl_search_by_name(drv->nl_cache, "nl80211");
>  	if (drv->nl80211 == NULL) {
> diff --git a/wpa_supplicant/Makefile b/wpa_supplicant/Makefile
> index 45d6ada..fa43a0c 100644
> --- a/wpa_supplicant/Makefile
> +++ b/wpa_supplicant/Makefile
> @@ -135,6 +135,10 @@ ifdef CONFIG_DRIVER_NL80211
>  CFLAGS += -DCONFIG_DRIVER_NL80211
>  OBJS_d += ../src/drivers/driver_nl80211.o
>  LIBS += -lnl
> +ifdef CONFIG_LIBNL20
> +LIBS += -lnl-genl
> +CFLAGS += -DCONFIG_LIBNL20
> +endif
>  ifdef CONFIG_CLIENT_MLME
>  OBJS_d += ../src/drivers/radiotap.o
>  endif


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH hostap/wpa_supplicant] Allow wpa_supplicant to use libnl-2.0
  2009-07-02 12:29 ` Dan Williams
@ 2009-07-02 15:09   ` Jon Loeliger
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Loeliger @ 2009-07-02 15:09 UTC (permalink / raw)
  To: Dan Williams; +Cc: jouni.malinen, linux-wireless@vger.kernel.org

On Thu, 2009-07-02 at 08:29 -0400, Dan Williams wrote:
> On Wed, 2009-07-01 at 15:59 -0500, Jon Loeliger wrote:
> > Introduce CONFIG_LIBNL20 .config parameter and propogate
> > that as a CFLAG in the Makefile.
> > 
> > Add forward-compatibility code to allow the existing code
> > to also use libnl-2.0.
> > 
> > Signed-off-by: Jon Loeliger <jdl@bigfootnetworks.com>
> 
> You might actually want to post this to the hostap/wpa_supplicant
> mailing list instead.  While developers involved in both projects are
> subscribed to both lists, linux-wireless isn't the right place for
> patches against hostap and wpa_supplicant.
> 
> http://lists.shmoo.com/mailman/listinfo/hostap
> 
> Dan

Argh.  Done.  Thanks.

jdl



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-02 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 20:59 [PATCH hostap/wpa_supplicant] Allow wpa_supplicant to use libnl-2.0 Jon Loeliger
2009-07-02 12:29 ` Dan Williams
2009-07-02 15:09   ` Jon Loeliger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).