예제 #1
0
파일: mlme.c 프로젝트: nadlabak/tiwlan
/** 
 * \fn     mlme_assocSSIDBuild 
 * \brief  builds the SSID IE of assoc request 
 * 
 * builds the SSID IE of assoc request according to the mlme params 
 * 
 * \param  pCtx - pointer to mlme_t
 * \param  pSSID - <output> pointer to the built SSID buffer
 * \param  ssidLen - <output> length of the built SSID buffer

 * \return TI_OK if auth send successfully
 *         TI_NOK otherwise
 * 
 * \sa     mlme_assocRequestMsgBuild 
 */ 
TI_STATUS mlme_assocSSIDBuild(mlme_t *pCtx, TI_UINT8 *pSSID, TI_UINT32 *ssidLen)
{
    paramInfo_t         param;
    TI_STATUS               status;
    dot11_SSID_t        *pDot11Ssid;

    pDot11Ssid = (dot11_SSID_t*)pSSID;
    /* set SSID element id */
    pDot11Ssid->hdr[0] = SSID_IE_ID;

    /* get SSID */
    param.paramType = SME_DESIRED_SSID_ACT_PARAM;
    status =  sme_GetParam(pCtx->hSme, &param);
    if (status != TI_OK)
    {
        return status;
    }

    /* check for ANY ssid */
    if (param.content.smeDesiredSSID.len != 0)
    {
        pDot11Ssid->hdr[1] = param.content.smeDesiredSSID.len;
        os_memoryCopy(pCtx->hOs,
                      (void *)pDot11Ssid->serviceSetId,
                      (void *)param.content.smeDesiredSSID.str,
                      param.content.smeDesiredSSID.len);

    } else {
        /* if ANY ssid is configured, use the current SSID */
        param.paramType = SITE_MGR_CURRENT_SSID_PARAM;
        status =  siteMgr_getParam(pCtx->hSiteMgr, &param);
        if (status != TI_OK)
        {
            return status;
        }
        pDot11Ssid->hdr[1] = param.content.siteMgrCurrentSSID.len;
        os_memoryCopy(pCtx->hOs,
                      (void *)pDot11Ssid->serviceSetId,
                      (void *)param.content.siteMgrCurrentSSID.str,
                      param.content.siteMgrCurrentSSID.len);

    }

    *ssidLen = pDot11Ssid->hdr[1] + sizeof(dot11_eleHdr_t);

    return TI_OK;
}
예제 #2
0
/** 
 * \fn     StaCap_IsHtEnable
 * \brief  verify if HT enable\disable at the STA according to 11n_Enable init flag and Chip type   
 * 
 * \note   
 * \param  hStaCap - The module object
 * \param  b11nEnable - pointer to enable\disable flag 
 * \return NONE 
 * \sa     
 */
void StaCap_IsHtEnable(TI_HANDLE hStaCap, TI_BOOL * b11nEnable)
{
	TStaCap *pStaCap = (TStaCap *) hStaCap;
	TTwdHtCapabilities *pTwdHtCapabilities;
	paramInfo_t tParam;

	tParam.paramType = SME_DESIRED_BSS_TYPE_PARAM;
	sme_GetParam(pStaCap->hSme, &tParam);

	/* If Infra-BSS, get actual HT capabilities from TWD */
	if (tParam.content.smeDesiredBSSType == BSS_INFRASTRUCTURE) {
		TWD_GetTwdHtCapabilities(pStaCap->hTWD, &pTwdHtCapabilities);
		*b11nEnable = pTwdHtCapabilities->b11nEnable;
	}
	/* If IBSS, HT shouldn't be used */
	else {
		*b11nEnable = TI_FALSE;
	}
}