示例#1
0
文件: smeSm.c 项目: nadlabak/tiwlan
/** 
 * \fn     smeSm_Start
 * \brief  Starts STA opeartion by moving SCR out of idle group and starting connection process
 * 
 * Starts STA opeartion by moving SCR out of idle group and starting connection process
 * 
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_Stop, sme_start 
 */ 
void smeSm_Start (TI_HANDLE hSme)
{
    TSme    *pSme = (TSme*)hSme;
//joetest
TRACE0(pSme->hReport, REPORT_SEVERITY_SM , "smeSm_Start!!!\n");
    /* set SCR group according to connection mode */
    if (CONNECT_MODE_AUTO == pSme->eConnectMode)
    {
        TRACE0(pSme->hReport, REPORT_SEVERITY_INFORMATION , "smeSm_Start: changing SCR group to DRV scan\n");
        scr_setGroup (pSme->hScr, SCR_GID_DRV_SCAN);
    }
    else
    {
        TRACE0(pSme->hReport, REPORT_SEVERITY_INFORMATION , "smeSm_Start: changing SCR group to APP scan\n");
        scr_setGroup (pSme->hScr, SCR_GID_APP_SCAN);
    }

    if ((TI_FALSE == pSme->bRadioOn) || (TI_FALSE == pSme->bRunning)) 
    {
        /* Radio is off so send stop event */
        sme_SmEvent (pSme->hSmeSm, SME_SM_EVENT_STOP, hSme);
    }
    else if (TI_TRUE == pSme->bConnectRequired)
    {
        /* if connection was required, start the process */
        sme_SmEvent (pSme->hSmeSm, SME_SM_EVENT_CONNECT, hSme);
    }
}
示例#2
0
/**
 * \fn     rolesMgr_start
 * \brief  RolesMgr start command API
 *
 * Start RolesMgr object - send configuration & start cmd to FW
 */
TI_STATUS rolesMgr_start(TI_HANDLE hRolesMgr)
{
	tRolesMgr *pRolesMgr = (tRolesMgr *)hRolesMgr;

	/* set SCR group according to connection mode - to be removed later [liorC] */
	scr_setGroup (pRolesMgr->hScr, SCR_GID_DRV_SCAN);

	return roleAP_start(pRolesMgr->hRoleAP, 0);
}
示例#3
0
/**
 * \fn     smeSm_Start
 * \brief  Starts STA opeartion by moving SCR out of idle group and starting connection process
 *
 * Starts STA opeartion by moving SCR out of idle group and starting connection process
 *
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_Stop, sme_start
 */
void smeSm_Start (TI_HANDLE hSme)
{
	TSme    *pSme = (TSme*)hSme;

	/* set SCR group according to connection mode */
	if (CONNECT_MODE_AUTO == pSme->eConnectMode) {
		scr_setGroup (pSme->hScr, SCR_GID_DRV_SCAN);
	} else {
		scr_setGroup (pSme->hScr, SCR_GID_APP_SCAN);
	}

	if ((TI_FALSE == pSme->bRadioOn) || (TI_FALSE == pSme->bRunning)) {
		/* Radio is off so send stop event */
		sme_SmEvent (pSme->hSmeSm, SME_SM_EVENT_STOP, hSme);
	} else if (TI_TRUE == pSme->bConnectRequired) {
		/* if connection was required, start the process */
		sme_SmEvent (pSme->hSmeSm, SME_SM_EVENT_CONNECT, hSme);
	}
}
示例#4
0
/**
 * \fn     smeSm_Stop
 * \brief  Turns off the STA
 *
 * Turns off the STA by moving the SCr to idle
 *
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_Start, sme_Stop
 */
void smeSm_Stop (TI_HANDLE hSme)
{
	TSme    *pSme = (TSme*)hSme;

	/* set SCR group to idle */
	scr_setGroup (pSme->hScr, SCR_GID_IDLE);

	if (TI_FALSE == pSme->bRunning) {
		/* call DrvMain */
		drvMain_SmeStop (pSme->hDrvMain);
	}
}
示例#5
0
文件: smeSm.c 项目: nadlabak/tiwlan
/** 
 * \fn     smeSm_Connect
 * \brief  Starts a connection process with the selected network
 * 
 * Starts a connection process with the selected network
 * 
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_PreConnect, smeSm_ConnectSuccess
 */ 
void smeSm_Connect (TI_HANDLE hSme)
{
    TSme        *pSme = (TSme*)hSme;
    TI_STATUS       tStatus;
    paramInfo_t     *pParam;
//joetest
TRACE0(pSme->hReport, REPORT_SEVERITY_SM , "smeSm_Connect!!!\n");
    /* Sanity check - if no connection candidate was found so far */
    if (NULL == pSme->pCandidate)
    {
        TRACE0(pSme->hReport, REPORT_SEVERITY_ERROR , "smeSm_Connect: No candidate available, sending connect failure\n");
        sme_SmEvent (pSme->hSmeSm, SME_SM_EVENT_CONNECT_FAILURE, hSme);
    }
    else
    {      
        pParam = (paramInfo_t *)os_memoryAlloc(pSme->hOS, sizeof(paramInfo_t));
        if (!pParam)
        {
            return;
        }

       /* set SCR group */
       if (BSS_INFRASTRUCTURE == pSme->pCandidate->bssType)
       {
           scr_setGroup (pSme->hScr, SCR_GID_CONNECT);
       }

       /***************** Config Connection *************************/
       pParam->paramType = CONN_TYPE_PARAM;	
       if (BSS_INDEPENDENT == pSme->pCandidate->bssType)
           if (SITE_SELF == pSme->pCandidate->siteType)
           {
               pParam->content.connType = CONNECTION_SELF;
           }
           else
           {
               pParam->content.connType = CONNECTION_IBSS;
           }
       else
            pParam->content.connType = CONNECTION_INFRA;
       conn_setParam(pSme->hConn, pParam);   
       os_memoryFree(pSme->hOS, pParam, sizeof(paramInfo_t));

       /* start the connection process */
       tStatus = conn_start (pSme->hConn, CONN_TYPE_FIRST_CONN, sme_ReportConnStatus, hSme, TI_FALSE, TI_FALSE);
       if (TI_OK != tStatus)
       {
           TRACE1(pSme->hReport, REPORT_SEVERITY_ERROR , "smeSm_Connect: conn_start returned status %d\n", tStatus);
       }
    }
}
示例#6
0
/**
 * \fn     smeSm_ConnectSuccess
 * \brief  Handles connection success indication
 *
 * Handles connection success indication - starts AP conn and set SCR group to connected
 *
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_PreConnect, smeSm_Connect
 */
void smeSm_ConnectSuccess (TI_HANDLE hSme)
{
	TSme        *pSme = (TSme*)hSme;

	pSme->uScanCount = 0;

	/* connection succedded to the connection candidate - start AP connection */
	if (BSS_INFRASTRUCTURE == pSme->pCandidate->bssType) {
		/* Start the AP connection */
		apConn_start (pSme->hApConn,
		              (pSme->tSsid.len != 0) && !OS_802_11_SSID_JUNK (pSme->tSsid.str, pSme->tSsid.len));
	}

	/* Set SCR group to connected */
	scr_setGroup (pSme->hScr, SCR_GID_CONNECTED);
}
示例#7
0
/**
 * \fn     smeSm_Disconnect
 * \brief  Starts a disconnect by calling the AP connection or connect modules
 *
 * Starts a disconnect by calling the AP connection or connect modules
 *
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_DisconnectDone
 */
void smeSm_Disconnect (TI_HANDLE hSme)
{
	TSme        *pSme = (TSme*)hSme;
	TI_STATUS   tStatus;

	/* set the SCr group to connecting */
	scr_setGroup (pSme->hScr, SCR_GID_CONNECT);

	if (BSS_INFRASTRUCTURE == pSme->pCandidate->bssType) {
		/* Call the AP connection to perform disconnect */
		tStatus = apConn_stop (pSme->hApConn, TI_TRUE);
	} else {
		/* In IBSS disconnect is done directly with the connection SM */
		tStatus = conn_stop(pSme->hConn, DISCONNECT_DE_AUTH, STATUS_UNSPECIFIED,
		                    TI_TRUE, sme_ReportConnStatus, hSme);
	}
}
示例#8
0
/**
 * \fn     smeSm_Connect
 * \brief  Starts a connection process with the selected network
 *
 * Starts a connection process with the selected network
 *
 * \param  hSme - handle to the SME object
 * \return None
 * \sa     smeSm_PreConnect, smeSm_ConnectSuccess
 */
void smeSm_Connect (TI_HANDLE hSme)
{
	TSme        *pSme = (TSme*)hSme;
	TI_STATUS       tStatus;
	paramInfo_t     *pParam;

	/* Sanity check - if no connection candidate was found so far */
	if (NULL == pSme->pCandidate) {
		genSM_Event (pSme->hSmeSm, SME_SM_EVENT_CONNECT_FAILURE, hSme);
	} else {
		pParam = (paramInfo_t *)os_memoryAlloc(pSme->hOS, sizeof(paramInfo_t));
		if (!pParam) {
			return;
		}

		/* set SCR group */
		if (BSS_INFRASTRUCTURE == pSme->pCandidate->bssType) {
			scr_setGroup (pSme->hScr, SCR_GID_CONNECT);
		}

		/***************** Config Connection *************************/
		pParam->paramType = CONN_TYPE_PARAM;
		if (BSS_INDEPENDENT == pSme->pCandidate->bssType)
			if (SITE_SELF == pSme->pCandidate->siteType) {
				pParam->content.connType = CONNECTION_SELF;
			} else {
				pParam->content.connType = CONNECTION_IBSS;
			}
		else
			pParam->content.connType = CONNECTION_INFRA;
		conn_setParam(pSme->hConn, pParam);
		os_memoryFree(pSme->hOS, pParam, sizeof(paramInfo_t));

		/* start the connection process */
		tStatus = conn_start (pSme->hConn, CONN_TYPE_FIRST_CONN, sme_ReportConnStatus, hSme, TI_FALSE, TI_FALSE);
	}
}
示例#9
0
/**
 * \\n
 * \date 01-May-2005\n
 * \brief Change the SCR group.\n
 *
 * Function Scope \e Public.\n
 * \param hScr - handle to the SCR object.\n
 * \param group - the group to change to.\n
 */
void changeGroup( TI_HANDLE hScr, EScrGroupId group )
{
	scr_setGroup( hScr, group );
	WLAN_OS_REPORT(("SCR group was changed to %s\n",
	                groupDesc[ group ]));
}