From 2a91091e154e99cb57f16a2f95fc90d9920c2907 Mon Sep 17 00:00:00 2001 From: Masashi Honma Date: Mon, 7 Dec 2009 21:35:35 +0200 Subject: [PATCH] Fix driver_bsd.c build On NetBSD 5.0.1, driver_bsd.c build fails with message below. ../src/drivers/driver_bsd.c: In function 'wpa_driver_bsd_associate': ../src/drivers/driver_bsd.c:1170: warning: implicit declaration of function 'wpa_driver_bsd_set_auth_alg' ../src/drivers/driver_bsd.c: At top level: ../src/drivers/driver_bsd.c:1204: error: static declaration of 'wpa_driver_bsd_set_auth_alg' follows non-static declaration ../src/drivers/driver_bsd.c:1170: error: previous implicit declaration of 'wpa_driver_bsd_set_auth_alg' was here gmake: *** [../src/drivers/driver_bsd.o] Error 1 This patch solves this issue. --- src/drivers/driver_bsd.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c index 7cf615909..a495f5f6e 100644 --- a/src/drivers/driver_bsd.c +++ b/src/drivers/driver_bsd.c @@ -1146,6 +1146,23 @@ wpa_driver_bsd_disassociate(void *priv, const u8 *addr, int reason_code) return set80211var(drv, IEEE80211_IOC_MLME, &mlme, sizeof(mlme)); } +static int +wpa_driver_bsd_set_auth_alg(void *priv, int auth_alg) +{ + struct wpa_driver_bsd_data *drv = priv; + int authmode; + + if ((auth_alg & AUTH_ALG_OPEN_SYSTEM) && + (auth_alg & AUTH_ALG_SHARED_KEY)) + authmode = IEEE80211_AUTH_AUTO; + else if (auth_alg & AUTH_ALG_SHARED_KEY) + authmode = IEEE80211_AUTH_SHARED; + else + authmode = IEEE80211_AUTH_OPEN; + + return set80211param(drv, IEEE80211_IOC_AUTHMODE, authmode); +} + static int wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) { @@ -1199,23 +1216,6 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params) return ret; } -static int -wpa_driver_bsd_set_auth_alg(void *priv, int auth_alg) -{ - struct wpa_driver_bsd_data *drv = priv; - int authmode; - - if ((auth_alg & AUTH_ALG_OPEN_SYSTEM) && - (auth_alg & AUTH_ALG_SHARED_KEY)) - authmode = IEEE80211_AUTH_AUTO; - else if (auth_alg & AUTH_ALG_SHARED_KEY) - authmode = IEEE80211_AUTH_SHARED; - else - authmode = IEEE80211_AUTH_OPEN; - - return set80211param(drv, IEEE80211_IOC_AUTHMODE, authmode); -} - static int wpa_driver_bsd_scan(void *priv, struct wpa_driver_scan_params *params) {