本文整理汇总了C++中MAC_COPY函数的典型用法代码示例。如果您正苦于以下问题:C++ MAC_COPY函数的具体用法?C++ MAC_COPY怎么用?C++ MAC_COPY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAC_COPY函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildNullTemplate
/************************************************************************
* buildNullTemplate *
************************************************************************
DESCRIPTION: This function build a NULL data template to set to the HAL
when joining an infrastructure network
performs the following:
- Build a template & set the template len, the template type is set in the site mgr
INPUT: pSiteMgr - Handle to site manager
pTemplate - Pointer to the template structure
OUTPUT:
RETURN: TI_OK
************************************************************************/
TI_STATUS buildNullTemplate(siteMgr_t * pSiteMgr, TSetTemplate * pTemplate)
{
paramInfo_t param;
nullDataTemplate_t *pBuffer = (nullDataTemplate_t *) pTemplate->ptr;
siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
TI_UINT16 fc;
os_memoryZero(pSiteMgr->hOs, pBuffer, sizeof(nullDataTemplate_t));
/*
* Header First
*/
/* Set destination address */
MAC_COPY(pBuffer->hdr.DA, pPrimarySite->bssid);
/* Set BSSID address */
MAC_COPY(pBuffer->hdr.BSSID, pPrimarySite->bssid);
/* Build Source address */
param.paramType = CTRL_DATA_MAC_ADDRESS;
ctrlData_getParam(pSiteMgr->hCtrlData, ¶m);
MAC_COPY(pBuffer->hdr.SA, param.content.ctrlDataDeviceMacAddress);
fc = DOT11_FC_DATA_NULL_FUNCTION;
fc |= (TI_TRUE << DOT11_FC_TO_DS_SHIFT);
COPY_WLAN_WORD(&pBuffer->hdr.fc, &fc); /* copy with endianess handling. */
pTemplate->len = sizeof(dot11_mgmtHeader_t);
return TI_OK;
}
示例2: keyParserExternal_remove
TI_STATUS keyParserExternal_remove(struct _keyParser_t *pKeyParser, TI_UINT8 *pKeyData, TI_UINT32 keyDataLen)
{
TI_STATUS status;
OS_802_11_KEY *pKeyDesc;
paramInfo_t macParam;
encodedKeyMaterial_t encodedKeyMaterial;
TI_UINT8 broadcastMacAddr[MAC_ADDR_LEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
TI_UINT8 keyBuffer[MAC_ADDR_LEN+KEY_RSC_LEN+MAX_EXT_KEY_DATA_LENGTH];
if (pKeyData == NULL)
{
return TI_NOK;
}
pKeyDesc = (OS_802_11_KEY*)pKeyData;
if (pKeyDesc->KeyIndex & EXT_KEY_TRANSMIT_MASK)
{ /* Bit 31 should always be zero */
return TI_NOK;
}
if (pKeyDesc->KeyIndex & EXT_KEY_REMAIN_BITS_MASK)
{ /* Bits 8-29 should always be zero */
return TI_NOK;
}
encodedKeyMaterial.keyId = pKeyDesc->KeyIndex;
encodedKeyMaterial.keyLen = 0;
encodedKeyMaterial.pData = (char *) keyBuffer;
if (pKeyDesc->KeyIndex & EXT_KEY_PAIRWISE_GROUP_MASK)
{ /* delete all pairwise keys or for the current BSSID */
if (!MAC_EQUAL(pKeyDesc->BSSID, broadcastMacAddr))
{
MAC_COPY (keyBuffer, pKeyDesc->BSSID);
}
else
{
macParam.paramType = CTRL_DATA_CURRENT_BSSID_PARAM;
status = ctrlData_getParam(pKeyParser->hCtrlData, &macParam);
if (status != TI_OK)
{
return TI_NOK;
}
MAC_COPY (keyBuffer, macParam.content.ctrlDataCurrentBSSID);
}
status = pKeyParser->pUcastKey->pKeyDerive->remove(pKeyParser->pUcastKey->pKeyDerive, &encodedKeyMaterial);
}
else
{ /* delete all group keys or for the current BSSID */
MAC_COPY (keyBuffer, broadcastMacAddr);
status = pKeyParser->pBcastKey->pKeyDerive->remove(pKeyParser->pUcastKey->pKeyDerive, &encodedKeyMaterial);
}
return status;
}
示例3: buildPsPollTemplate
/************************************************************************
* buildPsPollTemplate *
************************************************************************
DESCRIPTION: This function build a ps poll template
performs the following:
- Build a template & set the template len, the template type is set in the site mgr
INPUT: pSiteMgr - Handle to site manager
pTemplate - Pointer to the template structure
pSsid - Desired SSID
OUTPUT:
RETURN: TI_OK
************************************************************************/
TI_STATUS buildPsPollTemplate(siteMgr_t * pSiteMgr, TSetTemplate * pTemplate)
{
paramInfo_t param;
TTwdParamInfo tTwdParam;
TI_UINT32 size;
psPollTemplate_t *pBuffer = (psPollTemplate_t *) pTemplate->ptr;
siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
TI_UINT16 fc;
os_memoryZero(pSiteMgr->hOs, pBuffer, sizeof(psPollTemplate_t));
/*
* Header First
*/
/* Set BSSID address */
MAC_COPY(pBuffer->hdr.BSSID, pPrimarySite->bssid);
/* Build Source address */
param.paramType = CTRL_DATA_MAC_ADDRESS;
ctrlData_getParam(pSiteMgr->hCtrlData, ¶m);
MAC_COPY(pBuffer->hdr.TA, param.content.ctrlDataDeviceMacAddress);
/*
** Building the Frame Control word (16 bits)
** ---------------------------------------------
** Type = Control
** SubType = Power Save (PS) POLL, */
fc = DOT11_FC_PS_POLL;
/*
** setting the Power Management bit in the Frame control field
** to be "Power Save mode"
*/
fc |= (0x1 << DOT11_FC_PWR_MGMT_SHIFT);
COPY_WLAN_WORD(&pBuffer->hdr.fc, &fc); /* copy with endianess handling. */
/*
** Association ID
** -----------------
*/
tTwdParam.paramType = TWD_AID_PARAM_ID;
TWD_GetParam(pSiteMgr->hTWD, &tTwdParam);
/* AID should have its two MSB bit Set to "1" */
pBuffer->hdr.AID = tTwdParam.content.halCtrlAid | 0xC000;
size = sizeof(dot11_PsPollFrameHeader_t);
pTemplate->len = size;
return TI_OK;
}
示例4: sendDataPacket
void sendDataPacket (TI_HANDLE hOs)
{
TI_UINT32 i;
TTxCtrlBlk * pPktCtrlBlk;
TI_UINT8 * pPktBuf;
TEthernetHeader tEthHeader;
char SrcBssid[6] = {0x88,0x88,0x88,0x88,0x88,0x88};
char DesBssid[6] = {0x22,0x22,0x22,0x22,0x22,0x22};
/* Allocate a TxCtrlBlk for the Tx packet and save timestamp, length and packet handle */
pPktCtrlBlk = TWD_txCtrlBlk_Alloc (tmp_hTWD);
if( NULL == pPktCtrlBlk )
{
os_printf("\n sendDataPacket() : pPktCtrlBlk returned as NULL from TWD_txCtrlBlk_Alloc() ");
return;
}
pPktCtrlBlk->tTxDescriptor.startTime = os_timeStampMs (hOs);
pPktCtrlBlk->tTxDescriptor.length = (TI_UINT16)packetLength + ETHERNET_HDR_LEN;
pPktCtrlBlk->tTxDescriptor.tid = 0;
pPktCtrlBlk->tTxPktParams.uPktType = TX_PKT_TYPE_ETHER;
/* Allocate buffer with headroom for getting the IP header in a 4-byte aligned address */
pPktBuf = txCtrl_AllocPacketBuffer (tmp_hTxCtrl, pPktCtrlBlk, packetLength + ETHERNET_HDR_LEN + 2);
/* Prepare Ethernet header */
tEthHeader.type = HTOWLANS(ETHERTYPE_IP);
MAC_COPY (tEthHeader.src, SrcBssid);
MAC_COPY (tEthHeader.dst, DesBssid);
if( pPktBuf )
{
os_memoryCopy (hOs, pPktBuf + 2, &tEthHeader, ETHERNET_HDR_LEN);
/* Build BDL */
BUILD_TX_TWO_BUF_PKT_BDL (pPktCtrlBlk,
pPktBuf + 2,
ETHERNET_HDR_LEN,
pPktBuf + 2 + ETHERNET_HDR_LEN,
packetLength)
/* Fill data buffer with incremented numbers */
for (i = 0; i < packetLength; i++)
{
*(pPktBuf + 2 + ETHERNET_HDR_LEN + i) = i;
}
}
else
{
示例5: keyDeriveTkip_derive
TI_STATUS keyDeriveTkip_derive(struct _keyDerive_t * pKeyDerive,
encodedKeyMaterial_t * pEncodedKey)
{
TI_STATUS status;
TSecurityKeys key;
keyMaterialTkip_t *keyMaterialTkip;
if (pEncodedKey == NULL) {
return TI_NOK;
}
key.keyType = KEY_TKIP;
key.keyIndex = (TI_UINT8) pEncodedKey->keyId;
key.encLen = KEY_DERIVE_TKIP_ENC_LEN;
/* Note: Reduce 2 bytes from the size of keyMaterialTkip_t in the following check,
because it is added as padding at the end due to the OS_PACKED removal. */
if (pEncodedKey->keyLen < (sizeof(keyMaterialTkip_t) - 2)) {
TRACE1(pKeyDerive->hReport, REPORT_SEVERITY_ERROR,
"KEY_DERIVE_TKIP: ERROR: wrong key length %d !!!\n",
pEncodedKey->keyLen);
return TI_NOK;
}
keyMaterialTkip = (keyMaterialTkip_t *) pEncodedKey->pData;
/* Copy encryption key */
os_memoryCopy(pKeyDerive->hOs, (void *)key.encKey,
(void *)keyMaterialTkip->encKey, KEY_DERIVE_TKIP_ENC_LEN);
if (pEncodedKey->keyId & 0x10000000) { /* Copy MIC RX */
os_memoryCopy(pKeyDerive->hOs, (void *)key.micTxKey,
(void *)keyMaterialTkip->micRxKey,
KEY_DERIVE_TKIP_MIC_LEN);
/* Copy MIC RX */
os_memoryCopy(pKeyDerive->hOs, (void *)key.micRxKey,
(void *)keyMaterialTkip->micTxKey,
KEY_DERIVE_TKIP_MIC_LEN);
} else { /* Copy MIC RX */
os_memoryCopy(pKeyDerive->hOs, (void *)key.micRxKey,
(void *)keyMaterialTkip->micRxKey,
KEY_DERIVE_TKIP_MIC_LEN);
/* Copy MIC RX */
os_memoryCopy(pKeyDerive->hOs, (void *)key.micTxKey,
(void *)keyMaterialTkip->micTxKey,
KEY_DERIVE_TKIP_MIC_LEN);
}
/* Copy MAC address key */
MAC_COPY(key.macAddress, keyMaterialTkip->macAddress);
/* Copy RSC */
os_memoryCopy(pKeyDerive->hOs, (void *)key.keyRsc,
(void *)keyMaterialTkip->keyRSC, KEY_RSC_LEN);
status = pKeyDerive->pMainKeys->setKey(pKeyDerive->pMainKeys, &key);
if (status == TI_OK) {
os_memoryCopy(pKeyDerive->hOs, &pKeyDerive->key, pEncodedKey,
sizeof(encodedKeyMaterial_t));
}
return status;
}
示例6: mainKeys_smTimeOut
/**
*
* mainKeySmLogMessage
*
* \b Description:
*
* Prints Log messge.\n
* Start session timer.
*
* \b ARGS:
*
* I - pData - station control block \n
*
* \b RETURNS:
*
* TI_OK on success, TI_NOK otherwise.
*/
TI_STATUS mainKeys_smTimeOut(void* data)
{
OS_802_11_AUTHENTICATION_REQUEST *request;
TI_UINT8 AuthBuf[sizeof(TI_UINT32) + sizeof(OS_802_11_AUTHENTICATION_REQUEST)];
paramInfo_t param;
TI_STATUS status;
struct _mainKeys_t *pMainKeys = (struct _mainKeys_t *)data;
TRACE1(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, "MAIN_KEY_SM: TRAP: Session Timeout for station , mainKeysTimeoutCounter=%d\n", pMainKeys->mainKeysTimeoutCounter);
request = (OS_802_11_AUTHENTICATION_REQUEST *)(AuthBuf + sizeof(TI_UINT32));
request->Length = sizeof(OS_802_11_AUTHENTICATION_REQUEST);
param.paramType = CTRL_DATA_CURRENT_BSSID_PARAM;
status = ctrlData_getParam(pMainKeys->hCtrlData, ¶m);
if (status != TI_OK)
{
return TI_NOK;
}
TRACE1(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, "current station is banned from the roaming candidates list for %d Ms\n", RSN_MAIN_KEYS_SESSION_TIMEOUT);
rsn_banSite(pMainKeys->hRsn, param.content.ctrlDataCurrentBSSID, RSN_SITE_BAN_LEVEL_FULL, RSN_MAIN_KEYS_SESSION_TIMEOUT);
/* mainKeysTimeoutCounter is a boolean variable, With states: */
/* TI_TRUE - It is a Timeout Association Event */
/* TI_FALSE - It is a Media specific Event */
if (!pMainKeys->mainKeysTimeoutCounter)
{
/* Fill Media specific indication fields and send to OS/User */
MAC_COPY (request->BSSID, param.content.ctrlDataCurrentBSSID);
request->Flags = OS_802_11_REQUEST_REAUTH;
*(TI_UINT32*)AuthBuf = os802_11StatusType_Authentication;
TRACE1(pMainKeys->hReport, REPORT_SEVERITY_INFORMATION, " %d Ms\n",RSN_MAIN_KEYS_SESSION_TIMEOUT);
EvHandlerSendEvent(pMainKeys->hEvHandler, IPC_EVENT_MEDIA_SPECIFIC, (TI_UINT8*)AuthBuf,
sizeof(TI_UINT32) + sizeof(OS_802_11_AUTHENTICATION_REQUEST));
tmr_StartTimer (pMainKeys->hSessionTimer,
mainKeys_sessionTimeout,
(TI_HANDLE)pMainKeys,
pMainKeys->keysTimeout,
TI_FALSE);
pMainKeys->mainKeysTimeoutCounter = TI_TRUE;
}
else
{
pMainKeys->mainKeysTimeoutCounter = TI_FALSE;
rsn_reportAuthFailure(pMainKeys->hRsn, RSN_AUTH_STATUS_TIMEOUT);
conn_reportRsnStatus(pMainKeys->hConn, (mgmtStatus_e)STATUS_SECURITY_FAILURE);
}
return TI_OK;
}
示例7: cmdBld_CfgGroupAddressTable
/****************************************************************************
* cmdBld_CfgGroupAddressTable()
****************************************************************************
* DESCRIPTION: Sets the Group table according to the given configuration.
*
* OUTPUT: None
*
* RETURNS: TI_OK or TI_NOK
****************************************************************************/
TI_STATUS cmdBld_CfgGroupAddressTable (TI_HANDLE hCmdBld,
TI_UINT8 uNumGroupAddr,
TMacAddr *pGroupAddr,
TI_BOOL bEnabled,
void *fCb,
TI_HANDLE hCb)
{
TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
TI_UINT32 i;
if (uNumGroupAddr > MAX_MULTICAST_GROUP_ADDRS) {
TRACE1(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_CfgGroupAddressTable: numGroupAddrs=%d\n", uNumGroupAddr);
return PARAM_VALUE_NOT_VALID;
}
if (NULL == pGroupAddr) {
TRACE2(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_CfgGroupAddressTable: numGroupAddrs=%d Group_addr=0x%x !!!\n", uNumGroupAddr, pGroupAddr);
return PARAM_VALUE_NOT_VALID;
}
/* Keeps the parameters in the db */
DB_WLAN(hCmdBld).numGroupAddrs = uNumGroupAddr;
DB_WLAN(hCmdBld).isMacAddrFilteringnabled = bEnabled;
for (i = 0; i < uNumGroupAddr; i++) {
MAC_COPY (DB_WLAN(hCmdBld).aGroupAddr[i], *(pGroupAddr + i));
}
return cmdBld_CfgIeGroupAdressTable (hCmdBld, uNumGroupAddr, pGroupAddr, bEnabled, fCb, hCb);
}
示例8: cmdBld_CfgSetFwHtCapabilities
/**
* \fn cmdBld_CfgSetFwHtCapabilities
* \brief set the current AP HT Capabilities to the FW.
*
* \note
* \return TI_OK on success or TI_NOK on failure
* \sa
*/
TI_STATUS cmdBld_CfgSetFwHtCapabilities (TI_HANDLE hCmdBld,
TI_UINT32 uHtCapabilites,
TMacAddr tMacAddress,
TI_UINT8 uAmpduMaxLeng,
TI_UINT8 uAmpduMinSpac,
void *fCb,
TI_HANDLE hCb)
{
CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_HT_CAPABILITIES)
DB_BSS(hCmdBld).bHtCap = TI_TRUE;
DB_BSS(hCmdBld).uHtCapabilites = uHtCapabilites;
MAC_COPY ((DB_BSS(hCmdBld).tMacAddress), tMacAddress);
DB_BSS(hCmdBld).uAmpduMaxLeng = uAmpduMaxLeng;
DB_BSS(hCmdBld).uAmpduMinSpac = uAmpduMinSpac;
return cmdBld_CfgIeSetFwHtCapabilities (hCmdBld,
uHtCapabilites,
tMacAddress,
uAmpduMaxLeng,
uAmpduMinSpac,
fCb,
hCb);
}
示例9: buildQosNullDataTemplate
/************************************************************************
* buildQosNullDataTemplate *
************************************************************************
DESCRIPTION: This function build a qos null data template
performs the following:
- Build a template & set the template len, the template type is set in the site mgr
INPUT: pSiteMgr - Handle to site manager
pTemplate - Pointer to the template structure
pSsid - Desired SSID
OUTPUT:
RETURN: TI_OK
************************************************************************/
TI_STATUS buildQosNullDataTemplate(siteMgr_t * pSiteMgr,
TSetTemplate * pTemplate,
TI_UINT8 userPriority)
{
paramInfo_t param;
TI_UINT32 size;
QosNullDataTemplate_t *pBuffer =
(QosNullDataTemplate_t *) pTemplate->ptr;
siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
TI_UINT16 fc;
TI_UINT16 qosControl;
os_memoryZero(pSiteMgr->hOs, pBuffer, sizeof(QosNullDataTemplate_t));
/*
* Header First
*/
/* Set destination address */
if (pPrimarySite) {
MAC_COPY(pBuffer->hdr.address1, pPrimarySite->bssid);
/* Set BSSID address */
MAC_COPY(pBuffer->hdr.address3, pPrimarySite->bssid);
} else {
TRACE0(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION,
"No Primary site so cannot fill QosNullData template\n");
}
/* Build Source address */
param.paramType = CTRL_DATA_MAC_ADDRESS;
ctrlData_getParam(pSiteMgr->hCtrlData, ¶m);
MAC_COPY(pBuffer->hdr.address2, param.content.ctrlDataDeviceMacAddress);
fc = DOT11_FC_DATA_NULL_QOS | (1 << DOT11_FC_TO_DS_SHIFT);
COPY_WLAN_WORD(&pBuffer->hdr.fc, &fc); /* copy with endianess handling. */
qosControl = (TI_UINT16) userPriority;
qosControl <<= QOS_CONTROL_UP_SHIFT;
COPY_WLAN_WORD(&pBuffer->hdr.qosControl, &qosControl); /* copy with endianess handling. */
size = WLAN_QOS_HDR_LEN;
pTemplate->len = size;
return TI_OK;
}
示例10: cmdBld_CmdIeSetKey
/****************************************************************************
* cmdBld_CmdIeSetKey()
****************************************************************************
* DESCRIPTION: Construct the SetKey command fileds and send it to the mailbox
*
* INPUTS:
* Action - add/remove key
* MacAddr - relevant only for mapping keys
* KeySize - key size
* KeyType - default/mapping/TKIP
* KeyId - relevant only for default keys
* Key - key data
*
* OUTPUT: None
*
* RETURNS: TI_OK or TI_NOK
****************************************************************************/
TI_STATUS cmdBld_CmdIeSetKey (TI_HANDLE hCmdBld,
TI_UINT32 action,
TI_UINT8 *pMacAddr,
TI_UINT32 uKeySize,
TI_UINT32 uKeyType,
TI_UINT32 uKeyId,
TI_UINT8 *pKey,
TI_UINT32 uSecuritySeqNumLow,
TI_UINT32 uSecuritySeqNumHigh,
void *fCb,
TI_HANDLE hCb)
{
TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
SetKey_t AcxCmd_SetKey;
SetKey_t *pCmd = &AcxCmd_SetKey;
os_memoryZero (pCmdBld->hOs, (void *)pCmd, sizeof(*pCmd));
MAC_COPY (pCmd->addr, pMacAddr);
if (uKeySize > MAX_KEY_SIZE)
{
os_memoryCopy (pCmdBld->hOs, (void *)pCmd->key, (void *)pKey, MAX_KEY_SIZE);
}
else
{
os_memoryCopy (pCmdBld->hOs, (void *)pCmd->key, (void *)pKey, uKeySize);
}
pCmd->action = ENDIAN_HANDLE_WORD((TI_UINT16)action);
pCmd->keySize = (TI_UINT8)uKeySize;
pCmd->type = (TI_UINT8)uKeyType;
pCmd->id = (TI_UINT8)uKeyId;
pCmd->ssidProfile = 0;
/*
* Preserve TKIP/AES security sequence number after recovery.
* Note that our STA Tx is currently using only one sequence-counter
* for all ACs (unlike the Rx which is separated per AC).
*/
pCmd->AcSeqNum16[0] = ENDIAN_HANDLE_WORD((TI_UINT16)uSecuritySeqNumLow);
pCmd->AcSeqNum16[1] = 0;
pCmd->AcSeqNum16[2] = 0;
pCmd->AcSeqNum16[3] = 0;
pCmd->AcSeqNum32[0] = ENDIAN_HANDLE_LONG(uSecuritySeqNumHigh);
pCmd->AcSeqNum32[1] = 0;
pCmd->AcSeqNum32[2] = 0;
pCmd->AcSeqNum32[3] = 0;
TRACE6(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION, "Addr: %02x:%02x:%02x:%02x:%02x:%02x\n", pCmd->addr[0],pCmd->addr[1],pCmd->addr[2],pCmd->addr[3],pCmd->addr[4],pCmd->addr[5]);
TRACE7(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION, "Action=%x,keySize=0x%x,type=%x, id=%x, ssidProfile=%x, AcSeqNum16[0]=%x, AcSeqNum32[0]=%x\n", pCmd->action,pCmd->keySize, pCmd->type,pCmd->id,pCmd->ssidProfile,pCmd->AcSeqNum16[0],pCmd->AcSeqNum32[0] );
return cmdQueue_SendCommand (pCmdBld->hCmdQueue, CMD_SET_KEYS, (char *)pCmd, sizeof(*pCmd), fCb, hCb, NULL);
}
示例11: sme_SelectRsnMatch
/**
* \fn sme_SelectRsnMatch
* \brief Checks if the configured scurity settings match those of a site
*
* Checks if the configured scurity settings match those of a site
*
* \param hSme - handle to the SME object
* \param pCurrentSite - the site to check
* \return TI_TRUE if site matches RSN settings, TI FALSE if it doesn't
* \sa sme_Select
*/
TI_BOOL sme_SelectRsnMatch (TI_HANDLE hSme, TSiteEntry *pCurrentSite)
{
TSme *pSme = (TSme*)hSme;
TRsnData tRsnData;
dot11_RSN_t *pRsnIe;
TI_UINT8 uRsnIECount=0;
TI_UINT8 uCurRsnData[255];
TI_UINT32 uLength = 0;
TI_UINT32 uMetric;
TRsnSiteParams tRsnSiteParams;
tRsnSiteParams.bssType = pCurrentSite->bssType;
MAC_COPY(tRsnSiteParams.bssid, pCurrentSite->bssid);
tRsnSiteParams.pHTCapabilities = &pCurrentSite->tHtCapabilities;
tRsnSiteParams.pHTInfo = &pCurrentSite->tHtInformation;
/* copy all RSN IE's */
pRsnIe = pCurrentSite->pRsnIe;
while ((uLength < pCurrentSite->rsnIeLen) && (uRsnIECount < MAX_RSN_IE))
{
if (uLength + 2 + pRsnIe->hdr[ 1 ] > sizeof (uCurRsnData))
{
TRACE4( pSme->hReport, REPORT_SEVERITY_ERROR,
"sme_SelectRsnMatch. uRsnIECount=%d, uLength=%d; required copy of %d bytes exceeds the buffer limit %d\n",
uRsnIECount, uLength, pRsnIe->hdr[ 1 ] +2, sizeof (uCurRsnData));
handleRunProblem(PROBLEM_BUF_SIZE_VIOLATION);
return TI_FALSE;
}
uCurRsnData[ 0 + uLength ] = pRsnIe->hdr[ 0 ];
uCurRsnData[ 1 + uLength ] = pRsnIe->hdr[ 1 ];
os_memoryCopy (pSme->hOS, &uCurRsnData[ 2 + uLength ], pRsnIe->rsnIeData, pRsnIe->hdr[ 1 ]);
uLength += pRsnIe->hdr[ 1 ] + 2;
pRsnIe += 1;
uRsnIECount++;
}
/* sanity check - make sure RSN IE's size is not too big */
if (uLength < pCurrentSite->rsnIeLen)
{
TRACE2(pSme->hReport, REPORT_SEVERITY_ERROR , "sme_SelectRsnMatch, RSN IE is too long: rsnIeLen=%d, MAX_RSN_IE=%d\n", pCurrentSite->rsnIeLen, MAX_RSN_IE);
}
/* call the RSN to evaluate the site */
tRsnData.pIe = (pCurrentSite->rsnIeLen == 0) ? NULL : uCurRsnData;
tRsnData.ieLen = pCurrentSite->rsnIeLen;
tRsnData.privacy = pCurrentSite->privacy;
if (rsn_evalSite (pSme->hRsn, &tRsnData, &tRsnSiteParams , &uMetric) != TI_OK)
{
/* no match */
return TI_FALSE;
}
else
{
/* match! */
return TI_TRUE;
}
}
示例12: cmdBld_CmdIeSetKey
/****************************************************************************
* cmdBld_CmdIeSetKey()
****************************************************************************
* DESCRIPTION: Construct the SetKey command fileds and send it to the mailbox
*
* INPUTS:
* Action - add/remove key
* MacAddr - relevant only for mapping keys
* KeySize - key size
* KeyType - default/mapping/TKIP
* KeyId - relevant only for default keys
* Key - key data
*
* OUTPUT: None
*
* RETURNS: TI_OK or TI_NOK
****************************************************************************/
TI_STATUS cmdBld_CmdIeSetKey (TI_HANDLE hCmdBld,
TI_UINT32 action,
TI_UINT8 *pMacAddr,
TI_UINT32 uKeySize,
TI_UINT32 uKeyType,
TI_UINT32 uKeyId,
TI_UINT8 *pKey,
TI_UINT32 uSecuritySeqNumLow,
TI_UINT32 uSecuritySeqNumHigh,
void *fCb,
TI_HANDLE hCb)
{
TCmdBld *pCmdBld = (TCmdBld *)hCmdBld;
SetKey_t AcxCmd_SetKey;
SetKey_t *pCmd = &AcxCmd_SetKey;
os_memoryZero (pCmdBld->hOs, (void *)pCmd, sizeof(*pCmd));
MAC_COPY (pCmd->addr, pMacAddr);
if (uKeySize > MAX_KEY_SIZE) {
os_memoryCopy (pCmdBld->hOs, (void *)pCmd->key, (void *)pKey, MAX_KEY_SIZE);
} else {
os_memoryCopy (pCmdBld->hOs, (void *)pCmd->key, (void *)pKey, uKeySize);
}
pCmd->action = ENDIAN_HANDLE_WORD((TI_UINT16)action);
pCmd->keySize = (TI_UINT8)uKeySize;
pCmd->type = (TI_UINT8)uKeyType;
pCmd->id = (TI_UINT8)uKeyId;
pCmd->ssidProfile = 0;
/*
* Preserve TKIP/AES security sequence number after recovery.
* If not in reconfig set to 0 so the FW will ignore it and keep its own number.
* Note that our STA Tx is currently using only one sequence-counter
* for all ACs (unlike the Rx which is separated per AC).
*/
if (pCmdBld->bReconfigInProgress == TI_FALSE) {
uSecuritySeqNumLow = uSecuritySeqNumHigh = 0;
}
pCmd->AcSeqNum16[0] = ENDIAN_HANDLE_WORD((TI_UINT16)uSecuritySeqNumLow);
pCmd->AcSeqNum16[1] = 0;
pCmd->AcSeqNum16[2] = 0;
pCmd->AcSeqNum16[3] = 0;
pCmd->AcSeqNum32[0] = ENDIAN_HANDLE_LONG(uSecuritySeqNumHigh);
pCmd->AcSeqNum32[1] = 0;
pCmd->AcSeqNum32[2] = 0;
pCmd->AcSeqNum32[3] = 0;
return cmdQueue_SendCommand (pCmdBld->hCmdQueue, CMD_SET_KEYS, (char *)pCmd, sizeof(*pCmd), fCb, hCb, NULL);
}
示例13: App_DevicesAllocCreate
/*****************************************************************************
* Function name: App_DevicesAllocCreate
* Description : This function creates Enet and IMA devices over the Enet
* ports created earlier. Also interworking host device is created for
* the host generation and termination of the packets.
* Input params: None
* Output params: None
* Return val : None
*****************************************************************************/
void App_DevicesAllocCreate (void)
{
/* Create device on Enet1 */
MAC_COPY (device_enet_cfg.mac_addr, wt_mac_enet1);
h_device_enet1 =
WP_DeviceCreate (h_port_enet1, WP_PHY (0), WP_DEVICE_ENET,
&device_enet_cfg);
App_TerminateOnError (h_device_enet1, "WP_DeviceCreate() Enet1");
/* Create device on Enet2 */
device_enet_cfg.loopbackmode = WP_ENET_NORMAL; /* no loop back */
MAC_COPY (device_enet_cfg.mac_addr, wt_mac_enet2);
h_device_enet2 =
WP_DeviceCreate (h_port_enet2, WP_PHY (0), WP_DEVICE_ENET,
&device_enet_cfg);
App_TerminateOnError (h_device_enet2, "WP_DeviceCreate() Enet2");
/* Create an IW Host Device */
h_dev_iwhost =
WP_DeviceCreate (h_port_iwhost, 0, WP_DEVICE_IW_HOST, NULL);
App_TerminateOnError (h_dev_iwhost, "WP_DeviceCreate() IW Host");
}
示例14: cmdBld_CfgSetBaSession
/**
* \fn cmdBld_CfgSetBaInitiator
* \brief configure BA session initiator\receiver parameters setting in the FW.
*
* \note
* \return TI_OK on success or TI_NOK on failure
* \sa
*/
TI_STATUS cmdBld_CfgSetBaSession (TI_HANDLE hCmdBld,
InfoElement_e eBaType,
TI_UINT8 uTid,
TI_UINT8 uState,
TMacAddr tRa,
TI_UINT16 uWinSize,
TI_UINT16 uInactivityTimeout,
void *fCb,
TI_HANDLE hCb)
{
if (ACX_BA_SESSION_INITIATOR_POLICY == eBaType) {
DB_BSS(hCmdBld).bBaInitiator[uTid] = TI_TRUE;
DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uTid = uTid;
DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uPolicy = uState;
MAC_COPY ((DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].aMacAddress),tRa);
DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uWinSize = uWinSize;
DB_BSS(hCmdBld).tBaSessionInitiatorPolicy[uTid].uInactivityTimeout = uInactivityTimeout;
} else {
DB_BSS(hCmdBld).bBaResponder[uTid] = TI_TRUE;
DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uTid = uTid;
DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uPolicy = uState;
MAC_COPY ((DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].aMacAddress),tRa);
DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uWinSize = uWinSize;
DB_BSS(hCmdBld).tBaSessionResponderPolicy[uTid].uInactivityTimeout = uInactivityTimeout;
}
CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld,__CFG_BA_SET_SESSION);
return cmdBld_CfgIeSetBaSession (hCmdBld,
eBaType,
uTid,
uState,
tRa,
uWinSize,
uInactivityTimeout,
fCb,
hCb);
}
示例15: buildDisconnTemplate
/************************************************************************
* buildDisconnTemplate *
************************************************************************
DESCRIPTION: This function build a Death/Disassoc template to set to the HAL
when joining an infrastructure network
performs the following:
- Build a template & set the template len, the template type is set in the site mgr
INPUT: pSiteMgr - Handle to site manager
pTemplate - Pointer to the template structure
OUTPUT:
RETURN: TI_OK
************************************************************************/
TI_STATUS buildDisconnTemplate(siteMgr_t * pSiteMgr, TSetTemplate * pTemplate)
{
paramInfo_t param;
TI_UINT32 size;
disconnTemplate_t *pBuffer = (disconnTemplate_t *) pTemplate->ptr;
siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
TI_UINT16 fc;
os_memoryZero(pSiteMgr->hOs, pBuffer, sizeof(disconnTemplate_t));
/*
* Header First
*/
/* Set destination address */
MAC_COPY(pBuffer->hdr.DA, pPrimarySite->bssid);
/* Set BSSID address */
MAC_COPY(pBuffer->hdr.BSSID, pPrimarySite->bssid);
/* Build Source address */
param.paramType = CTRL_DATA_MAC_ADDRESS;
ctrlData_getParam(pSiteMgr->hCtrlData, ¶m);
MAC_COPY(pBuffer->hdr.SA, param.content.ctrlDataDeviceMacAddress);
fc = DOT11_FC_DISASSOC; /* will be change by firmware to DOT11_FC_DEAUTH if needed */
COPY_WLAN_WORD(&pBuffer->hdr.fc, &fc); /* copy with endianess handling. */
pBuffer->disconnReason = 0; /* filled by firmware */
size = sizeof(disconnTemplate_t);
pTemplate->len = size;
return TI_OK;
}