2 *************************************************************************
4 * 5F., No.36, Taiyuan St., Jhubei City,
8 * (c) Copyright 2002-2007, Ralink Technology, Inc.
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
25 *************************************************************************
34 -------- ---------- ----------------------------------------------
35 John 2004-10-1 copy from RT2560
38 #include "../rt_config.h"
42 ==========================================================================
44 authentication state machine init procedure
46 Sm - the state machine
50 ==========================================================================
52 VOID AuthRspStateMachineInit(
55 IN STATE_MACHINE_FUNC Trans[])
57 StateMachineInit(Sm, Trans, MAX_AUTH_RSP_STATE, MAX_AUTH_RSP_MSG, (STATE_MACHINE_FUNC)Drop, AUTH_RSP_IDLE, AUTH_RSP_MACHINE_BASE);
60 StateMachineSetAction(Sm, AUTH_RSP_IDLE, MT2_PEER_DEAUTH, (STATE_MACHINE_FUNC)PeerDeauthAction);
63 StateMachineSetAction(Sm, AUTH_RSP_WAIT_CHAL, MT2_PEER_DEAUTH, (STATE_MACHINE_FUNC)PeerDeauthAction);
68 ==========================================================================
73 ==========================================================================
75 VOID PeerAuthSimpleRspGenAndSend(
77 IN PHEADER_802_11 pHdr80211,
83 HEADER_802_11 AuthHdr;
85 PUCHAR pOutBuffer = NULL;
88 if (Reason != MLME_SUCCESS)
90 DBGPRINT(RT_DEBUG_TRACE, ("Peer AUTH fail...\n"));
94 //Get an unused nonpaged memory
95 NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
96 if (NStatus != NDIS_STATUS_SUCCESS)
99 DBGPRINT(RT_DEBUG_TRACE, ("Send AUTH response (seq#2)...\n"));
100 MgtMacHeaderInit(pAd, &AuthHdr, SUBTYPE_AUTH, 0, pHdr80211->Addr2, pAd->MlmeAux.Bssid);
101 MakeOutgoingFrame(pOutBuffer, &FrameLen,
102 sizeof(HEADER_802_11), &AuthHdr,
107 MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
108 MlmeFreeMemory(pAd, pOutBuffer);
112 ==========================================================================
115 IRQL = DISPATCH_LEVEL
117 ==========================================================================
119 VOID PeerDeauthAction(
120 IN PRTMP_ADAPTER pAd,
121 IN PMLME_QUEUE_ELEM Elem)
123 UCHAR Addr2[MAC_ADDR_LEN];
126 if (PeerDeauthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
129 && MAC_ADDR_EQUAL(Addr2, pAd->CommonCfg.Bssid)
132 DBGPRINT(RT_DEBUG_TRACE,("AUTH_RSP - receive DE-AUTH from our AP (Reason=%d)\n", Reason));
135 #ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
136 RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
137 #endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
140 // send wireless event - for deauthentication
141 if (pAd->CommonCfg.bWirelessEvent)
142 RTMPSendWirelessEvent(pAd, IW_DEAUTH_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
149 DBGPRINT(RT_DEBUG_TRACE,("AUTH_RSP - PeerDeauthAction() sanity check fail\n"));