Exemplo n.º 1
0
static TI_STATUS JoinWait_to_mlmeWait(void *pData)
{
    TI_STATUS status;
    paramInfo_t *pParam;
    conn_t *pConn = (conn_t *)pData;

    pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t));
    if (!pParam)
    {
        return TI_NOK;
    }

    /* Set the BA session policies to the FW */
    qosMngr_SetBaPolicies(pConn->hQosMngr);

    pParam->paramType = SITE_MGR_CURRENT_CHANNEL_PARAM;
    siteMgr_getParam(pConn->hSiteMgr, pParam);

    pParam->paramType = REGULATORY_DOMAIN_TX_POWER_AFTER_SELECTION_PARAM;
    pParam->content.channel = pParam->content.siteMgrCurrentChannel;
    regulatoryDomain_setParam(pConn->hRegulatoryDomain, pParam);

    pParam->paramType = RX_DATA_PORT_STATUS_PARAM;
    pParam->content.rxDataPortStatus = OPEN_NOTIFY;
    status = rxData_setParam(pConn->hRxData, pParam);
    if (status != TI_OK)
    {
        TRACE1( pConn->hReport, REPORT_SEVERITY_FATAL_ERROR, "JoinWait_to_mlmeWait: rxData_setParam return 0x%x.\n", status);
        os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));
        return status;
    }

    /* Update TxMgmtQueue SM to open Tx path only for Mgmt packets. */
    txMgmtQ_SetConnState (((conn_t *)pData)->hTxMgmtQ, TX_CONN_STATE_MGMT);

    /* 
     * Set the reassociation flag in the association logic.
     */ 
    pParam->paramType = MLME_RE_ASSOC_PARAM;

    if( pConn->connType == CONN_TYPE_ROAM )
	{
        pParam->content.mlmeReAssoc = TI_TRUE;
	}
    else 
	{
        pParam->content.mlmeReAssoc = TI_FALSE;
	}

    status = mlme_setParam(pConn->hMlme, pParam);

    if (status != TI_OK)
    {
        TRACE1( pConn->hReport, REPORT_SEVERITY_FATAL_ERROR, "JoinWait_to_mlmeWait: mlme_setParam return 0x%x.\n", status);
    }
	os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));

	/* TODO - YD - check the association type and then start mlme */
	return mlme_start(pConn->hMlme, pConn->connType);
}
Exemplo n.º 2
0
static TI_STATUS connect_to_ScrWait(void *pData)
{
    TI_STATUS   status;
    paramInfo_t *pParam;
    conn_t      *pConn = (conn_t *)pData;

    /*
     * This function performs roaming by two steps:
     * First - close the current connection without notify the SME.
     * Second - start new connection in reassociation mode.
     */ 

    /* close all BA sessions */
    TWD_CloseAllBaSessions(pConn->hTWD);

    status = rsn_stop(pConn->hRsn, pConn->disConEraseKeys);
    if (status != TI_OK)
        return status;

    pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t));
    if (!pParam)
    {
        return TI_NOK;
    }

    pParam->paramType = RX_DATA_PORT_STATUS_PARAM;
    pParam->content.rxDataPortStatus = CLOSE;
    status = rxData_setParam(pConn->hRxData, pParam);
    if (status == TI_OK)
    {
        /* Update TxMgmtQueue SM to close Tx path. */
        txMgmtQ_SetConnState (((conn_t *)pData)->hTxMgmtQ, TX_CONN_STATE_CLOSE);

        status = mlme_stop(pConn->hMlmeSm, DISCONNECT_IMMEDIATE, pConn->disConnReasonToAP);
        if (status == TI_OK)
        {
            pParam->paramType = REGULATORY_DOMAIN_DISCONNECT_PARAM;
            regulatoryDomain_setParam(pConn->hRegulatoryDomain, pParam);

#ifdef XCC_MODULE_INCLUDED
            XCCMngr_updateIappInformation(pConn->hXCCMngr, XCC_DISASSOC);
#endif
        /* Must be called AFTER mlme_stop. since De-Auth packet should be sent with the
            supported rates, and stopModules clears all rates. */
            stopModules(pConn, TI_FALSE);

            txCtrlParams_setEapolEncryptionStatus(pConn->hTxCtrl, DEF_EAPOL_ENCRYPTION_STATUS);
            qosMngr_disconnect (pConn->hQosMngr, TI_FALSE);

        /* 
         * Start new connection.
         */ 
            connInfra_ScrWait(pConn);
        }
    }

    os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));
    return status;
}
Exemplo n.º 3
0
static TI_STATUS connect_to_ScrWait(void *pData)
{
    TI_STATUS status;
    paramInfo_t param;
    conn_t *pConn = (conn_t *)pData;
    /*
     * This function performs roaming by two steps:
     * First - close the current connection without notify the SME.
     * Second - start new connection in reassociation mode.
     */ 


    status = rsn_stop(pConn->hRsn, pConn->disConEraseKeys);
    if (status != OK)
        return status;

    param.paramType = RX_DATA_PORT_STATUS_PARAM;
    param.content.rxDataPortStatus = CLOSE;
    status = rxData_setParam(pConn->hRxData, &param);
    if (status != OK)
        return status;

    param.paramType = TX_DATA_PORT_STATUS_PARAM;
    param.content.txDataPortStatus = CLOSE;
    status = txData_setParam(pConn->hTxData, &param);
    if (status != OK)
        return status;

    status = mlme_stop(pConn->hMlmeSm, DISCONN_TYPE_IMMEDIATE, pConn->disConnReasonToAP);
    if (status != OK)
        return status;

    param.paramType = REGULATORY_DOMAIN_DISCONNECT_PARAM;
    regulatoryDomain_setParam(pConn->hRegulatoryDomain, &param);

#ifdef EXC_MODULE_INCLUDED
    excMngr_updateIappInformation(pConn->hExcMngr, EXC_DISASSOC);
#endif
    /* Must be called AFTER mlme_stop. since De-Auth packet should be sent with the
        supported rates, and stopModules clears all rates. */
    stopModules(pConn);

    /* 
     * Tx Data Stop and QoS disconnect must be called only after the disconnect (dissasociate/deauthenticate)
     * has been sent. In this case no deauthenticate frame is sent bu still we keep the 
     * order.
     */
    txData_stop(pConn->hTxData);
    qosMngr_disconnect(pConn->hQosMngr);

    /* 
     * Start new connection.
     */ 
    Idle_to_ScrWait(pConn);

    return OK;
}
Exemplo n.º 4
0
void switchChannelDebug_setChannelValidity(TI_HANDLE hSwitchChannel, TI_UINT8 channelNum, TI_BOOL validity)
{
	paramInfo_t param;

	switchChannel_t       *pSwitchChannel = (switchChannel_t*)hSwitchChannel;

	if (pSwitchChannel == NULL) {
		return;
	}

	param.paramType = REGULATORY_DOMAIN_SET_CHANNEL_VALIDITY;
	param.content.channelValidity.channelNum = channelNum;
	param.content.channelValidity.channelValidity = validity;
	regulatoryDomain_setParam(pSwitchChannel->hRegulatoryDomain, &param);

}
Exemplo n.º 5
0
static TI_STATUS connInfra_ScrWaitDisconn_to_disconnect(void *pData)
{
    TI_STATUS status;
    paramInfo_t *pParam;
    conn_t *pConn = (conn_t *)pData;
    
    status = rsn_stop(pConn->hRsn, pConn->disConEraseKeys);
    if (status != TI_OK)
        return status;

    pParam = (paramInfo_t *)os_memoryAlloc(pConn->hOs, sizeof(paramInfo_t));
    if (!pParam)
    {
        return TI_NOK;
    }

    pParam->paramType = RX_DATA_PORT_STATUS_PARAM;
    pParam->content.rxDataPortStatus = CLOSE;
    status = rxData_setParam(pConn->hRxData, pParam);
    if (status == TI_OK) 
    {
        /* Update TxMgmtQueue SM to close Tx path for all except Mgmt packets. */
        txMgmtQ_SetConnState (pConn->hTxMgmtQ, TX_CONN_STATE_MGMT);

        pParam->paramType = REGULATORY_DOMAIN_DISCONNECT_PARAM;
        regulatoryDomain_setParam(pConn->hRegulatoryDomain, pParam);

        status = mlme_stop( pConn->hMlme, DISCONNECT_IMMEDIATE, pConn->disConnReasonToAP );
        if (status == TI_OK) 
        {
            /* Must be called AFTER mlme_stop. since De-Auth packet should be sent with the
                supported rates, and stopModules clears all rates. */
            stopModules(pConn, TI_TRUE);
    
            /* send disconnect command to firmware */
            prepare_send_disconnect(pData);
        }
    }

    os_memoryFree(pConn->hOs, pParam, sizeof(paramInfo_t));
    return status;
}
Exemplo n.º 6
0
static TI_STATUS connect_to_disassociate(void *pData)
{
    TI_STATUS status;
    paramInfo_t param;
    conn_t *pConn = (conn_t *)pData;

    status = rsn_stop(pConn->hRsn, pConn->disConEraseKeys);
    if (status != OK)
        return status;

    param.paramType = RX_DATA_PORT_STATUS_PARAM;
    param.content.rxDataPortStatus = CLOSE;
    status = rxData_setParam(pConn->hRxData, &param);
    if (status != OK)
        return status;

    param.paramType = TX_DATA_PORT_STATUS_PARAM;
    param.content.txDataPortStatus = CLOSE;
    status = txData_setParam(pConn->hTxData, &param);
    if (status != OK)
        return status;

    param.paramType = REGULATORY_DOMAIN_DISCONNECT_PARAM;
    regulatoryDomain_setParam(pConn->hRegulatoryDomain, &param);

    /* Start the disconnect complete time out timer. 
        This should be done BEFORE calling mlme_stop, which invokes Disconect Complete
        event, which stops the timer. */
    os_timerStart(pConn->hOs, pConn->pTimer, DISCONNECT_TIMEOUT, FALSE);

    status = mlme_stop( pConn->hMlmeSm, pConn->disConnType, pConn->disConnReasonToAP );
    if (status != OK)
        return status;

    /* Must be called AFTER mlme_stop. since De-Auth packet should be sent with the
        supported rates, and stopModules clears all rates. */
    stopModules(pConn);

    return OK;

}
Exemplo n.º 7
0
static TI_STATUS JoinWait_to_mlmeWait(void *pData)
{
    TI_STATUS status;
    paramInfo_t param;
    conn_t *pConn = (conn_t *)pData;

    txData_start(pConn->hTxData);

    param.paramType = REGULATORY_DOMAIN_TX_POWER_AFTER_SELECTION_PARAM;
    regulatoryDomain_setParam(pConn->hRegulatoryDomain, &param);

    param.paramType = RX_DATA_PORT_STATUS_PARAM;
    param.content.rxDataPortStatus = OPEN_NOTIFY;
    status = rxData_setParam(pConn->hRxData, &param);
    if (status != OK)
        return status;

    param.paramType = TX_DATA_PORT_STATUS_PARAM;
    param.content.txDataPortStatus = OPEN_NOTIFY;
    status = txData_setParam(pConn->hTxData, &param);
    if (status != OK)
        return status;

    /* 
     * Set the reassociation flag in the association logic.
     */ 
    param.paramType = MLME_RE_ASSOC_PARAM;

    if( pConn->connType == CONN_TYPE_ROAM )
        param.content.mlmeReAssoc = TRUE;
    else 
        param.content.mlmeReAssoc = FALSE;

    status = mlme_setParam(pConn->hMlmeSm, &param);

    return mlme_start(pConn->hMlmeSm);
}
Exemplo n.º 8
0
void switchChannel_recvCmd(TI_HANDLE hSwitchChannel, dot11_CHANNEL_SWITCH_t *channelSwitch, TI_UINT8 channel)
{

	switchChannel_t             *pSwitchChannel = (switchChannel_t *)hSwitchChannel;
	paramInfo_t                 param;


	if (pSwitchChannel==NULL) {
		return;
	}

	param.paramType = REGULATORY_DOMAIN_DFS_CHANNELS_RANGE;
	regulatoryDomain_getParam(pSwitchChannel->hRegulatoryDomain, &param);

	if (!pSwitchChannel->dot11SpectrumManagementRequired ||
	        (channel < param.content.DFS_ChannelRange.minDFS_channelNum) ||
	        (channel > param.content.DFS_ChannelRange.maxDFS_channelNum)) {   /* Do not parse Switch Channel IE, when SpectrumManagement is disabled,
            or the channel is non-DFS channel */
		return;
	}
#ifdef TI_DBG
	/* for debug purposes only */
	if (pSwitchChannel->ignoreCancelSwitchChannelCmd != 0) {
		return;
	}
#endif

	if (channelSwitch == NULL) {  /* No SC IE, update regDomain */
		param.paramType = REGULATORY_DOMAIN_UPDATE_CHANNEL_VALIDITY;
		param.content.channel = channel;
		regulatoryDomain_setParam(pSwitchChannel->hRegulatoryDomain, &param);
	} else {  /* SC IE exists */

		/* Checking channel number validity */
		param.content.channel = channelSwitch->channelNumber;
		param.paramType = REGULATORY_DOMAIN_IS_CHANNEL_SUPPORTED;
		regulatoryDomain_getParam(pSwitchChannel->hRegulatoryDomain,&param);
		if ( ( !param.content.bIsChannelSupprted )   ||
		        (channelSwitch->channelSwitchCount == 0) ||
		        (channelSwitch->channelSwitchMode == SC_SWITCH_CHANNEL_MODE_TX_SUS)) {   /* Trigger Roaming, if TX mode is disabled, the new channel number is invalid,
                or the TBTT count is 0 */

			if (channelSwitch->channelSwitchMode == SC_SWITCH_CHANNEL_MODE_TX_SUS) {
				param.paramType = REGULATORY_DOMAIN_SET_CHANNEL_VALIDITY;
				param.content.channelValidity.channelNum = channel;
				param.content.channelValidity.channelValidity = TI_FALSE;
				regulatoryDomain_setParam(pSwitchChannel->hRegulatoryDomain, &param);
			}

			if (TI_TRUE == pSwitchChannel->switchChannelStarted) {
				apConn_reportRoamingEvent(pSwitchChannel->hApConn, ROAMING_TRIGGER_SWITCH_CHANNEL, NULL);
			}

		} else {  /* Invoke Switch Channel command */
			/* update the new SCC params */
			pSwitchChannel->curChannelSwitchCmdParams.channelNumber = channelSwitch->channelNumber;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchCount = channelSwitch->channelSwitchCount;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchMode = channelSwitch->channelSwitchMode;
			switchChannel_smEvent((TI_UINT8*)&pSwitchChannel->currentState, SC_EVENT_SC_CMD, pSwitchChannel);
		}

	}

}