Beispiel #1
0
/*
  ==========================================================================
  Description:
  peer sends reassoc rsp
  Parametrs:
  Elem - MLME message cntaining the received frame
  ==========================================================================
*/
VOID PeerReassocRspAction(
    IN PRTMP_ADAPTER pAd,
    IN MLME_QUEUE_ELEM *Elem)
{
    USHORT      CapabilityInfo;
    USHORT      Status;
    USHORT      Aid;
    UCHAR       SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
    UCHAR       ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
    UCHAR       Addr2[MAC_ADDR_LEN];
    EDCA_PARM   EdcaParm;
    BOOLEAN     TimerCancelled;

#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
    union iwreq_data wrqu;
#endif

    if(PeerAssocRspSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, &Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &EdcaParm))
    {
        if(MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid)) // The frame is for me ?
        {
            DBGPRINT(RT_DEBUG_TRACE, "ASSOC - receive REASSOC_RSP to me (status=%d)\n", Status);
            RTMPCancelTimer(&pAd->MlmeAux.ReassocTimer,&TimerCancelled);

            if(Status == MLME_SUCCESS)
            {
                // go to procedure listed on page 376
                AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen, &EdcaParm);

#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
                if (pAd->PortCfg.WPA_Supplicant == TRUE)
                {
                    //collect associate info
                    link_status_handler(pAd);
                    //send associnfo event to wpa_supplicant
                    memset(&wrqu, 0, sizeof(wrqu));
                    wrqu.data.flags = RT_ASSOC_EVENT_FLAG;
                    wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL);
                }
                DBGPRINT(RT_DEBUG_OFF, "ASSOC - receive REASSOC_RSP to me (status=%d)\n", Status);
#endif

#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
                if (pAd->PortCfg.bNativeWpa == TRUE)  // add by johnli
                    wext_notify_event_assoc(pAd, SIOCGIWAP, TRUE);
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT

            }

            pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
            MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
        }
    }
    else
    {
        DBGPRINT(RT_DEBUG_TRACE, "ASSOC - PeerReassocRspAction() sanity check fail\n");
    }

}
Beispiel #2
0
/*
    ==========================================================================
    Description:
        peer sends assoc rsp back
    Parameters:
        Elme - MLME message containing the received frame
    ==========================================================================
 */
VOID PeerAssocRspAction(
    IN PRTMP_ADAPTER pAd, 
    IN MLME_QUEUE_ELEM *Elem) 
{
    USHORT        CapabilityInfo, Status, Aid;
    UCHAR         SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
    UCHAR         ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
    UCHAR         Addr2[MAC_ADDR_LEN];
	EDCA_PARM     EdcaParm;
	BOOLEAN       TimerCancelled;

#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
    union iwreq_data wrqu;
#endif

    if (PeerAssocRspSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, &Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &EdcaParm))
    {
        // The frame is for me ?
        if(MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid)) 
        {
            DBGPRINT(RT_DEBUG_TRACE, "ASSOC - receive ASSOC_RSP to me (status=%d)\n", Status);		
            RTMPCancelTimer(&pAd->MlmeAux.AssocTimer,&TimerCancelled);

            if(Status == MLME_SUCCESS) 
            {
                //
				// There may some packets will be drop, if we haven't set the BSS type!
				// For example: EAPOL packet and the case of WHQL lost Packets.
				// Since this may some delays to set those variables at LinkUp(..) on this (Mlme) thread. 
				// 
				// This is a trick, set the BSS type here.
				//
				if (pAd->PortCfg.BssType == BSS_INFRA)
				{
					OPSTATUS_SET_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
				}


                // go to procedure listed on page 376
                AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen, &EdcaParm);  	

#ifdef RALINK_WPA_SUPPLICANT_SUPPORT
                if (pAd->PortCfg.WPA_Supplicant == TRUE) {
                    // collect associate info 
                    link_status_handler(pAd);
                    //send associnfo event to wpa_supplicant
                    memset(&wrqu, 0, sizeof(wrqu));
                    wrqu.data.flags = RT_ASSOC_EVENT_FLAG;
                    wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL);
                }
#endif

#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
				// collect associate info and notify the wpa_supplicant. 
				if (pAd->PortCfg.bNativeWpa == TRUE)  // add by johnli
					wext_notify_event_assoc(pAd, SIOCGIWAP, TRUE);
#endif // NATIVE_WPA_SUPPLICANT_SUPPORT
            } 
			
            pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
            MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
        } 
    }
    else
    {
        DBGPRINT(RT_DEBUG_TRACE, "ASSOC - PeerAssocRspAction() sanity check fail\n");
    }
}