4 * Copyright(c) 1998 - 2010 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.
34 /** \file reportReplvl.c
35 * \brief Report level implementation
40 /***************************************************************************/
42 /* MODULE: reportReplvl.c */
43 /* PURPOSE: Report level implementation */
45 /***************************************************************************/
46 #define __FILE_ID__ FILE_ID_87
57 #include "DataCtrl_Api.h"
58 #include "siteMgrApi.h"
59 #include "EvHandler.h"
60 #include "TI_IPC_Api.h"
61 #include "regulatoryDomainApi.h"
62 #include "measurementMgrApi.h"
63 #ifdef XCC_MODULE_INCLUDED
65 #include "TransmitPowerXCC.h"
66 #include "XCCRMMngr.h"
69 #include "qosMngr_API.h"
73 /****************************************************************************
75 Each function in the select process returns a MATCH, NO_MATCH value in order to
76 skip non relevant sites. In addition, some of the functions also measures a matching level of a site.
77 The matching level is returned as a bit map. The select function 'OR's those bit maps in order to
78 select the site that has the biggest matching level. If a function returns a NO_MATCH value, the matching level of the
80 Following is the site matching level bit map structure.
81 Please notice, that if all the match functions returned MATCH for a site, its matric must be different than 0,
82 because of the rates bits.
85 31 - 24 23 - 20 20 - 16 15 - 10 9 - 8 7 6 5 4 - 0
86 +---------------+---------------+-----------------------+-------------+------------+----------+---------+-----------+-----------+
87 | Rx Level | Privacy | Attempts |Rates | Modulation |Preamble | Channel | Spectrum | Reserved |
88 | | | | | | | | management| |
89 +---------------+---------------+-----------------------+-------------+------------+----------+---------+-----------+-----------+
90 ****************************************************************************/
92 /* Matric bit map definition */
96 METRIC_RX_LEVEL_MASK = 0xFF,
97 METRIC_RX_LEVEL_SHIFT = 24,
100 METRIC_PRIVACY_MASK = 0x0F,
101 METRIC_PRIVACY_SHIFT = 20,
103 /* Number of attempts */
104 METRIC_ATTEMPTS_NUMBER_MASK = 0x0F,
105 METRIC_ATTEMPTS_NUMBER_SHIFT = 16,
109 METRIC_RATES_MASK = 0x3F,
110 METRIC_RATES_SHIFT = 10,
113 METRIC_MODULATION_MASK = 0x03,
114 METRIC_MODULATION_SHIFT = 8,
117 METRIC_PREAMBLE_MASK = 0x01,
118 METRIC_PREAMBLE_SHIFT = 7,
121 METRIC_CHANNEL_MASK = 0x01,
122 METRIC_CHANNEL_SHIFT = 6,
124 /* Spectrum management Capability */
125 METRIC_SPECTRUM_MANAGEMENT_MASK = 0x01,
126 METRIC_SPECTRUM_MANAGEMENT_SHIFT= 5,
129 METRIC_PRIORITY_SITE_MASK = 0x01,
130 METRIC_PRIORITY_SITE_SHIFT = 4
134 #define MAX_GB_MODE_CHANEL 14
136 #define MAX_RSN_DATA_SIZE 256
138 /* RSSI values boundaries and metric values for best, good, etc signals */
139 #define SELECT_RSSI_BEST_LEVEL (-22)
140 #define SELECT_RSSI_GOOD_LEVEL (-38)
141 #define SELECT_RSSI_NORMAL_LEVEL (-56)
142 #define SELECT_RSSI_POOR_LEVEL (-72)
143 #define SELECT_RSSI_BAD_LEVEL (-82)
146 #define RSSI_METRIC_BEST 6
147 #define RSSI_METRIC_GOOD 5
148 #define RSSI_METRIC_NORMAL 4
149 #define RSSI_METRIC_POOR 3
150 #define RSSI_METRIC_BAD 2
151 #define RSSI_METRIC_NOSIGNAL 1
153 /* Local functions prototypes */
155 static TI_STATUS sendProbeResponse(siteMgr_t *pSiteMgr, TMacAddr *pBssid);
157 /* Interface functions Implementation */
159 /***********************************************************************
161 ***********************************************************************
162 DESCRIPTION: This function is called if the selection fails and desired BSS type is IBSS
163 That means we creating our own network and wait for other stations to join us.
164 the best site for teh station.
165 Performs the following:
166 - If the desired BSSID is broadcast, we generate a random BSSId, otherwise we use the desired one.
167 - If the site table is full we remove the most old site
168 - We send a probe response with our oiwn desired attributes in order to add the site to the site table
170 INPUT: pSiteMgr - site mgr handle.
174 RETURN: Pointer to rthe self site entry in the site table
176 ************************************************************************/
177 siteEntry_t *addSelfSite(TI_HANDLE hSiteMgr)
179 siteMgr_t *pSiteMgr = (siteMgr_t *)hSiteMgr;
182 TSsid *pSsid = &pSiteMgr->pDesiredParams->siteMgrDesiredSSID;
184 if (OS_802_11_SSID_JUNK (pSsid->str, pSsid->len))
187 if ((MAC_BROADCAST (pSiteMgr->pDesiredParams->siteMgrDesiredBSSID)) ||
188 (BSS_INDEPENDENT == pSiteMgr->pDesiredParams->siteMgrDesiredBSSType))
190 MAC_COPY (bssid, pSiteMgr->ibssBssid);
194 MAC_COPY (bssid, pSiteMgr->pDesiredParams->siteMgrDesiredBSSID);
197 if(pSiteMgr->pDesiredParams->siteMgrDesiredChannel <= 14)
199 pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
200 pSiteMgr->siteMgrOperationalMode = DOT11_G_MODE;
204 pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = (siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables;
205 pSiteMgr->siteMgrOperationalMode = DOT11_A_MODE;
208 siteMgr_ConfigRate(pSiteMgr);
210 /* First make sure that there is a place in the site table, if not, reomve the eldest site. */
211 if (pSiteMgr->pSitesMgmtParams->pCurrentSiteTable->numOfSites == pSiteMgr->pSitesMgmtParams->pCurrentSiteTable->maxNumOfSites)
212 removeEldestSite(pSiteMgr);
214 sendProbeResponse(pSiteMgr, &bssid);
216 /* Now find the site in the site table. */
217 pSite = findSiteEntry(pSiteMgr, &bssid);
222 pSite->beaconModulation = pSite->probeModulation;
223 pSite->barkerPreambleType = PREAMBLE_UNSPECIFIED;
225 pSiteMgr->pSitesMgmtParams->pPrimarySite = pSite;
226 pSite->siteType = SITE_SELF;
227 pSite->bssType = BSS_INDEPENDENT;
232 /***********************************************************************
234 ***********************************************************************
235 DESCRIPTION: This function is called by the function 'addSelfSite()' in order to send a probe response
236 to the site mgr. This will cause the site manager to add a new entry to the site table, the self site entry.
238 INPUT: pSiteMgr - site mgr handle.
239 pBssid - Received BSSID
245 ************************************************************************/
246 static TI_STATUS sendProbeResponse(siteMgr_t *pSiteMgr, TMacAddr *pBssid)
248 mlmeFrameInfo_t frame;
249 ECipherSuite rsnStatus;
252 dot11_FH_PARAMS_t FHParamsSet;
253 dot11_DS_PARAMS_t DSParamsSet;
254 dot11_CF_PARAMS_t CFParamsSet;
255 dot11_IBSS_PARAMS_t IBSSParamsSet;
256 TI_UINT32 len = 0, ofdmIndex = 0;
258 dot11_RATES_t extRates;
259 TI_UINT8 ratesBuf[DOT11_MAX_SUPPORTED_RATES];
260 TI_BOOL extRatesInd = TI_FALSE;
262 /* The easiest way to add a site to the site table is to simulate a probe frame. */
263 frame.subType = PROBE_RESPONSE;
264 os_memoryZero(pSiteMgr->hOs, &frame, sizeof(mlmeFrameInfo_t));
265 /* Initialize the frame fields */
266 frame.subType = PROBE_RESPONSE;
267 os_memoryZero(pSiteMgr->hOs, (void *)frame.content.iePacket.timestamp, TIME_STAMP_LEN);
269 /* Build Beacon interval */
270 frame.content.iePacket.beaconInerval = pSiteMgr->pDesiredParams->siteMgrDesiredBeaconInterval;
272 /* Build capability field */
273 frame.content.iePacket.capabilities = 0;
274 frame.content.iePacket.capabilities |= (TI_TRUE << CAP_IBSS_SHIFT); /* Bss type must be independent */
276 if ((pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType == PREAMBLE_SHORT))
277 frame.content.iePacket.capabilities |= (TI_TRUE << CAP_PREAMBLE_SHIFT);
279 /* call RSN to get the privacy desired */
280 rsn_getParamEncryptionStatus(pSiteMgr->hRsn, &rsnStatus); /* RSN_ENCRYPTION_STATUS_PARAM */
281 if (rsnStatus == TWD_CIPHER_NONE)
283 frame.content.iePacket.capabilities |= (TI_FALSE << CAP_PRIVACY_SHIFT);
287 frame.content.iePacket.capabilities |= (TI_TRUE << CAP_PRIVACY_SHIFT);
290 if (pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_PBCC)
291 frame.content.iePacket.capabilities |= (TI_TRUE << CAP_PBCC_SHIFT);
293 if (pSiteMgr->siteMgrOperationalMode == DOT11_G_MODE)
295 if(pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime == PHY_SLOT_TIME_SHORT)
296 frame.content.iePacket.capabilities |= (TI_TRUE << CAP_SLOT_TIME_SHIFT);
300 os_memoryZero(pSiteMgr->hOs, (void *)ssid.serviceSetId, MAX_SSID_LEN);
302 ssid.hdr[1] = pSiteMgr->pDesiredParams->siteMgrDesiredSSID.len;
303 if (ssid.hdr[1] > MAX_SSID_LEN)
305 TRACE2(pSiteMgr->hReport, REPORT_SEVERITY_ERROR,
306 "sendProbeResponse. siteMgrDesiredSSID.len=%d exceeds the limit %d\n",
307 pSiteMgr->pDesiredParams->siteMgrDesiredSSID.len, MAX_SSID_LEN);
308 ssid.hdr[1] = MAX_SSID_LEN;
310 os_memoryCopy(pSiteMgr->hOs, (void *)ssid.serviceSetId, (void *)pSiteMgr->pDesiredParams->siteMgrDesiredSSID.str, ssid.hdr[1]);
312 if(pSiteMgr->pDesiredParams->siteMgrDesiredChannel <= MAX_GB_MODE_CHANEL)
313 siteMgr_updateRates(pSiteMgr, TI_FALSE, TI_TRUE);
315 siteMgr_updateRates(pSiteMgr, TI_TRUE, TI_TRUE);
318 rate_DrvBitmapToNetStr (pSiteMgr->pDesiredParams->siteMgrCurrentDesiredRateMask.supportedRateMask,
319 pSiteMgr->pDesiredParams->siteMgrCurrentDesiredRateMask.basicRateMask,
324 if(pSiteMgr->siteMgrOperationalMode != DOT11_G_MODE ||
325 pSiteMgr->pDesiredParams->siteMgrUseDraftNum == DRAFT_5_AND_EARLIER ||
328 rates.hdr[0] = DOT11_SUPPORTED_RATES_ELE_ID;
330 os_memoryCopy(pSiteMgr->hOs, (void *)rates.rates, ratesBuf, rates.hdr[1]);
334 rates.hdr[0] = DOT11_SUPPORTED_RATES_ELE_ID;
335 rates.hdr[1] = ofdmIndex;
336 os_memoryCopy(pSiteMgr->hOs, (void *)rates.rates, ratesBuf, rates.hdr[1]);
338 extRates.hdr[0] = DOT11_EXT_SUPPORTED_RATES_ELE_ID;
339 extRates.hdr[1] = len - ofdmIndex;
340 os_memoryCopy(pSiteMgr->hOs, (void *)extRates.rates, &ratesBuf[ofdmIndex], extRates.hdr[1]);
341 extRatesInd = TI_TRUE;
344 if((pSiteMgr->siteMgrOperationalMode == DOT11_G_MODE) || (pSiteMgr->siteMgrOperationalMode == DOT11_DUAL_MODE))
346 erpProtectionType_e protType;
347 ctrlData_getParamProtType(pSiteMgr->hCtrlData, &protType); /* CTRL_DATA_CURRENT_IBSS_PROTECTION_PARAM */
348 frame.content.iePacket.useProtection = protType;
352 frame.content.iePacket.useProtection = ERP_PROTECTION_NONE;
356 os_memoryZero(pSiteMgr->hOs, &FHParamsSet, sizeof(dot11_FH_PARAMS_t));
359 DSParamsSet.hdr[1] = 1;
360 DSParamsSet.currChannel = pSiteMgr->pDesiredParams->siteMgrDesiredChannel;
363 os_memoryZero(pSiteMgr->hOs, &CFParamsSet, sizeof(dot11_CF_PARAMS_t));
366 os_memoryZero(pSiteMgr->hOs, &IBSSParamsSet, sizeof(dot11_IBSS_PARAMS_t));
367 IBSSParamsSet.hdr[1] = 2;
368 IBSSParamsSet.atimWindow = pSiteMgr->pDesiredParams->siteMgrDesiredAtimWindow;
370 frame.content.iePacket.pSsid = &ssid;
371 frame.content.iePacket.pRates = &rates;
374 frame.content.iePacket.pExtRates = &extRates;
376 frame.content.iePacket.pExtRates = NULL;
378 frame.content.iePacket.pFHParamsSet = &FHParamsSet;
379 frame.content.iePacket.pDSParamsSet = &DSParamsSet;
380 frame.content.iePacket.pCFParamsSet = &CFParamsSet;
381 frame.content.iePacket.pIBSSParamsSet = &IBSSParamsSet;
383 band = ( MAX_GB_MODE_CHANEL >= pSiteMgr->pDesiredParams->siteMgrDesiredChannel ? RADIO_BAND_2_4_GHZ : RADIO_BAND_5_0_GHZ );
385 siteMgr_updateSite(pSiteMgr, pBssid, &frame ,pSiteMgr->pDesiredParams->siteMgrDesiredChannel, band, TI_FALSE);
390 /***********************************************************************
392 ***********************************************************************
393 DESCRIPTION: This function is called by the function 'siteMgr_selectSite()' in order to configure
394 the system with the chosen site attribute.
396 INPUT: pSiteMgr - site mgr handle.
402 ************************************************************************/
403 TI_STATUS systemConfig(siteMgr_t *pSiteMgr)
406 siteEntry_t *pPrimarySite = pSiteMgr->pSitesMgmtParams->pPrimarySite;
408 TI_UINT8 rsnAssocIeLen;
410 TI_UINT8 rsnIECount=0;
411 TI_UINT8 *curRsnData;
413 TI_UINT16 capabilities;
414 TI_UINT16 PktLength=0;
415 TI_UINT8 *pIeBuffer=NULL;
419 #ifdef XCC_MODULE_INCLUDED
420 TI_UINT8 ExternTxPower;
424 TI_UINT32 StaTotalRates;
425 dot11_ACParameters_t *p_ACParametersDummy = NULL;
426 TtxCtrlHtControl tHtControl;
428 curRsnData = os_memoryAlloc(pSiteMgr->hOs, MAX_RSN_DATA_SIZE);
431 pParam = (paramInfo_t *)os_memoryAlloc(pSiteMgr->hOs, sizeof(paramInfo_t));
433 os_memoryFree(pSiteMgr->hOs, curRsnData, MAX_RSN_DATA_SIZE);
437 if (pPrimarySite->probeRecv)
439 pIeBuffer = pPrimarySite->probeRespBuffer;
440 PktLength = pPrimarySite->probeRespLength;
442 else if (pPrimarySite->beaconRecv)
444 pIeBuffer = pPrimarySite->beaconBuffer;
445 PktLength = pPrimarySite->beaconLength;
448 pSiteMgr->prevRadioBand = pSiteMgr->radioBand;
450 TRACE2(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, ": Capabilities, Slot Time Bit = %d (capabilities = %d)\n", (pPrimarySite->capabilities >> CAP_SLOT_TIME_SHIFT) & 1, pPrimarySite->capabilities);
452 if(pPrimarySite->channel <= MAX_GB_MODE_CHANEL)
454 if(pSiteMgr->pDesiredParams->siteMgrDesiredDot11Mode == DOT11_B_MODE)
456 pSiteMgr->siteMgrOperationalMode = DOT11_B_MODE;
457 slotTime = PHY_SLOT_TIME_LONG;
459 TRACE1(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, ": 11b Mode, Slot Time = %d\n", (TI_UINT8)slotTime);
463 pSiteMgr->siteMgrOperationalMode = DOT11_G_MODE;
465 if (((pPrimarySite->capabilities >> CAP_SLOT_TIME_SHIFT) & CAP_SLOT_TIME_MASK) == PHY_SLOT_TIME_SHORT)
467 slotTime = pSiteMgr->pDesiredParams->siteMgrDesiredSlotTime;
469 TRACE1(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, ": 11g Mode, Slot Time = %d (desired)\n", (TI_UINT8)slotTime);
473 slotTime = PHY_SLOT_TIME_LONG;
475 TRACE1(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, ": 11g Mode, Slot Time = %d\n", (TI_UINT8) slotTime);
479 pSiteMgr->radioBand = RADIO_BAND_2_4_GHZ;
480 pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = &pSiteMgr->pSitesMgmtParams->dot11BG_sitesTables;
484 pSiteMgr->siteMgrOperationalMode = DOT11_A_MODE;
485 pSiteMgr->radioBand = RADIO_BAND_5_0_GHZ;
486 slotTime = PHY_SLOT_TIME_SHORT;
488 TRACE1(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, ": 11a Mode, Slot Time = %d\n", (TI_UINT8)slotTime);
490 pSiteMgr->pSitesMgmtParams->pCurrentSiteTable = (siteTablesParams_t *)&pSiteMgr->pSitesMgmtParams->dot11A_sitesTables;
493 /* since we are moving to the different band, the siteMgr should be reconfigured */
494 if(pSiteMgr->prevRadioBand != pSiteMgr->radioBand)
495 siteMgr_bandParamsConfig(pSiteMgr, TI_TRUE);
497 if(pPrimarySite->channel <= MAX_GB_MODE_CHANEL)
498 siteMgr_updateRates(pSiteMgr, TI_FALSE, TI_TRUE);
500 siteMgr_updateRates(pSiteMgr, TI_TRUE, TI_TRUE);
502 /* configure hal with common core-hal parameters */
503 TWD_SetRadioBand (pSiteMgr->hTWD, pSiteMgr->radioBand);
505 pPrimarySite->currentSlotTime = slotTime;
506 TWD_CfgSlotTime (pSiteMgr->hTWD, slotTime);
508 /***************** Config Site Manager *************************/
509 /* L.M. Should be fixed, should take into account the AP's rates */
510 if(pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_CCK)
511 pSiteMgr->chosenModulation = DRV_MODULATION_CCK;
512 else if(pSiteMgr->pDesiredParams->siteMgrDesiredModulationType == DRV_MODULATION_PBCC)
514 if(pPrimarySite->probeModulation != DRV_MODULATION_NONE)
515 pSiteMgr->chosenModulation = pPrimarySite->probeModulation;
517 pSiteMgr->chosenModulation = pPrimarySite->beaconModulation;
520 pSiteMgr->chosenModulation = DRV_MODULATION_OFDM;
522 /* We use this variable in order tp perform the PBCC algorithm. */
523 pSiteMgr->currentDataModulation = pSiteMgr->chosenModulation;
524 /***************** Config Data CTRL *************************/
526 pParam->paramType = CTRL_DATA_CURRENT_BSSID_PARAM; /* Current BSSID */
527 MAC_COPY (pParam->content.ctrlDataCurrentBSSID, pPrimarySite->bssid);
528 ctrlData_setParam(pSiteMgr->hCtrlData, pParam);
530 pParam->paramType = CTRL_DATA_CURRENT_BSS_TYPE_PARAM; /* Current BSS Type */
531 pParam->content.ctrlDataCurrentBssType = pPrimarySite->bssType;
532 ctrlData_setParam(pSiteMgr->hCtrlData, pParam);
534 pParam->paramType = CTRL_DATA_CURRENT_PREAMBLE_TYPE_PARAM; /* Current Preamble Type */
535 if ((pSiteMgr->pDesiredParams->siteMgrDesiredPreambleType == PREAMBLE_SHORT) &&
536 (pPrimarySite->currentPreambleType == PREAMBLE_SHORT))
537 pParam->content.ctrlDataCurrentPreambleType = PREAMBLE_SHORT;
539 pParam->content.ctrlDataCurrentPreambleType = PREAMBLE_LONG;
540 ctrlData_setParam(pSiteMgr->hCtrlData, pParam);
542 /* Mutual Rates Matching */
543 StaTotalRates = pSiteMgr->pDesiredParams->siteMgrCurrentDesiredRateMask.basicRateMask |
544 pSiteMgr->pDesiredParams->siteMgrCurrentDesiredRateMask.supportedRateMask;
547 pSiteMgr->pDesiredParams->siteMgrMatchedSuppRateMask = StaTotalRates &
548 pPrimarySite->rateMask.supportedRateMask;
550 pSiteMgr->pDesiredParams->siteMgrMatchedBasicRateMask = StaTotalRates &
551 pPrimarySite->rateMask.basicRateMask;
552 if (pSiteMgr->pDesiredParams->siteMgrMatchedBasicRateMask == 0)
554 pSiteMgr->pDesiredParams->siteMgrMatchedBasicRateMask =
555 pSiteMgr->pDesiredParams->siteMgrCurrentDesiredRateMask.basicRateMask;
559 if(BSS_INDEPENDENT == pPrimarySite->bssType)
561 pParam->paramType = CTRL_DATA_CURRENT_IBSS_PROTECTION_PARAM;
565 pParam->paramType = CTRL_DATA_CURRENT_PROTECTION_STATUS_PARAM;
567 pParam->content.ctrlDataProtectionEnabled = pPrimarySite->useProtection;
568 ctrlData_setParam(pSiteMgr->hCtrlData, pParam);
570 pbccAlgorithm(pSiteMgr);
572 /********** Set Site QOS protocol support *************/
575 status = siteMgr_getWMEParamsSite(pSiteMgr,&p_ACParametersDummy);
578 pParam->content.qosSiteProtocol = QOS_WME;
582 pParam->content.qosSiteProtocol = QOS_NONE;
585 TRACE1(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, " systemConfigt() : pParam->content.qosSiteProtoco %d\n", pParam->content.qosSiteProtocol);
587 pParam->paramType = QOS_MNGR_SET_SITE_PROTOCOL;
588 qosMngr_setParams(pSiteMgr->hQosMngr, pParam);
590 /* Set active protocol in qosMngr according to station desired mode and site capabilities
591 Must be called BEFORE setting the "CURRENT_PS_MODE" into the QosMngr */
592 qosMngr_selectActiveProtocol(pSiteMgr->hQosMngr);
594 /* set PS capability parameter */
595 pParam->paramType = QOS_MNGR_CURRENT_PS_MODE;
596 if(pPrimarySite->APSDSupport == TI_TRUE)
597 pParam->content.currentPsMode = PS_SCHEME_UPSD_TRIGGER;
599 pParam->content.currentPsMode = PS_SCHEME_LEGACY;
600 qosMngr_setParams(pSiteMgr->hQosMngr, pParam);
602 /* Set upsd/ps_poll configuration */
603 /* Must be done AFTER setting the active Protocol */
604 qosMngr_setAcPsDeliveryMode (pSiteMgr->hQosMngr);
607 /********** Set Site HT setting support *************/
608 /* set HT setting to the FW */
609 /* verify 11n_Enable and Chip type */
610 StaCap_IsHtEnable (pSiteMgr->hStaCap, &b11nEnable);
612 /* verify that WME flag enable */
613 qosMngr_GetWmeEnableFlag (pSiteMgr->hQosMngr, &bWmeEnable);
615 if ((b11nEnable != TI_FALSE) &&
616 (bWmeEnable != TI_FALSE) &&
617 (pPrimarySite->tHtCapabilities.tHdr[0] != TI_FALSE) &&
618 (pPrimarySite->tHtInformation.tHdr[0] != TI_FALSE))
620 TWD_CfgSetFwHtCapabilities (pSiteMgr->hTWD, &pPrimarySite->tHtCapabilities, TI_TRUE);
621 TWD_CfgSetFwHtInformation (pSiteMgr->hTWD, &pPrimarySite->tHtInformation);
623 /* the FW not supported in HT control field in TX */
625 tHtControl.bHtEnable = TI_FALSE;
626 txCtrlParams_SetHtControl (pSiteMgr->hTxCtrl, &tHtControl);
630 TWD_CfgSetFwHtCapabilities (pSiteMgr->hTWD, &pPrimarySite->tHtCapabilities, TI_FALSE);
632 tHtControl.bHtEnable = TI_FALSE;
633 txCtrlParams_SetHtControl (pSiteMgr->hTxCtrl, &tHtControl);
636 /***************** Config RSN *************************/
637 /* Get the RSN IE data */
638 pRsnIe = pPrimarySite->pRsnIe;
641 while ((length < pPrimarySite->rsnIeLen) && (pPrimarySite->rsnIeLen < 255)
642 && (rsnIECount < MAX_RSN_IE))
644 curRsnData[0+length] = pRsnIe->hdr[0];
645 curRsnData[1+length] = pRsnIe->hdr[1];
646 os_memoryCopy(pSiteMgr->hOs, &curRsnData[2+length], (void *)pRsnIe->rsnIeData, pRsnIe->hdr[1]);
647 length += pRsnIe->hdr[1]+2;
651 if (length<pPrimarySite->rsnIeLen)
653 TRACE2(pSiteMgr->hReport, REPORT_SEVERITY_ERROR, "siteMgr_selectSiteFromTable, RSN IE is too long: rsnIeLen=%d, MAX_RSN_IE=%d\n", pPrimarySite->rsnIeLen, MAX_RSN_IE);
656 rsnData.pIe = (pPrimarySite->rsnIeLen==0) ? NULL : curRsnData;
657 rsnData.ieLen = pPrimarySite->rsnIeLen;
658 rsnData.privacy = pPrimarySite->privacy;
660 rsn_setSite(pSiteMgr->hRsn, &rsnData, NULL, &rsnAssocIeLen);
662 /***************** Config RegulatoryDomain **************************/
664 #ifdef XCC_MODULE_INCLUDED
665 /* set XCC TPC if present */
666 if(XCC_ParseClientTP(pSiteMgr->hOs,pPrimarySite,(TI_INT8 *)&ExternTxPower,pIeBuffer,PktLength) == TI_OK)
668 TRACE1(pSiteMgr->hReport, REPORT_SEVERITY_INFORMATION, "Select XCC_ParseClientTP == OK: Dbm = %d\n",ExternTxPower);
669 pParam->paramType = REGULATORY_DOMAIN_EXTERN_TX_POWER_PREFERRED;
670 pParam->content.ExternTxPowerPreferred = ExternTxPower;
671 regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain, pParam);
673 /* Parse and save the XCC Version Number if exists */
674 XCCMngr_parseXCCVer(pSiteMgr->hXCCMngr, pIeBuffer, PktLength);
678 /* Note: TX Power Control adjustment is now done through siteMgr_assocReport() */
679 if (pPrimarySite->powerConstraint>0)
680 { /* setting power constraint */
681 pParam->paramType = REGULATORY_DOMAIN_SET_POWER_CONSTRAINT_PARAM;
682 pParam->content.powerConstraint = pPrimarySite->powerConstraint;
683 regulatoryDomain_setParam(pSiteMgr->hRegulatoryDomain, pParam);
687 /***************** Config MeasurementMgr object **************************/
688 capabilities = pPrimarySite->capabilities;
690 /* Updating the Measurement Module Mode */
691 measurementMgr_setMeasurementMode(pSiteMgr->hMeasurementMgr, capabilities,
692 pIeBuffer, PktLength);
693 os_memoryFree(pSiteMgr->hOs, curRsnData, MAX_RSN_DATA_SIZE);
694 os_memoryFree(pSiteMgr->hOs, pParam, sizeof(paramInfo_t));