コード例 #1
0
ファイル: conn.c プロジェクト: aleho/ti_wilink
TI_STATUS conn_ibssMerge(TI_HANDLE hConn)
{
	conn_t *pConn = (conn_t *)hConn;

	conn_ibssSMEvent(&pConn->state, CONN_IBSS_MERGE, pConn);
	return TI_OK;
}
コード例 #2
0
ファイル: conn.c プロジェクト: aleho/ti_wilink
/***********************************************************************
 *                        conn_join									
 ***********************************************************************
DESCRIPTION:	Called by the site manager when detecting that another station joined our own created IBSS 
				Valid only if the current connection type is self
				This function calls the self connection SM with join event
                                                                                                   
INPUT:      hConn	-	Connection handle.

OUTPUT:		

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
TI_STATUS conn_ibssStaJoined(TI_HANDLE hConn)
{
	conn_t *pConn = (conn_t *)hConn;

	conn_ibssSMEvent(&pConn->state, CONN_IBSS_STA_JOINED, pConn);
	return TI_OK;
}
コード例 #3
0
ファイル: conn.c プロジェクト: aleho/ti_wilink
/***********************************************************************
 *                        conn_timeout									
 ***********************************************************************
DESCRIPTION:	Called by the OS abstraction layer when the self timer expired 
				Valid only if the current connection type is self
				This function calls the self connection SM with timeout event
                                                                                                   
INPUT:      hConn	-	Connection handle.
            bTwdInitOccured -   Indicates if TWDriver recovery occured since timer started 

OUTPUT:		

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
void conn_timeout (TI_HANDLE hConn, TI_BOOL bTwdInitOccured)
{
	conn_t *pConn = (conn_t *)hConn;

	switch(pConn->currentConnType)
	{
	case CONNECTION_IBSS:
	case CONNECTION_SELF:
		conn_ibssSMEvent(&pConn->state, CONN_IBSS_DISCONNECT, pConn);
		break;

	case CONNECTION_INFRA:
		conn_infraSMEvent(&pConn->state, CONN_INFRA_DISCONN_COMPLETE, (TI_HANDLE) pConn);
        /* Initiate recovery only if not already occured. */
        if (!bTwdInitOccured) 
        {
		healthMonitor_sendFailureEvent(pConn->hHealthMonitor, DISCONNECT_TIMEOUT);
        }
		break;

	case CONNECTION_NONE:
		break;
	}

	return;
}
コード例 #4
0
ファイル: conn.c プロジェクト: Achotjan/FreeXperia
/***********************************************************************
 *                        conn_reportRsnStatus
 ***********************************************************************
DESCRIPTION:	Called by the RSN SM when RSN status changed.
				This function calls the current connection SM with RSN success or RSN failure based on the status

INPUT:      hConn	-	Connection handle.
			status	-	RSN status

OUTPUT:

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
TI_STATUS conn_reportRsnStatus(TI_HANDLE			hConn,
                               mgmtStatus_e		status)
{
	conn_t *pConn = (conn_t *)hConn;

	/* Save the reason for the use of the SME when triggering DISASSOCIATE event. For now we just have STATUS_SECURITY_FAILURE */
	pConn->smContext.disAssocEventReason = status;
	pConn->smContext.disAssocEventStatusCode = 1; /* we use this status at SME, if != 0 means that assoc frame sent */

	switch (pConn->currentConnType)
	{
	case CONNECTION_IBSS:
	case CONNECTION_SELF:
		if (status == STATUS_SUCCESSFUL)
			return conn_ibssSMEvent(&pConn->state, CONN_IBSS_RSN_SUCC, (TI_HANDLE) pConn);
		else
			return conn_ibssSMEvent(&pConn->state, CONN_IBSS_DISCONNECT, (TI_HANDLE) pConn);



	case CONNECTION_INFRA:
		if (status == STATUS_SUCCESSFUL)
			return conn_infraSMEvent(&pConn->state, CONN_INFRA_RSN_SUCC, (TI_HANDLE) pConn);

		else  /* status == STATUS_SECURITY_FAILURE */
		{
			/*
			 * In infrastructure - if the connection is standard 802.11 connection (ESS) then
			 * need to disassociate. In roaming mode, the connection is stopped without sending
			 * the reassociation frame.
			 */
			if ( pConn->connType == CONN_TYPE_ROAM )
				pConn->disConnType = DISCONNECT_IMMEDIATE;
			else /* connType == CONN_TYPE_ESS */
				pConn->disConnType = DISCONNECT_DE_AUTH;

			TRACE3(pConn->hReport, REPORT_SEVERITY_INFORMATION, "conn_reportRsnStatus, disAssocEventReason %d, connType=%d, disConnType=%d \n\n", pConn->smContext.disAssocEventReason, pConn->connType, pConn->disConnType);

			return conn_infraSMEvent(&pConn->state, CONN_INFRA_DISCONNECT, (TI_HANDLE) pConn);
		}
	case CONNECTION_NONE:
		break;
	}

	return TI_OK;
}
コード例 #5
0
ファイル: conn.c プロジェクト: aleho/ti_wilink
/***********************************************************************
 *                        conn_start									
 ***********************************************************************
DESCRIPTION: Called by the SME SM in order to start the connection SM
			 This function start the current connection SM	
                                                                                                   
INPUT:      hConn	-	Connection handle.

OUTPUT:		

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
TI_STATUS conn_start(TI_HANDLE hConn, 
                     EConnType connType,
		     conn_status_callback_t  pConnStatusCB,
		     TI_HANDLE connStatCbObj,
   		     TI_BOOL disConEraseKeys,
		     TI_BOOL reNegotiateTspec)
{
	conn_t *pConn = (conn_t *)hConn;
	paramInfo_t param;

	pConn->pConnStatusCB = pConnStatusCB;
	pConn->connStatCbObj = connStatCbObj;

	pConn->connType = connType;
	pConn->disConEraseKeys = disConEraseKeys;
	
	/* Initialize the DISASSOCIATE event parameters to default */ 
	pConn->smContext.disAssocEventReason = STATUS_UNSPECIFIED;
	pConn->smContext.disAssocEventStatusCode  = 0;

	
	/* If requested, re-negotiate voice TSPEC */
	param.paramType = QOS_MNGR_VOICE_RE_NEGOTIATE_TSPEC;
	param.content.TspecConfigure.voiceTspecConfigure = reNegotiateTspec; 
    param.content.TspecConfigure.videoTspecConfigure = reNegotiateTspec; 

	qosMngr_setParams(pConn->hQosMngr, &param);

	switch(pConn->currentConnType)
	{
	case CONNECTION_IBSS:
		return conn_ibssSMEvent(&pConn->state, CONN_IBSS_CONNECT, (TI_HANDLE) pConn);

	case CONNECTION_SELF:
		return conn_ibssSMEvent(&pConn->state, CONN_IBSS_CREATE, (TI_HANDLE) pConn);

	case CONNECTION_INFRA:
		return conn_infraSMEvent(&pConn->state, CONN_INFRA_CONNECT, (TI_HANDLE) pConn);

    default:
TRACE1(pConn->hReport, REPORT_SEVERITY_ERROR, "Start connection, invalid type %d\n\n", pConn->currentConnType);
		return TI_NOK;

	}
}
コード例 #6
0
ファイル: conn.c プロジェクト: aleho/ti_wilink
/***********************************************************************
 *                        conn_stop									
 ***********************************************************************
DESCRIPTION: Called by the SME SM in order to stop the connection SM
			 This function stop the current connection SM.	
                                                                                                   
INPUT:      hConn	-	Connection handle.

OUTPUT:		

RETURN:     TI_OK on success, TI_NOK otherwise

************************************************************************/
TI_STATUS conn_stop(TI_HANDLE 				hConn, 
					DisconnectType_e		disConnType, 
					mgmtStatus_e 			reason,
					TI_BOOL					disConEraseKeys,
					conn_status_callback_t  pConnStatusCB,
					TI_HANDLE 				connStatCbObj  )
{
	conn_t *pConn = (conn_t *)hConn;

	pConn->pConnStatusCB = pConnStatusCB;
	pConn->connStatCbObj = connStatCbObj;

	pConn->disConnType 	 = disConnType;
	pConn->disConnReasonToAP = reason;
	pConn->disConEraseKeys = disConEraseKeys;

	/* 
	 * Mark the disconnection reason as unspecified to indicate that conn module has no information regarding the DISASSOCIATE event to be raised
	 * by the SME
	 */
	pConn->smContext.disAssocEventReason = STATUS_UNSPECIFIED;
	pConn->smContext.disAssocEventStatusCode  = 0;


    TRACE3(pConn->hReport, REPORT_SEVERITY_INFORMATION, "conn_stop, disConnType %d, reason=%d, disConEraseKeys=%d\n\n", disConnType, reason, disConEraseKeys);

	switch(pConn->currentConnType)
	{
	case CONNECTION_IBSS:
	case CONNECTION_SELF:
        pConn->ibssDisconnectCount++;
		return conn_ibssSMEvent(&pConn->state, CONN_IBSS_DISCONNECT, (TI_HANDLE) pConn);

	case CONNECTION_INFRA:
		return conn_infraSMEvent(&pConn->state, CONN_INFRA_DISCONNECT, (TI_HANDLE) pConn);


	default:
TRACE1(pConn->hReport, REPORT_SEVERITY_ERROR, "Stop connection, invalid type %d\n\n", pConn->currentConnType);
		return TI_NOK;
	}
}
コード例 #7
0
ファイル: connIbss.c プロジェクト: ioz9/lewa_code_hardware
void connIbss_DisconnectComplete (conn_t *pConn, TI_UINT8  *data, TI_UINT8   dataLength)
{
    /* send an DISCONNECT COMPLETE event to the SM */
    conn_ibssSMEvent(&pConn->state, CONN_IBSS_DISCONN_COMPLETE, (TI_HANDLE) pConn);
}