4 * Copyright(c) 1998 - 2009 Texas Instruments. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * * Neither the name Texas Instruments nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 * \brief 802.11 association SM source
41 /***************************************************************************/
43 /* MODULE: assocSM.c */
44 /* PURPOSE: 802.11 association SM source */
46 /***************************************************************************/
48 #define __FILE_ID__ FILE_ID_63
55 #include "DataCtrl_Api.h"
56 #include "siteMgrApi.h"
58 #include "regulatoryDomainApi.h"
59 #include "mlmeBuilder.h"
62 #include "qosMngr_API.h"
63 #ifdef XCC_MODULE_INCLUDED
64 #include "XCCRMMngr.h"
69 #include "DrvMainModules.h"
75 /** number of states in the state machine */
76 #define ASSOC_SM_NUM_STATES 3
78 /** number of events in the state machine */
79 #define ASSOC_SM_NUM_EVENTS 6
87 /* External data definitions */
89 /* External functions definitions */
91 /* Global variables */
93 /* Local function prototypes */
98 /* state machine functions */
101 TI_STATUS assoc_smEvent(assoc_t *pAssoc, TI_UINT8 event, void *pData);
103 void assoc_smTimeout(TI_HANDLE hAssoc, TI_BOOL bTwdInitOccured);
105 TI_STATUS assoc_smStartIdle(assoc_t *pAssoc);
106 TI_STATUS assoc_smStopWait(assoc_t *pAssoc);
107 TI_STATUS assoc_smSuccessWait(assoc_t *pAssoc);
108 TI_STATUS assoc_smFailureWait(assoc_t *pAssoc);
109 TI_STATUS assoc_smTimeoutWait(assoc_t *pAssoc);
110 TI_STATUS assoc_smMaxRetryWait(assoc_t *pAssoc);
111 TI_STATUS assoc_smStopAssoc(assoc_t *pAssoc);
112 TI_STATUS assoc_smActionUnexpected(assoc_t *pAssoc);
114 TI_STATUS assoc_smResetRetry(assoc_t *pAssoc);
115 TI_STATUS assoc_smIncRetry(assoc_t *pAssoc);
116 TI_STATUS assoc_smReportSuccess(assoc_t *pAssoc);
117 TI_STATUS assoc_smReportFailure(assoc_t *pAssoc, TI_UINT16 uStatusCode);
118 TI_STATUS assoc_smSendAssocReq(assoc_t *pAssoc);
119 TI_STATUS assoc_smStartTimer(assoc_t *pAssoc);
120 TI_STATUS assoc_smStopTimer(assoc_t *pAssoc);
122 TI_STATUS assoc_smCapBuild(assoc_t *pCtx, TI_UINT16 *cap);
123 TI_STATUS assoc_smSSIDBuild(assoc_t *pCtx, TI_UINT8 *pSSID, TI_UINT32 *ssidLen);
124 TI_STATUS assoc_smRatesBuild(assoc_t *pCtx, TI_UINT8 *pRates, TI_UINT32 *ratesLen);
125 TI_STATUS assoc_smRequestBuild(assoc_t *pCtx, TI_UINT8* reqBuf, TI_UINT32* reqLen);
127 TI_STATUS assoc_saveAssocReqMessage(assoc_t *pAssocSm, TI_UINT8 *pAssocBuffer, TI_UINT32 length);
128 TI_STATUS assoc_sendDisAssoc(assoc_t *pAssocSm, mgmtStatus_e reason);
132 * assoc_create - allocate memory for association SM
136 * Allocate memory for association SM. \n
137 * Allocates memory for Association context. \n
138 * Allocates memory for association SM matrix. \n
142 * I - hOs - OS context \n
146 * TI_OK if successful, TI_NOK otherwise.
148 * \sa rsn_mainSecSmKeysOnlyStop()
150 TI_HANDLE assoc_create(TI_HANDLE hOs)
155 /* allocate association context memory */
156 pHandle = (assoc_t*)os_memoryAlloc(hOs, sizeof(assoc_t));
162 os_memoryZero(hOs, pHandle, sizeof(assoc_t));
166 /* allocate memory for association state machine */
167 status = fsm_Create(hOs, &pHandle->pAssocSm, ASSOC_SM_NUM_STATES, ASSOC_SM_NUM_EVENTS);
170 os_memoryFree(hOs, pHandle, sizeof(assoc_t));
180 * assocunload - unload association SM from memory
184 * Unload association SM from memory
188 * I - hAssoc - association SM context \n
192 * TI_OK if successful, TI_NOK otherwise.
194 * \sa rsn_mainSecSmKeysOnlyStop()
196 TI_STATUS assoc_unload(TI_HANDLE hAssoc)
201 pHandle = (assoc_t*)hAssoc;
203 status = fsm_Unload(pHandle->hOs, pHandle->pAssocSm);
206 /* report failure but don't stop... */
207 TRACE0(pHandle->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: Error releasing FSM memory \n");
210 if (pHandle->hAssocSmTimer)
212 tmr_DestroyTimer (pHandle->hAssocSmTimer);
215 os_memoryFree(pHandle->hOs, hAssoc, sizeof(assoc_t));
222 * assoc_config - configure a new association SM
226 * Configure a new association SM.
232 * \sa assoc_Create, assoc_Unload
234 void assoc_init (TStadHandlesList *pStadHandles)
236 assoc_t *pHandle = (assoc_t*)(pStadHandles->hAssoc);
238 /** Main 802.1X State Machine matrix */
239 fsm_actionCell_t assoc_smMatrix[ASSOC_SM_NUM_STATES][ASSOC_SM_NUM_EVENTS] =
241 /* next state and actions for IDLE state */
242 {{ASSOC_SM_STATE_WAIT, (fsm_Action_t)assoc_smStartIdle},
243 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smActionUnexpected},
244 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smActionUnexpected},
245 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smActionUnexpected},
246 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smActionUnexpected},
247 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smActionUnexpected}
249 /* next state and actions for WAIT state */
250 {{ASSOC_SM_STATE_WAIT, (fsm_Action_t)assoc_smActionUnexpected},
251 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smStopWait},
252 {ASSOC_SM_STATE_ASSOC, (fsm_Action_t)assoc_smSuccessWait},
253 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smFailureWait},
254 {ASSOC_SM_STATE_WAIT, (fsm_Action_t)assoc_smTimeoutWait},
255 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smMaxRetryWait}
257 /* next state and actions for ASSOC state */
258 {{ASSOC_SM_STATE_ASSOC, (fsm_Action_t)assoc_smActionUnexpected},
259 {ASSOC_SM_STATE_IDLE, (fsm_Action_t)assoc_smStopAssoc},
260 {ASSOC_SM_STATE_ASSOC, (fsm_Action_t)assoc_smActionUnexpected},
261 {ASSOC_SM_STATE_ASSOC, (fsm_Action_t)assoc_smActionUnexpected},
262 {ASSOC_SM_STATE_ASSOC, (fsm_Action_t)assoc_smActionUnexpected},
263 {ASSOC_SM_STATE_ASSOC, (fsm_Action_t)assoc_smActionUnexpected}
266 /* configure state machine */
267 fsm_Config (pHandle->pAssocSm, &assoc_smMatrix[0][0], ASSOC_SM_NUM_STATES, ASSOC_SM_NUM_EVENTS, NULL, pStadHandles->hOs);
269 pHandle->assocRejectCount = 0;
270 pHandle->assocTimeoutCount = 0;
271 pHandle->currentState = ASSOC_SM_STATE_IDLE;
273 pHandle->hMlme = pStadHandles->hMlmeSm;
274 pHandle->hRegulatoryDomain = pStadHandles->hRegulatoryDomain;
275 pHandle->hSiteMgr = pStadHandles->hSiteMgr;
276 pHandle->hCtrlData = pStadHandles->hCtrlData;
277 pHandle->hTWD = pStadHandles->hTWD;
278 pHandle->hRsn = pStadHandles->hRsn;
279 pHandle->hReport = pStadHandles->hReport;
280 pHandle->hOs = pStadHandles->hOs;
281 pHandle->hXCCMngr = pStadHandles->hXCCMngr;
282 pHandle->hQosMngr = pStadHandles->hQosMngr;
283 pHandle->hMeasurementMgr = pStadHandles->hMeasurementMgr;
284 pHandle->hApConn = pStadHandles->hAPConnection;
285 pHandle->hTimer = pStadHandles->hTimer;
286 pHandle->hStaCap = pStadHandles->hStaCap;
287 pHandle->hSme = pStadHandles->hSme;
292 TI_STATUS assoc_SetDefaults (TI_HANDLE hAssoc, assocInitParams_t *pAssocInitParams)
294 assoc_t *pHandle = (assoc_t*)hAssoc;
296 pHandle->timeout = pAssocInitParams->assocResponseTimeout;
297 pHandle->maxCount = pAssocInitParams->assocMaxRetryCount;
299 /* allocate OS timer memory */
300 pHandle->hAssocSmTimer = tmr_CreateTimer (pHandle->hTimer);
301 if (pHandle->hAssocSmTimer == NULL)
303 TRACE0(pHandle->hReport, REPORT_SEVERITY_ERROR, "assoc_SetDefaults(): Failed to create hAssocSmTimer!\n");
313 * assoc_start - Start event for the association SM
317 * Start event for the association SM
321 * I - hAssoc - Association SM context \n
325 * TI_OK if successful, TI_NOK otherwise.
327 * \sa assoc_Stop, assoc_Recv
329 TI_STATUS assoc_start(TI_HANDLE hAssoc)
334 pHandle = (assoc_t*)hAssoc;
341 pHandle->reAssoc = TI_FALSE;
343 pHandle->disAssoc = TI_FALSE;
345 status = assoc_smEvent(pHandle, ASSOC_SM_EVENT_START, hAssoc);
353 * assoc_start - Start event for the association SM
357 * Start event for the association SM - for Re-assoc request
361 * I - hAssoc - Association SM context \n
365 * TI_OK if successful, TI_NOK otherwise.
367 * \sa assoc_Stop, assoc_Recv
369 TI_STATUS reassoc_start(TI_HANDLE hAssoc)
374 pHandle = (assoc_t*)hAssoc;
380 pHandle->reAssoc = TI_TRUE;
382 status = assoc_smEvent(pHandle, ASSOC_SM_EVENT_START, hAssoc);
389 * assoc_stop - Stop event for the association SM
393 * Stop event for the association SM
397 * I - hAssoc - Association SM context \n
401 * TI_OK if successful, TI_NOK otherwise.
403 * \sa assoc_Start, assoc_Recv
405 TI_STATUS assoc_stop(TI_HANDLE hAssoc)
410 pHandle = (assoc_t*)hAssoc;
417 status = assoc_smEvent(pHandle, ASSOC_SM_EVENT_STOP, hAssoc);
423 TI_STATUS assoc_setDisAssocFlag(TI_HANDLE hAssoc, TI_BOOL disAsoccFlag)
426 pHandle = (assoc_t*)hAssoc;
428 pHandle->disAssoc = disAsoccFlag;
437 * assoc_recv - Recive a message from the AP
441 * Parse a message form the AP and perform the appropriate event.
445 * I - hAssoc - Association SM context \n
446 * I - pFrame - Frame recieved \n
450 * TI_OK if successful, TI_NOK otherwise.
452 * \sa assoc_Start, assoc_Stop
454 TI_STATUS assoc_recv(TI_HANDLE hAssoc, mlmeFrameInfo_t *pFrame)
457 assoc_t *pHandle = (assoc_t*)hAssoc;
458 TTwdParamInfo tTwdParam;
466 /* ensure that the SM is waiting for assoc response */
467 if(pHandle->currentState != ASSOC_SM_STATE_WAIT)
471 if ((pFrame->subType != ASSOC_RESPONSE) && (pFrame->subType != RE_ASSOC_RESPONSE))
476 /* check response status */
477 rspStatus = pFrame->content.assocRsp.status;
483 TI_UINT8 curRsnData[255];
484 TI_UINT8 rsnAssocIeLen;
488 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG Success associating to AP \n");
491 tTwdParam.paramType = TWD_AID_PARAM_ID;
492 tTwdParam.content.halCtrlAid = pFrame->content.assocRsp.aid;
493 TWD_SetParam (pHandle->hTWD, &tTwdParam);
496 /* Get the RSN IE data */
497 pRsnIe = pFrame->content.assocRsp.pRsnIe;
498 while (length < pFrame->content.assocRsp.rsnIeLen && (pFrame->content.assocRsp.rsnIeLen < 255))
500 curRsnData[0+length] = pRsnIe->hdr[0];
501 curRsnData[1+length] = pRsnIe->hdr[1];
502 os_memoryCopy(pHandle->hOs, &curRsnData[2+length], (void *)pRsnIe->rsnIeData, pRsnIe->hdr[1]);
503 length += pRsnIe->hdr[1] + 2;
507 if (pFrame->content.assocRsp.rsnIeLen != 0)
509 rsnData.pIe = curRsnData;
510 rsnData.ieLen = pFrame->content.assocRsp.rsnIeLen;
511 rsnData.privacy = ((pFrame->content.assocRsp.capabilities >> CAP_PRIVACY_SHIFT) & CAP_PRIVACY_MASK) ? TI_TRUE : TI_FALSE;
512 rsn_setSite(pHandle->hRsn, &rsnData, NULL, &rsnAssocIeLen);
515 /* update siteMgr with capabilities and whether we are connected to Cisco AP */
516 siteMgr_assocReport(pHandle->hSiteMgr,
517 pFrame->content.assocRsp.capabilities, pFrame->content.assocRsp.ciscoIEPresent);
519 /* update QoS Manager - it the QOS active protocol is NONE, or no WME IE present, it will return TI_OK */
520 /* if configured by AP, update MSDU lifetime */
521 status = qosMngr_setSite(pHandle->hQosMngr, &pFrame->content.assocRsp);
525 TRACE0(pHandle->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: DEBUG - Association failed : qosMngr_setSite error \n");
526 /* in case we wanted to work with qosAP and failed to connect to qos AP we want to reassociated again
528 status = assoc_smEvent(pHandle, ASSOC_SM_EVENT_FAIL, hAssoc);
532 status = assoc_smEvent(pHandle, ASSOC_SM_EVENT_SUCCESS, hAssoc);
537 pHandle->assocRejectCount++;
539 /* If there was attempt to renegotiate voice settings, update QoS Manager */
540 qosMngr_checkTspecRenegResults(pHandle->hQosMngr, &pFrame->content.assocRsp);
542 /* check failure reason */
548 /* print debug message */
549 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association denied: Unspecified error \n");
552 /* print debug message */
553 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association denied: Cannot support all requested capabilities in the Capability Information field \n");
556 /* print debug message */
557 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association denied: Reassociation denied due to inability to confirm that association exists \n");
560 /* print debug message */
561 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association denied: Association denied due to reason outside the scope of this standard \n");
562 rsn_reportAuthFailure(pHandle->hRsn, RSN_AUTH_STATUS_INVALID_TYPE);
565 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association denied: Association denied due to wrong authentication algorithm \n");
566 rsn_reportAuthFailure(pHandle->hRsn, RSN_AUTH_STATUS_INVALID_TYPE);
569 /* print debug message */
570 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association denied: Association denied because AP is unable to handle additional associated stations \n");
573 /* print debug message */
574 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association denied: Association denied due to requesting station not supporting all of the data rates in the BSSBasicRateSet parameter \n");
577 /* print error message on wrong error code for association response */
578 TRACE1(pHandle->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: ERROR - Association denied: error code (%d) irrelevant \n", rspStatus);
582 status = assoc_smEvent(pHandle, ASSOC_SM_EVENT_FAIL, hAssoc);
590 * assoc_getParam - Get a specific parameter from the association SM
594 * Get a specific parameter from the association SM.
598 * I - hAssoc - Association SM context \n
599 * I/O - pParam - Parameter \n
603 * TI_OK if successful, TI_NOK otherwise.
605 * \sa assoc_Start, assoc_Stop
607 TI_STATUS assoc_getParam(TI_HANDLE hAssoc, paramInfo_t *pParam)
609 assoc_t *pHandle = (assoc_t *)hAssoc;
611 if ((pHandle == NULL) || (pParam == NULL))
616 /* serch parameter type */
617 switch (pParam->paramType)
619 case ASSOC_RESPONSE_TIMEOUT_PARAM:
620 pParam->content.assocResponseTimeout = pHandle->timeout;
623 case ASSOC_COUNTERS_PARAM:
624 pParam->content.siteMgrTiWlanCounters.AssocRejects = pHandle->assocRejectCount;
625 pParam->content.siteMgrTiWlanCounters.AssocTimeouts = pHandle->assocTimeoutCount;
628 case ASSOC_ASSOCIATION_REQ_PARAM:
629 pParam->content.assocReqBuffer.buffer = pHandle->assocReqBuffer;
630 pParam->content.assocReqBuffer.bufferSize = pHandle->assocReqLen;
631 pParam->content.assocReqBuffer.reAssoc = pHandle->reAssoc;
634 case ASSOC_ASSOCIATION_RESP_PARAM:
635 pParam->content.assocReqBuffer.buffer = pHandle->assocRespBuffer;
636 pParam->content.assocReqBuffer.bufferSize = pHandle->assocRespLen;
637 pParam->content.assocReqBuffer.reAssoc = pHandle->reAssocResp;
640 case ASSOC_ASSOCIATION_INFORMATION_PARAM:
642 TI_UINT8 reqBuffIEOffset, respBuffIEOffset;
643 TI_UINT32 RequestIELength = 0;
644 TI_UINT32 ResponseIELength = 0;
646 ScanBssType_enum bssType;
648 TRACE0(pHandle->hReport, REPORT_SEVERITY_SM, "ASSOC_SM: DEBUG - Association Information Get: \n");
649 lParam = (paramInfo_t *)os_memoryAlloc(pHandle->hOs, sizeof(paramInfo_t));
653 /* Assoc exists only in Infrastructure */
654 lParam->paramType = CTRL_DATA_CURRENT_BSS_TYPE_PARAM;
655 ctrlData_getParam(pHandle->hCtrlData, lParam);
656 bssType = lParam->content.ctrlDataCurrentBssType;
657 os_memoryFree(pHandle->hOs, lParam, sizeof(paramInfo_t));
658 if (bssType != BSS_INFRASTRUCTURE)
660 TRACE0(pHandle->hReport, REPORT_SEVERITY_ERROR, "Not in Infrastructure BSS, No ASSOC Info for GET ASSOC_ASSOCIATION_INFORMATION_PARAM\n");
664 /* Init the result buffer to 0 */
665 os_memoryZero(pHandle->hOs ,&pParam->content, sizeof(OS_802_11_ASSOCIATION_INFORMATION));
667 reqBuffIEOffset = 4; /* In Assoc request frame IEs are located from byte 4 */
668 respBuffIEOffset = 6; /* In Assoc response frame the IEs are located from byte 6 */
670 /* If the last associate was re-associciation, the current AP MAC address */
671 /* is placed before the IEs. Copy it to the result parameters. */
672 if (pHandle->reAssoc)
674 MAC_COPY (pParam->content.assocAssociationInformation.RequestFixedIEs.CurrentAPAddress,
675 &pHandle->assocReqBuffer[reqBuffIEOffset]);
676 reqBuffIEOffset += MAC_ADDR_LEN;
679 /* Calculate length of Info elements in assoc request and response frames */
680 if(pHandle->assocReqLen > reqBuffIEOffset)
681 RequestIELength = pHandle->assocReqLen - reqBuffIEOffset;
683 if(pHandle->assocRespLen > respBuffIEOffset)
684 ResponseIELength = pHandle->assocRespLen - respBuffIEOffset;
686 /* Copy the association request information */
687 pParam->content.assocAssociationInformation.Length = sizeof(OS_802_11_ASSOCIATION_INFORMATION);
688 pParam->content.assocAssociationInformation.AvailableRequestFixedIEs = OS_802_11_AI_REQFI_CAPABILITIES | OS_802_11_AI_REQFI_LISTENINTERVAL;
689 pParam->content.assocAssociationInformation.RequestFixedIEs.Capabilities = *(TI_UINT16*)&(pHandle->assocReqBuffer[0]);
690 pParam->content.assocAssociationInformation.RequestFixedIEs.ListenInterval = *(TI_UINT16*)(&pHandle->assocReqBuffer[2]);
692 pParam->content.assocAssociationInformation.RequestIELength = RequestIELength;
693 pParam->content.assocAssociationInformation.OffsetRequestIEs = 0;
694 if (RequestIELength > 0)
696 pParam->content.assocAssociationInformation.OffsetRequestIEs = (TI_UINT32)&pHandle->assocReqBuffer[reqBuffIEOffset];
698 /* Copy the association response information */
699 pParam->content.assocAssociationInformation.AvailableResponseFixedIEs =
700 OS_802_11_AI_RESFI_CAPABILITIES | OS_802_11_AI_RESFI_STATUSCODE | OS_802_11_AI_RESFI_ASSOCIATIONID;
701 pParam->content.assocAssociationInformation.ResponseFixedIEs.Capabilities = *(TI_UINT16*)&(pHandle->assocRespBuffer[0]);
702 pParam->content.assocAssociationInformation.ResponseFixedIEs.StatusCode = *(TI_UINT16*)&(pHandle->assocRespBuffer[2]);
703 pParam->content.assocAssociationInformation.ResponseFixedIEs.AssociationId = *(TI_UINT16*)&(pHandle->assocRespBuffer[4]);
704 pParam->content.assocAssociationInformation.ResponseIELength = ResponseIELength;
705 pParam->content.assocAssociationInformation.OffsetResponseIEs = 0;
706 if (ResponseIELength > 0)
708 pParam->content.assocAssociationInformation.OffsetResponseIEs = (TI_UINT32)&pHandle->assocRespBuffer[respBuffIEOffset];
722 * assoc_setParam - Set a specific parameter to the association SM
726 * Set a specific parameter to the association SM.
730 * I - hAssoc - Association SM context \n
731 * I/O - pParam - Parameter \n
735 * TI_OK if successful, TI_NOK otherwise.
737 * \sa assoc_Start, assoc_Stop
739 TI_STATUS assoc_setParam(TI_HANDLE hAssoc, paramInfo_t *pParam)
743 pHandle = (assoc_t*)hAssoc;
745 if ((pHandle == NULL) || (pParam == NULL))
750 switch (pParam->paramType)
752 case ASSOC_RESPONSE_TIMEOUT_PARAM:
754 if ((pParam->content.assocResponseTimeout >= ASSOC_RESPONSE_TIMEOUT_MIN) &&
755 (pParam->content.assocResponseTimeout <= ASSOC_RESPONSE_TIMEOUT_MAX))
757 pHandle->timeout = pParam->content.assocResponseTimeout;
771 * assoc_smTimeout - Time out event activation function
775 * Time out event activation function.
779 * I - hAssoc - Association SM context \n
783 * TI_OK if successful, TI_NOK otherwise.
785 * \sa assoc_Start, assoc_Stop
787 void assoc_smTimeout(TI_HANDLE hAssoc, TI_BOOL bTwdInitOccured)
791 pHandle = (assoc_t*)hAssoc;
799 pHandle->assocTimeoutCount++;
801 assoc_smEvent(pHandle, ASSOC_SM_EVENT_TIMEOUT, hAssoc);
806 * assoc_smEvent - Perform an event on the association SM
810 * Perform an event on the association SM.
814 * I - pAssoc - Association SM context \n
815 * I - event - Current event \n
816 * I - pData - event related data
820 * TI_OK if successful, TI_NOK otherwise.
824 TI_STATUS assoc_smEvent(assoc_t *pAssoc, TI_UINT8 event, void *pData)
829 status = fsm_GetNextState(pAssoc->pAssocSm, pAssoc->currentState, event, &nextState);
832 TRACE0(pAssoc->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: ERROR - failed getting next state \n");
837 TRACE3( pAssoc->hReport, REPORT_SEVERITY_INFORMATION, "assoc_smEvent: <currentState = %d, event = %d> --> nextState = %d\n", pAssoc->currentState, event, nextState);
839 status = fsm_Event(pAssoc->pAssocSm, &pAssoc->currentState, event, pData);
844 /* state machine functions */
846 TI_STATUS assoc_smStartIdle(assoc_t *pAssoc)
850 status = assoc_smResetRetry(pAssoc);
851 status = assoc_smSendAssocReq(pAssoc);
852 status = assoc_smStartTimer(pAssoc);
853 status = assoc_smIncRetry(pAssoc);
858 TI_STATUS assoc_smStopWait(assoc_t *pAssoc)
862 status = assoc_smStopTimer(pAssoc);
867 TI_STATUS assoc_smSuccessWait(assoc_t *pAssoc)
871 status = assoc_smStopTimer(pAssoc);
872 status = assoc_smReportSuccess(pAssoc);
877 TI_STATUS assoc_smFailureWait(assoc_t *pAssoc)
880 TI_UINT16 uRspStatus = *(TI_UINT16*)&(pAssoc->assocRespBuffer[2]);
882 status = assoc_smStopTimer(pAssoc);
884 /* Sanity check. If the Response status is indeed not 0 */
887 status = assoc_smReportFailure(pAssoc, uRspStatus);
889 else /* (uRspStatus == 0) how did we get here ? */
891 TRACE0(pAssoc->hReport, REPORT_SEVERITY_ERROR, "while Response status is OK (0) !!! \n");
893 status = assoc_smReportFailure(pAssoc, (TI_UINT16)TI_NOK);
898 TI_STATUS assoc_smTimeoutWait(assoc_t *pAssoc)
902 status = assoc_smSendAssocReq(pAssoc);
903 status = assoc_smStartTimer(pAssoc);
904 status = assoc_smIncRetry(pAssoc);
909 TI_STATUS assoc_smMaxRetryWait(assoc_t *pAssoc)
913 status = assoc_smStopTimer(pAssoc);
914 status = assoc_smReportFailure(pAssoc, STATUS_PACKET_REJ_TIMEOUT);
919 TI_STATUS assoc_smSendAssocReq(assoc_t *pAssoc)
924 dot11MgmtSubType_e assocType=ASSOC_REQUEST;
926 assocMsg = os_memoryAlloc(pAssoc->hOs, MAX_ASSOC_MSG_LENGTH);
932 assocType = RE_ASSOC_REQUEST;
934 status = assoc_smRequestBuild(pAssoc, assocMsg, &msgLen);
935 if (status == TI_OK) {
936 /* Save the association request message */
937 assoc_saveAssocReqMessage(pAssoc, assocMsg, msgLen);
938 status = mlmeBuilder_sendFrame(pAssoc->hMlme, assocType, assocMsg, msgLen, 0);
940 os_memoryFree(pAssoc->hOs, assocMsg, MAX_ASSOC_MSG_LENGTH);
944 TI_STATUS assoc_smStopAssoc(assoc_t *pAssoc)
946 if (pAssoc->disAssoc) {
947 assoc_sendDisAssoc(pAssoc, STATUS_UNSPECIFIED);
952 TI_STATUS assoc_smActionUnexpected(assoc_t *pAssoc)
957 /* local functions */
960 TI_STATUS assoc_smResetRetry(assoc_t *pAssoc)
967 pAssoc->retryCount = 0;
972 TI_STATUS assoc_smIncRetry(assoc_t *pAssoc)
981 pAssoc->retryCount++;
983 if (pAssoc->retryCount > pAssoc->maxCount)
985 status = assoc_smEvent(pAssoc, ASSOC_SM_EVENT_MAX_RETRY, pAssoc);
993 TI_STATUS assoc_smReportSuccess(assoc_t *pAssoc)
1001 status = mlme_reportAssocStatus(pAssoc->hMlme, (TI_UINT16)TI_OK);
1006 TI_STATUS assoc_smReportFailure(assoc_t *pAssoc, TI_UINT16 uStatusCode)
1015 status = mlme_reportAssocStatus(pAssoc->hMlme, uStatusCode);
1020 TI_STATUS assoc_smStartTimer(assoc_t *pAssoc)
1027 tmr_StartTimer (pAssoc->hAssocSmTimer,
1036 TI_STATUS assoc_smStopTimer(assoc_t *pAssoc)
1043 tmr_StopTimer (pAssoc->hAssocSmTimer);
1048 /*****************************************************************************
1050 ** Association messages builder/Parser
1052 *****************************************************************************/
1054 TI_STATUS assoc_smCapBuild(assoc_t *pCtx, TI_UINT16 *cap)
1059 TI_UINT32 rateSuppMask, rateBasicMask;
1060 TI_UINT8 ratesBuf[DOT11_MAX_SUPPORTED_RATES];
1061 TI_UINT32 len = 0, ofdmIndex = 0;
1062 TI_BOOL b11nEnable, bWmeEnable;
1067 param.paramType = CTRL_DATA_CURRENT_BSS_TYPE_PARAM;
1068 status = ctrlData_getParam(pCtx->hCtrlData, ¶m);
1069 if (status == TI_OK)
1071 if (param.content.ctrlDataCurrentBssType == BSS_INFRASTRUCTURE)
1073 *cap |= DOT11_CAPS_ESS;
1075 *cap |= DOT11_CAPS_IBSS;
1082 param.paramType = RSN_ENCRYPTION_STATUS_PARAM;
1083 status = rsn_getParam(pCtx->hRsn, ¶m);
1084 if (status == TI_OK)
1086 if (param.content.rsnEncryptionStatus != TWD_CIPHER_NONE)
1088 *cap |= DOT11_CAPS_PRIVACY;
1095 param.paramType = SITE_MGR_DESIRED_PREAMBLE_TYPE_PARAM;
1096 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1097 if (status == TI_OK)
1099 if (param.content.siteMgrCurrentPreambleType == PREAMBLE_SHORT)
1100 *cap |= DOT11_CAPS_SHORT_PREAMBLE;
1106 param.paramType = SITE_MGR_CURRENT_RATE_PAIR_PARAM;
1107 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1108 if (status == TI_OK)
1110 if(param.content.siteMgrCurrentRateMask.supportedRateMask & DRV_RATE_MASK_22_PBCC)
1111 *cap |= DOT11_CAPS_PBCC;
1117 /* Checking if the station supports Spectrum Management (802.11h) */
1118 param.paramType = REGULATORY_DOMAIN_MANAGEMENT_CAPABILITY_ENABLED_PARAM;
1119 status = regulatoryDomain_getParam(pCtx->hRegulatoryDomain, ¶m);
1120 if (status == TI_OK )
1122 if( param.content.spectrumManagementEnabled)
1123 *cap |= DOT11_SPECTRUM_MANAGEMENT;
1131 param.paramType = SITE_MGR_OPERATIONAL_MODE_PARAM;
1132 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1135 mode = param.content.siteMgrDot11OperationalMode;
1140 if(mode == DOT11_G_MODE)
1142 /* new requirement: the short slot time should be set only
1143 if the AP's modulation is OFDM (highest rate) */
1146 param.paramType = SITE_MGR_CURRENT_RATE_PAIR_PARAM;
1147 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1148 if (status == TI_OK)
1150 rateBasicMask = param.content.siteMgrCurrentRateMask.basicRateMask;
1151 rateSuppMask = param.content.siteMgrCurrentRateMask.supportedRateMask;
1156 /* convert the bit map to the rates array */
1157 rate_DrvBitmapToNetStr (rateSuppMask, rateBasicMask, ratesBuf, &len, &ofdmIndex);
1160 *cap |= DOT11_CAPS_SHORT_SLOT_TIME;
1163 param.paramType = SITE_MGR_CURRENT_MODULATION_TYPE_PARAM;
1164 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1165 if(param.content.siteMgrCurrentModulationType == DRV_MODULATION_OFDM)
1166 *cap |= DOT11_CAPS_SHORT_SLOT_TIME;
1170 /* Immediate Block Ack subfield - (is WME on?) AND (is HT Enable?) */
1171 /* verify 11n_Enable and Chip type */
1172 StaCap_IsHtEnable (pCtx->hStaCap, &b11nEnable);
1173 /* verify that WME flag enable */
1174 qosMngr_GetWmeEnableFlag (pCtx->hQosMngr, &bWmeEnable);
1176 if ((b11nEnable != TI_FALSE) && (bWmeEnable != TI_FALSE))
1178 *cap |= DOT11_CAPS_IMMEDIATE_BA;
1185 TI_STATUS assoc_smSSIDBuild(assoc_t *pCtx, TI_UINT8 *pSSID, TI_UINT32 *ssidLen)
1189 dot11_SSID_t *pDot11Ssid;
1191 pDot11Ssid = (dot11_SSID_t*)pSSID;
1192 /* set SSID element id */
1193 pDot11Ssid->hdr[0] = SSID_IE_ID;
1196 param.paramType = SME_DESIRED_SSID_ACT_PARAM;
1197 status = sme_GetParam(pCtx->hSme, ¶m);
1198 if (status != TI_OK)
1203 /* check for ANY ssid */
1204 if (param.content.smeDesiredSSID.len != 0)
1206 pDot11Ssid->hdr[1] = param.content.smeDesiredSSID.len;
1207 os_memoryCopy(pCtx->hOs,
1208 (void *)pDot11Ssid->serviceSetId,
1209 (void *)param.content.smeDesiredSSID.str,
1210 param.content.smeDesiredSSID.len);
1213 /* if ANY ssid is configured, use the current SSID */
1214 param.paramType = SITE_MGR_CURRENT_SSID_PARAM;
1215 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1216 if (status != TI_OK)
1220 pDot11Ssid->hdr[1] = param.content.siteMgrCurrentSSID.len;
1221 os_memoryCopy(pCtx->hOs,
1222 (void *)pDot11Ssid->serviceSetId,
1223 (void *)param.content.siteMgrCurrentSSID.str,
1224 param.content.siteMgrCurrentSSID.len);
1228 *ssidLen = pDot11Ssid->hdr[1] + sizeof(dot11_eleHdr_t);
1233 TI_STATUS assoc_smRatesBuild(assoc_t *pCtx, TI_UINT8 *pRates, TI_UINT32 *ratesLen)
1237 TI_UINT32 rateSuppMask, rateBasicMask;
1238 dot11_RATES_t *pDot11Rates;
1239 TI_UINT32 len = 0, ofdmIndex = 0;
1240 TI_UINT8 ratesBuf[DOT11_MAX_SUPPORTED_RATES];
1242 TI_UINT32 suppRatesLen, extSuppRatesLen, i;
1243 pDot11Rates = (dot11_RATES_t*)pRates;
1247 param.paramType = SITE_MGR_CURRENT_RATE_PAIR_PARAM;
1248 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1249 if (status == TI_OK)
1251 rateBasicMask = param.content.siteMgrCurrentRateMask.basicRateMask;
1252 rateSuppMask = param.content.siteMgrCurrentRateMask.supportedRateMask;
1259 /* get operational mode */
1260 param.paramType = SITE_MGR_OPERATIONAL_MODE_PARAM;
1261 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1263 mode = param.content.siteMgrDot11OperationalMode;
1267 /* convert the bit map to the rates array */
1268 /* remove MCS rates from Extended Supported Rates IE */
1269 rateSuppMask &= ~(DRV_RATE_MASK_MCS_0_OFDM |
1270 DRV_RATE_MASK_MCS_1_OFDM |
1271 DRV_RATE_MASK_MCS_2_OFDM |
1272 DRV_RATE_MASK_MCS_3_OFDM |
1273 DRV_RATE_MASK_MCS_4_OFDM |
1274 DRV_RATE_MASK_MCS_5_OFDM |
1275 DRV_RATE_MASK_MCS_6_OFDM |
1276 DRV_RATE_MASK_MCS_7_OFDM );
1278 rate_DrvBitmapToNetStr (rateSuppMask, rateBasicMask, ratesBuf, &len, &ofdmIndex);
1280 if(mode != DOT11_G_MODE || ofdmIndex == len )
1282 pDot11Rates->hdr[0] = SUPPORTED_RATES_IE_ID;
1283 pDot11Rates->hdr[1] = len;
1284 os_memoryCopy(NULL, (void *)pDot11Rates->rates, ratesBuf, len);
1285 *ratesLen = pDot11Rates->hdr[1] + sizeof(dot11_eleHdr_t);
1289 /* fill in the supported rates */
1290 pDot11Rates->hdr[0] = SUPPORTED_RATES_IE_ID;
1291 pDot11Rates->hdr[1] = ofdmIndex;
1292 os_memoryCopy(NULL, (void *)pDot11Rates->rates, ratesBuf, pDot11Rates->hdr[1]);
1293 suppRatesLen = pDot11Rates->hdr[1] + sizeof(dot11_eleHdr_t);
1294 /* fill in the extended supported rates */
1295 pDot11Rates = (dot11_RATES_t*)(pRates + suppRatesLen);
1296 pDot11Rates->hdr[0] = EXT_SUPPORTED_RATES_IE_ID;
1297 pDot11Rates->hdr[1] = len - ofdmIndex;
1298 os_memoryCopy(NULL, (void *)pDot11Rates->rates, &ratesBuf[ofdmIndex], pDot11Rates->hdr[1]);
1299 extSuppRatesLen = pDot11Rates->hdr[1] + sizeof(dot11_eleHdr_t);
1300 *ratesLen = suppRatesLen + extSuppRatesLen;
1303 TRACE3(pCtx->hReport, REPORT_SEVERITY_INFORMATION, "ASSOC_SM: ASSOC_REQ - bitmapSupp= 0x%X,bitMapBasic = 0x%X, len = %d\n", rateSuppMask,rateBasicMask,len);
1304 for(i=0; i<len; i++)
1306 TRACE2(pCtx->hReport, REPORT_SEVERITY_INFORMATION, "ASSOC_SM: ASSOC_REQ - ratesBuf[%d] = 0x%X\n", i, ratesBuf[i]);
1312 TI_STATUS assoc_powerCapabilityBuild(assoc_t *pCtx, TI_UINT8 *pPowerCapability, TI_UINT32 *powerCapabilityLen)
1316 dot11_CAPABILITY_t *pDot11PowerCapability;
1318 pDot11PowerCapability = (dot11_CAPABILITY_t*)pPowerCapability;
1320 /* set Power Capability element id */
1321 pDot11PowerCapability->hdr[0] = DOT11_CAPABILITY_ELE_ID;
1322 pDot11PowerCapability->hdr[1] = DOT11_CAPABILITY_ELE_LEN;
1324 /* get power capability */
1325 param.paramType = REGULATORY_DOMAIN_POWER_CAPABILITY_PARAM;
1326 status = regulatoryDomain_getParam(pCtx->hRegulatoryDomain, ¶m);
1328 if (status == TI_OK)
1330 pDot11PowerCapability->minTxPower = param.content.powerCapability.minTxPower;
1331 pDot11PowerCapability->maxTxPower = param.content.powerCapability.maxTxPower;
1332 *powerCapabilityLen = pDot11PowerCapability->hdr[1] + sizeof(dot11_eleHdr_t);
1335 *powerCapabilityLen = 0;
1340 TI_STATUS assoc_smRequestBuild(assoc_t *pCtx, TI_UINT8* reqBuf, TI_UINT32* reqLen)
1346 TTwdParamInfo tTwdParam;
1347 TI_UINT16 capabilities;
1352 /* insert capabilities */
1353 status = assoc_smCapBuild(pCtx, &capabilities);
1354 if (status == TI_OK)
1356 *(TI_UINT16*)pRequest = capabilities;
1364 /* insert listen interval */
1365 tTwdParam.paramType = TWD_LISTEN_INTERVAL_PARAM_ID;
1366 status = TWD_GetParam (pCtx->hTWD, &tTwdParam);
1367 if (status == TI_OK)
1369 *(TI_UINT16*)pRequest = ENDIAN_HANDLE_WORD((TI_UINT16)tTwdParam.content.halCtrlListenInterval);
1377 { /* Insert currentAPAddress element only in reassoc request*/
1378 param.paramType = SITE_MGR_PREV_SITE_BSSID_PARAM;
1379 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1380 if (status == TI_OK)
1382 MAC_COPY (pRequest, param.content.siteMgrDesiredBSSID);
1383 TRACE6(pCtx->hReport, REPORT_SEVERITY_INFORMATION, "ASSOC_SM: ASSOC_REQ - prev AP = %x-%x-%x-%x-%x-%x\n", param.content.siteMgrDesiredBSSID[0], param.content.siteMgrDesiredBSSID[1], param.content.siteMgrDesiredBSSID[2], param.content.siteMgrDesiredBSSID[3], param.content.siteMgrDesiredBSSID[4], param.content.siteMgrDesiredBSSID[5]);
1386 pRequest += MAC_ADDR_LEN;
1387 *reqLen += MAC_ADDR_LEN;
1391 TRACE0(pCtx->hReport, REPORT_SEVERITY_ERROR, "ASSOC_SM: ASSOC_REQ - No prev AP \n");
1397 /* insert SSID element */
1398 status = assoc_smSSIDBuild(pCtx, pRequest, &len);
1399 if (status != TI_OK)
1407 /* insert Rates element */
1408 status = assoc_smRatesBuild(pCtx, pRequest, &len);
1409 if (status != TI_OK)
1416 /* Checking if the station supports Spectrum Management (802.11h) */
1417 param.paramType = REGULATORY_DOMAIN_MANAGEMENT_CAPABILITY_ENABLED_PARAM;
1418 status = regulatoryDomain_getParam(pCtx->hRegulatoryDomain,¶m);
1419 if( (status == TI_OK) && param.content.spectrumManagementEnabled)
1421 /* Checking the selected AP capablities */
1422 param.paramType = SITE_MGR_SITE_CAPABILITY_PARAM;
1423 status = siteMgr_getParam(pCtx->hSiteMgr,¶m);
1424 if(status == TI_OK && ((param.content.siteMgrSiteCapability & DOT11_SPECTRUM_MANAGEMENT) != 0))
1426 /* insert Power capability element */
1427 status = assoc_powerCapabilityBuild(pCtx, pRequest, &len);
1428 if (status != TI_OK)
1435 /* insert Supported Channels element */
1436 status = assoc_supportedChannelBuild(pCtx, pRequest, &len);
1437 if (status != TI_OK)
1449 status = qosMngr_getQosCapabiltyInfeElement(pCtx->hQosMngr,pRequest,&len);
1450 if (status != TI_OK)
1458 #ifdef XCC_MODULE_INCLUDED
1459 status = rsn_getXCCExtendedInfoElement(pCtx->hRsn, pRequest, (TI_UINT8*)&len);
1460 if (status != TI_OK)
1468 { /* insert CCKM information element only in reassoc */
1469 status = XCCMngr_getCckmInfoElement(pCtx->hXCCMngr, pRequest, (TI_UINT8*)&len);
1471 if (status != TI_OK)
1478 status = XCCMngr_getXCCVersionInfoElement(pCtx->hXCCMngr, pRequest, (TI_UINT8*)&len);
1479 if (status != TI_OK)
1486 /* Insert Radio Mngt Capability IE */
1487 status = measurementMgr_radioMngtCapabilityBuild(pCtx->hMeasurementMgr, pRequest, (TI_UINT8*)&len);
1488 if (status != TI_OK)
1496 /* Get Simple-Config state */
1497 param.paramType = SITE_MGR_SIMPLE_CONFIG_MODE;
1498 status = siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1500 if (param.content.siteMgrWSCMode.WSCMode == TIWLN_SIMPLE_CONFIG_OFF)
1502 /* insert RSN information elements */
1503 status = rsn_getInfoElement(pCtx->hRsn, pRequest, &len);
1505 if (status != TI_OK)
1513 /* Primary Site support HT ? */
1514 param.paramType = SITE_MGR_PRIMARY_SITE_HT_SUPPORT;
1515 siteMgr_getParam(pCtx->hSiteMgr, ¶m);
1517 if(TI_TRUE == param.content.bPrimarySiteHtSupport)
1519 status = StaCap_GetHtCapabilitiesIe (pCtx->hStaCap, pRequest, &len);
1520 if (status != TI_OK)
1528 status = qosMngr_assocReqBuild(pCtx->hQosMngr,pRequest,&len);
1529 if (status != TI_OK)
1536 status = apConn_getVendorSpecificIE(pCtx->hApConn, pRequest, &len);
1537 if (status != TI_OK)
1544 if (*reqLen>=MAX_ASSOC_MSG_LENGTH)
1554 TI_STATUS assoc_saveAssocRespMessage(assoc_t *pAssocSm, TI_UINT8 *pAssocBuffer, TI_UINT32 length)
1556 if ((pAssocSm==NULL) || (pAssocBuffer==NULL) || (length>=MAX_ASSOC_MSG_LENGTH))
1560 os_memoryCopy(pAssocSm->hOs, pAssocSm->assocRespBuffer, pAssocBuffer, length);
1561 pAssocSm->assocRespLen = length;
1563 TRACE1(pAssocSm->hReport, REPORT_SEVERITY_INFORMATION, "assoc_saveAssocRespMessage: length=%ld \n",length);
1567 TI_STATUS assoc_saveAssocReqMessage(assoc_t *pAssocSm, TI_UINT8 *pAssocBuffer, TI_UINT32 length)
1570 if ((pAssocSm==NULL) || (pAssocBuffer==NULL) || (length>=MAX_ASSOC_MSG_LENGTH))
1575 os_memoryCopy(pAssocSm->hOs, pAssocSm->assocReqBuffer, pAssocBuffer, length);
1576 pAssocSm->assocReqLen = length;
1578 TRACE1(pAssocSm->hReport, REPORT_SEVERITY_INFORMATION, "assoc_saveAssocReqMessage: length=%ld \n",length);
1583 TI_STATUS assoc_sendDisAssoc(assoc_t *pAssocSm, mgmtStatus_e reason)
1586 disAssoc_t disAssoc;
1588 if (reason == STATUS_SUCCESSFUL)
1590 disAssoc.reason = ENDIAN_HANDLE_WORD(STATUS_UNSPECIFIED);
1592 disAssoc.reason = ENDIAN_HANDLE_WORD(reason);
1595 status = mlmeBuilder_sendFrame(pAssocSm->hMlme, DIS_ASSOC, (TI_UINT8*)&disAssoc, sizeof(disAssoc_t), 0);