Fix driver_bsd.c build
authorMasashi Honma <honma@ictec.co.jp>
Mon, 7 Dec 2009 19:35:35 +0000 (21:35 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 7 Dec 2009 19:35:35 +0000 (21:35 +0200)
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

index 7cf6159..a495f5f 100644 (file)
@@ -1147,6 +1147,23 @@ wpa_driver_bsd_disassociate(void *priv, const u8 *addr, int reason_code)
 }
 
 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)
 {
        struct wpa_driver_bsd_data *drv = priv;
@@ -1200,23 +1217,6 @@ wpa_driver_bsd_associate(void *priv, struct wpa_driver_associate_params *params)
 }
 
 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)
 {
        struct wpa_driver_bsd_data *drv = priv;