コード例 #1
0
TI_HANDLE roamingMngr_create(TI_HANDLE hOs)
{
	roamingMngr_t   *pRoamingMngr;
	TI_UINT32          initVec;

	initVec = 0;

	pRoamingMngr = os_memoryAlloc(hOs, sizeof(roamingMngr_t));
	if (pRoamingMngr == NULL)
		return NULL;

	initVec |= (1 << ROAMING_MNGR_CONTEXT_INIT_BIT);
	pRoamingMngr->hOs   = hOs;

	/* allocate the state machine object */
	pRoamingMngr->hRoamingSm = genSM_Create(hOs);

	if (pRoamingMngr->hRoamingSm == NULL) {
		roamingMngr_releaseModule(pRoamingMngr, initVec);
		WLAN_OS_REPORT(("FATAL ERROR: roamingMngr_create(): Error Creating pRoamingSm - Aborting\n"));
		return NULL;
	}
	initVec |= (1 << ROAMING_MNGR_SM_INIT_BIT);


	return pRoamingMngr;
}
コード例 #2
0
ファイル: ScanCncnSm.c プロジェクト: Achotjan/FreeXperia
/** 
 * \fn     scanCncnSm_Create 
 * \brief  Cerates a scan concentrator client object
 * 
 * Cerates a scan concentrator client - allocates object and create a state-machine instance
 * 
 * \param  hOS - handle to the OS object
 * \return Handle to the new scan concentrator client object
 * \sa     scanCncnSm_Init, scanCncnSm_Destroy
 */ 
TI_HANDLE scanCncnSm_Create (TI_HANDLE hOS)
{
    TScanCncnClient *pScanCncnClient;

    /* allocate space for the scan concentartor client object */
    pScanCncnClient = os_memoryAlloc (hOS, sizeof (TScanCncnClient));
    if (NULL == pScanCncnClient)
    {
        WLAN_OS_REPORT (("scanCncnSm_Cretae: not enough space for scan concentrator client object\n"));
        return NULL;
    }

    /* store the OS object handle */
    pScanCncnClient->hOS = hOS;

    /* allocate the state machine object */
    pScanCncnClient->hGenSM = genSM_Create (hOS);
    if (NULL == pScanCncnClient->hGenSM)
    {
        WLAN_OS_REPORT (("scanCncnSm_Cretae: not enough space for scan concentrator client state-machine\n"));
        return NULL;
    }

    /* return the new object */
    return (TI_HANDLE)pScanCncnClient;
}
コード例 #3
0
/** 
 * \fn     sme_Create 
 * \brief  Creates the SME module. Allocates system resources
 * 
 * Creates the SME module. Allocates system resources
 * 
 * \param  hOS - handle to the OS adaptation layer
 * \return Handle to the SME object
 * \sa     sme_Init, sme_SetDefaults, sme_Destroy
 */ 
TI_HANDLE sme_Create (TI_HANDLE hOS)
{
    TSme    *pSme;

    /* allocate space for the SME object */
    pSme = (TSme*)os_memoryAlloc (hOS, sizeof (TSme));
    if (NULL == pSme)
    {
        WLAN_OS_REPORT (("sme_Create: unable to allocate memor yfor SME object. SME craetion failed\n"));
        return NULL;
    }

    /*  nullify SME object */
    os_memoryZero (hOS, (void*)pSme, sizeof (TSme));

    /* store OS handle */
    pSme->hOS = hOS;
    
    /* Create SME generic state-machine */
    pSme->hSmeSm = genSM_Create (hOS);
    if (NULL == pSme->hSmeSm)
    {
        WLAN_OS_REPORT (("sme_Create: unable to create SME generic SM. SME creation failed\n"));
        sme_Destroy ((TI_HANDLE)pSme);
        return NULL;
    }

    /* Create SME scan result table */
    pSme->hScanResultTable = scanResultTable_Create (hOS);
    if (NULL == pSme->hScanResultTable)
    {
        WLAN_OS_REPORT (("sme_Create: unable to create scan result table. SME creation failed\n"));
        sme_Destroy ((TI_HANDLE)pSme);
        return NULL;
    }

    return (TI_HANDLE)pSme;
}
コード例 #4
0
ファイル: mlme.c プロジェクト: nadlabak/tiwlan
/**
*
* mlme_Create - allocate memory for MLME SM
*
* \b Description:
* Allocate memory for MLME SM. \n
*       Allocates memory for MLME context. \n
*       Allocates memory for MLME timer. \n
*       Allocates memory for MLME SM matrix. \n
*
* \b ARGS:
*  I   - pOs - OS context  \n
*
* \b RETURNS:
*  TI_OK if successful, TI_NOK otherwise.
*
* \sa rsn_mainSecSmKeysOnlyStop()
*/
TI_HANDLE mlme_create(TI_HANDLE hOs)
{
    mlme_t  *pHandle;
    /* allocate MLME context memory */
    pHandle = (mlme_t*)os_memoryAlloc(hOs, sizeof(mlme_t));
    if (pHandle == NULL)
    {
        return NULL;
    }

	/* nullify the MLME object */
    os_memoryZero(hOs, (void*)pHandle, sizeof(mlme_t));

	pHandle->hMlmeSm = genSM_Create (hOs);
	if (NULL == pHandle->hMlmeSm)
	{
		WLAN_OS_REPORT (("mlme_Create: unable to create MLME generic SM. MLME creation failed\n"));
		mlme_destroy ((TI_HANDLE)pHandle);
		return NULL;
	}

    pHandle->hOs = hOs;
    return pHandle;
}
コード例 #5
0
/** 
 * \fn     scanCncnOsSm_Create
 * \brief  Creates the OS scan state-machine
 * 
 * creates the OS scan state-machine
 * 
 * \param  hScanCncn - handle to the scan concentrator object
 * \return Handle to the newly created OS san SM, NULL if an error occured
 * \sa     scanCncnOsSm_Create, scanCncnOsSm_Destroy
 */
TI_HANDLE scanCncnOsSm_Create (TI_HANDLE hScanCncn)
{
    TScanCncn       *pScanCncn = (TScanCncn*)hScanCncn;

    return genSM_Create (pScanCncn->hOS);
}