From owner-p4-projects@FreeBSD.ORG Fri Dec 3 00:41:44 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E82A916A4D0; Fri, 3 Dec 2004 00:41:43 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6BB216A4CE for ; Fri, 3 Dec 2004 00:41:43 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7AE3A43D53 for ; Fri, 3 Dec 2004 00:41:43 +0000 (GMT) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iB30fhtY016514 for ; Fri, 3 Dec 2004 00:41:43 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iB30fhO1016511 for perforce@freebsd.org; Fri, 3 Dec 2004 00:41:43 GMT (envelope-from sam@freebsd.org) Date: Fri, 3 Dec 2004 00:41:43 GMT Message-Id: <200412030041.iB30fhO1016511@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 66288 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2004 00:41:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=66288 Change 66288 by sam@sam_ebb on 2004/12/03 00:40:43 fix horrible braino Affected files ... .. //depot/projects/wifi/sys/net80211/ieee80211_proto.c#11 edit Differences ... ==== //depot/projects/wifi/sys/net80211/ieee80211_proto.c#11 (text+ko) ==== @@ -40,6 +40,7 @@ #include "opt_inet.h" #include +#include #include #include @@ -84,26 +85,6 @@ "WME_UPSD", }; -#define IEEE80211_AUTH_MAX (IEEE80211_AUTH_WPA+1) -/* XXX well-known names */ -static const char *auth_modnames[IEEE80211_AUTH_MAX] = { - "wlan_internal", /* IEEE80211_AUTH_NONE */ - "wlan_internal", /* IEEE80211_AUTH_OPEN */ - "wlan_internal", /* IEEE80211_AUTH_SHARED */ - "wlan_xauth", /* IEEE80211_AUTH_8021X */ - "wlan_internal", /* IEEE80211_AUTH_AUTO */ - "wlan_xauth", /* IEEE80211_AUTH_WPA */ -}; -static const struct ieee80211_authenticator *authenticators[IEEE80211_AUTH_MAX]; - -static const struct ieee80211_authenticator auth_internal = { - .ia_name = "wlan_internal", - .ia_attach = NULL, - .ia_detach = NULL, - .ia_node_join = NULL, - .ia_node_leave = NULL, -}; - static int ieee80211_newstate(struct ieee80211com *, enum ieee80211_state, int); void @@ -135,10 +116,6 @@ /* initialize management frame handlers */ ic->ic_recv_mgmt = ieee80211_recv_mgmt; ic->ic_send_mgmt = ieee80211_send_mgmt; - - ieee80211_authenticator_register(IEEE80211_AUTH_OPEN, &auth_internal); - ieee80211_authenticator_register(IEEE80211_AUTH_SHARED, &auth_internal); - ieee80211_authenticator_register(IEEE80211_AUTH_AUTO, &auth_internal); } void @@ -156,10 +133,6 @@ IF_DRAIN(&ic->ic_mgtq); mtx_destroy(&ic->ic_mgtq.ifq_mtx); - ieee80211_authenticator_unregister(IEEE80211_AUTH_OPEN); - ieee80211_authenticator_unregister(IEEE80211_AUTH_SHARED); - ieee80211_authenticator_unregister(IEEE80211_AUTH_AUTO); - /* * Detach any ACL'ator. */ @@ -171,6 +144,38 @@ * Simple-minded authenticator module support. */ +#define IEEE80211_AUTH_MAX (IEEE80211_AUTH_WPA+1) +/* XXX well-known names */ +static const char *auth_modnames[IEEE80211_AUTH_MAX] = { + "wlan_internal", /* IEEE80211_AUTH_NONE */ + "wlan_internal", /* IEEE80211_AUTH_OPEN */ + "wlan_internal", /* IEEE80211_AUTH_SHARED */ + "wlan_xauth", /* IEEE80211_AUTH_8021X */ + "wlan_internal", /* IEEE80211_AUTH_AUTO */ + "wlan_xauth", /* IEEE80211_AUTH_WPA */ +}; +static const struct ieee80211_authenticator *authenticators[IEEE80211_AUTH_MAX]; + +static const struct ieee80211_authenticator auth_internal = { + .ia_name = "wlan_internal", + .ia_attach = NULL, + .ia_detach = NULL, + .ia_node_join = NULL, + .ia_node_leave = NULL, +}; + +/* + * Setup internal authenticators once; they are never unregistered. + */ +static void +ieee80211_auth_setup(void) +{ + ieee80211_authenticator_register(IEEE80211_AUTH_OPEN, &auth_internal); + ieee80211_authenticator_register(IEEE80211_AUTH_SHARED, &auth_internal); + ieee80211_authenticator_register(IEEE80211_AUTH_AUTO, &auth_internal); +} +SYSINIT(wlan_auth, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_auth_setup, NULL); + const struct ieee80211_authenticator * ieee80211_authenticator_get(int auth) {