/**************************************************************************** * 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); }
/**************************************************************************** * cmdBld_CfgBeaconFilterTable **************************************************************************** * DESCRIPTION: Sets Beacon filtering state * * INPUTS: None * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgBeaconFilterTable (TI_HANDLE hCmdBld, TI_UINT8 uNumberOfIEs, TI_UINT8 *pIETable, TI_UINT8 uIETableSize, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; if (uIETableSize > BEACON_FILTER_TABLE_MAX_SIZE) { TRACE2(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_CfgBeaconFilterTable: Table size is too big %d (>%d)\n", uIETableSize, BEACON_FILTER_TABLE_MAX_SIZE); return PARAM_VALUE_NOT_VALID; } os_memoryZero (pCmdBld->hOs, (void *)DB_WLAN(hCmdBld).beaconFilterIETable.IETable, BEACON_FILTER_TABLE_MAX_SIZE); os_memoryCopy (pCmdBld->hOs, (void *)DB_WLAN(hCmdBld).beaconFilterIETable.IETable, (void *)pIETable, uIETableSize); DB_WLAN(hCmdBld).beaconFilterIETable.numberOfIEs = uNumberOfIEs; DB_WLAN(hCmdBld).beaconFilterIETable.IETableSize = uIETableSize; return cmdBld_CfgIeBeaconFilterTable (hCmdBld, uNumberOfIEs, pIETable, uIETableSize, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgDcoItrimParams() **************************************************************************** * DESCRIPTION: Sets the DCO Itrim parameters. * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgDcoItrimParams (TI_HANDLE hCmdBld, TI_BOOL enable, TI_UINT32 moderationTimeoutUsec, void *fCb, TI_HANDLE hCb) { /* Keeps the parameters in the db */ DB_WLAN(hCmdBld).dcoItrimEnabled = enable; DB_WLAN(hCmdBld).dcoItrimModerationTimeoutUsec = moderationTimeoutUsec; return cmdBld_CfgIeDcoItrimParams (hCmdBld, enable, moderationTimeoutUsec, fCb, hCb); }
/* * ---------------------------------------------------------------------------- * Function : cmdBld_CfgBet * * Input : enabled - 0 to disable BET, 0 to disable BET * MaximumConsecutiveET - Max number of consecutive beacons * that may be early terminated. * Output : TI_STATUS * Process : Configures Beacon Early Termination information element. * Note(s) : None * ----------------------------------------------------------------------------- */ TI_STATUS cmdBld_CfgBet (TI_HANDLE hCmdBld, TI_UINT8 Enable, TI_UINT8 MaximumConsecutiveET, void *fCb, TI_HANDLE hCb) { CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_BET) DB_WLAN(hCmdBld).BetEnable = Enable; DB_WLAN(hCmdBld).MaximumConsecutiveET = MaximumConsecutiveET; return cmdBld_CfgIeBet (hCmdBld, Enable, MaximumConsecutiveET, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgArpIpFilter() **************************************************************************** * DESCRIPTION: Enable\Disable the ARP filter * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgArpIpFilter (TI_HANDLE hCmdBld, TIpAddr tIpAddr, void *fCb, TI_HANDLE hCb) { /* no support for IPV6 */ IP_COPY (DB_WLAN(hCmdBld).arp_IP_addr, tIpAddr); return cmdBld_CfgIeArpIpFilter (hCmdBld, tIpAddr, DB_WLAN(hCmdBld).arpFilterType, fCb, hCb); }
/**************************************************************************** * cmdBld_CmdIeStartBss() **************************************************************************** * DESCRIPTION: Construct the StartBss command fileds and send it to the mailbox * * INPUTS: None * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CmdIeStartBss (TI_HANDLE hCmdBld, BSS_e BssType, void *fJoinCompleteCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; StartJoinRequest_t AcxCmd_StartBss; StartJoinRequest_t *pCmd = &AcxCmd_StartBss; TSsid *pSsid = &DB_BSS(hCmdBld).tSsid; TBssInfoParams *pBssInfoParams = &DB_BSS(hCmdBld); TI_UINT8 *BssId; TI_UINT8 *cmdBssId; EHwRateBitFiled HwBasicRatesBitmap; TI_UINT32 i; os_memoryZero (pCmdBld->hOs, (void *)pCmd, sizeof(StartJoinRequest_t)); /* * Set RxCfg and RxFilterCfg values */ pCmd->rxFilter.ConfigOptions = ENDIAN_HANDLE_LONG (DB_WLAN(hCmdBld).RxConfigOption); pCmd->rxFilter.FilterOptions = ENDIAN_HANDLE_LONG (DB_WLAN(hCmdBld).RxFilterOption); pCmd->beaconInterval = ENDIAN_HANDLE_WORD (DB_BSS(hCmdBld).BeaconInterval); pCmd->dtimInterval = DB_BSS(hCmdBld).DtimInterval; pCmd->channelNumber = DB_BSS(hCmdBld).RadioChannel; pCmd->bssType = BssType; /* Add radio band */ pCmd->bssType |= DB_WLAN(hCmdBld).RadioBand << 4; /* Bits 0-2: Tx-Session-Count. bit 7: indicates if to flush the Tx queues */ pCmd->ctrl = pBssInfoParams->Ctrl; /* * BasicRateSet * The wlan hardware uses pHwMboxCmd field to determine the rate at which to transmit * control frame responses (such as ACK or CTS frames) */ cmdBld_ConvertAppRatesBitmap (pBssInfoParams->BasicRateSet, 0, &HwBasicRatesBitmap); pCmd->basicRateSet = ENDIAN_HANDLE_LONG(HwBasicRatesBitmap); /* BSS ID - reversed order (see wlan hardware spec) */ BssId = DB_BSS(hCmdBld).BssId; cmdBssId = (TI_UINT8*)&pCmd->bssIdL; for (i = 0; i < MAC_ADDR_LEN; i++) cmdBssId[i] = BssId[MAC_ADDR_LEN - 1 - i]; /* SSID string */ pCmd->ssidLength = pSsid->len; os_memoryCopy (pCmdBld->hOs, (void *)pCmd->ssidStr, (void *)pSsid->str, pSsid->len); return cmdQueue_SendCommand (pCmdBld->hCmdQueue, CMD_START_JOIN, (TI_CHAR *)pCmd, sizeof(*pCmd), fJoinCompleteCb, hCb, NULL); }
/**************************************************************************** * cmdBld_CfgRssiSnrWeights() **************************************************************************** * DESCRIPTION: Set RSSI/SNR Weights for Average calculations. * * INPUTS: * * OUTPUT: None * * RETURNS: None ****************************************************************************/ TI_STATUS cmdBld_CfgRssiSnrWeights (TI_HANDLE hCmdBld, RssiSnrAverageWeights_t *pWeightsParam, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; TRACE4(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "\n cmdBld_CfgRssiSnrWeights :\n uRssiBeaconAverageWeight = %d\n uRssiPacketAverageWeight = %d\n uSnrBeaconAverageWeight = %d\n uSnrPacketAverageWeight = %d \n ", pWeightsParam->rssiBeaconAverageWeight, pWeightsParam->rssiPacketAverageWeight, pWeightsParam->snrBeaconAverageWeight , pWeightsParam->snrPacketAverageWeight ); DB_WLAN(hCmdBld).tRssiSnrWeights.rssiBeaconAverageWeight = pWeightsParam->rssiBeaconAverageWeight; DB_WLAN(hCmdBld).tRssiSnrWeights.rssiPacketAverageWeight = pWeightsParam->rssiPacketAverageWeight; DB_WLAN(hCmdBld).tRssiSnrWeights.snrBeaconAverageWeight = pWeightsParam->snrBeaconAverageWeight ; DB_WLAN(hCmdBld).tRssiSnrWeights.snrPacketAverageWeight = pWeightsParam->snrPacketAverageWeight ; return cmdBld_CfgIeRssiSnrWeights (hCmdBld, pWeightsParam, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgArpIpAddrTable() **************************************************************************** * DESCRIPTION: Sets the ARP IP table according to the given configuration. * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgArpIpAddrTable (TI_HANDLE hCmdBld, TIpAddr tIpAddr, TI_UINT8 bEnabled, EIpVer eIpVer, void *fCb, TI_HANDLE hCb) { DB_WLAN(hCmdBld).arp_IP_ver = eIpVer; /* no support for IPV6 */ if (eIpVer == IP_VER_4) { IP_COPY (DB_WLAN(hCmdBld).arp_IP_addr, tIpAddr); } DB_WLAN(hCmdBld).arpFilterType = (EArpFilterType)bEnabled; /* Set the new ip with the current state (e/d) */ return cmdBld_CfgIeArpIpFilter (hCmdBld, tIpAddr, (EArpFilterType)bEnabled, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgBeaconFilterOpt **************************************************************************** * DESCRIPTION: Sets Beacon filtering state * * INPUTS: None * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgBeaconFilterOpt (TI_HANDLE hCmdBld, TI_UINT8 uBeaconFilteringStatus, TI_UINT8 uNumOfBeaconsToBuffer, void *fCb, TI_HANDLE hCb) { DB_WLAN(hCmdBld).beaconFilterParams.desiredState = uBeaconFilteringStatus; DB_WLAN(hCmdBld).beaconFilterParams.numOfElements = uNumOfBeaconsToBuffer; return cmdBld_CfgIeBeaconFilterOpt (hCmdBld, uBeaconFilteringStatus, uNumOfBeaconsToBuffer, fCb, hCb); }
TI_STATUS cmdBld_CfgConnMonitParams (TI_HANDLE hCmdBld, TRroamingTriggerParams *pRoamingTriggerCmd, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_CONN_MONIT_PARAMS) TRACE2(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "SetBssLossTsfThresholdParamsCmd :\n BssLossTimeout = %d\n TsfMissThreshold = %d \n ", pRoamingTriggerCmd->BssLossTimeout, pRoamingTriggerCmd->TsfMissThreshold); DB_WLAN(hCmdBld).roamTriggers.BssLossTimeout = pRoamingTriggerCmd->BssLossTimeout; DB_WLAN(hCmdBld).roamTriggers.TsfMissThreshold = pRoamingTriggerCmd->TsfMissThreshold; return cmdBld_CfgIeConnMonitParams (hCmdBld, pRoamingTriggerCmd, fCb, hCb); }
/* * ---------------------------------------------------------------------------- * Function : cmdBld_CfgHwEncEnable * * Input : * Output : * Process : * Note(s) : * ----------------------------------------------------------------------------- */ TI_STATUS cmdBld_CfgHwEncEnable (TI_HANDLE hCmdBld, TI_BOOL bHwEncEnable, TI_BOOL bHwDecEnable, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; TWlanParams *pWlanParams = &DB_WLAN(hCmdBld); /* Store the HW encryption Enable flag for reconfigure time (FW reload)*/ DB_KEYS(pCmdBld).bReconfHwEncEnable = bHwEncEnable; DB_KEYS(pCmdBld).bHwEncDecrEnableValid = TI_TRUE; if (bHwEncEnable) { pWlanParams->FeatureDataFlowOptions &= ~DF_ENCRYPTION_DISABLE; } else { pWlanParams->FeatureDataFlowOptions |= DF_ENCRYPTION_DISABLE; } /* Set bit DF_SNIFF_MODE_ENABLE to enable or prevent decryption in fw */ /* WARNING: Have to check how to control the decryption (which bit) and then set/reset the appropriate bit*/ if (bHwDecEnable) { pWlanParams->FeatureDataFlowOptions &= ~DF_SNIFF_MODE_ENABLE; } else { pWlanParams->FeatureDataFlowOptions |= DF_SNIFF_MODE_ENABLE; } return cmdBld_CfgIeFeatureConfig (hCmdBld, pWlanParams->FeatureOptions, pWlanParams->FeatureDataFlowOptions, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgCoexActivity() **************************************************************************** * DESCRIPTION: Sets the CoexActivity table. * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK pWlanParams->RtsThreshold ****************************************************************************/ TI_STATUS cmdBld_CfgCoexActivity (TI_HANDLE hCmdBld, TCoexActivity *pCoexActivity, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; TWlanParams *pWlanParams = &DB_WLAN(hCmdBld); TCoexActivity *pSaveCoex = &pWlanParams->tWlanParamsCoexActivityTable.entry[0]; int numOfElements = pWlanParams->tWlanParamsCoexActivityTable.numOfElements; int i; /* Check if to overwrite existing entry or put on last index */ for (i=0; i<numOfElements; i++) { if ((pSaveCoex[i].activityId == pCoexActivity->activityId) && (pSaveCoex->coexIp == pCoexActivity->coexIp)) { break; } } TRACE4(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION , "cmdBld_CfgCoexActivity: save Param %d in index %d, %d %d\n", 0, i, pCoexActivity->coexIp, pCoexActivity->activityId); /* save in WlanParams for recovery */ pSaveCoex[i].coexIp = pCoexActivity->coexIp; pSaveCoex[i].activityId = pCoexActivity->activityId; pSaveCoex[i].defaultPriority = pCoexActivity->defaultPriority; pSaveCoex[i].raisedPriority = pCoexActivity->raisedPriority; pSaveCoex[i].minService = pCoexActivity->minService; pSaveCoex[i].maxService = pCoexActivity->maxService; if (i == numOfElements) { /* no existing entry overwrite, increment number of elements */ pWlanParams->tWlanParamsCoexActivityTable.numOfElements++; } return cmdBld_CfgIeCoexActivity (hCmdBld, pCoexActivity, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgMaxTxRetry() **************************************************************************** * DESCRIPTION: Set Max Tx retry parmaters. * * INPUTS: * maxTxRetry max Tx Retry * * OUTPUT: None * * RETURNS: None ****************************************************************************/ TI_STATUS cmdBld_CfgMaxTxRetry (TI_HANDLE hCmdBld, TRroamingTriggerParams *pRoamingTriggerCmd, void *fCb, TI_HANDLE hCb) { CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_MAX_TX_RETRY) DB_WLAN(hCmdBld).roamTriggers.maxTxRetry = pRoamingTriggerCmd->maxTxRetry; return cmdBld_CfgIeMaxTxRetry (hCmdBld, pRoamingTriggerCmd, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgPreamble() **************************************************************************** * DESCRIPTION: Set the preamble in ?????? hardware register * * INPUTS: * preambleVal * * OUTPUT: None * * RETURNS: None ****************************************************************************/ TI_STATUS cmdBld_CfgPreamble (TI_HANDLE hCmdBld, Preamble_e ePreamble, void *fCb, TI_HANDLE hCb) { CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_PREAMBLE_JOIN) DB_WLAN(hCmdBld).preamble = ePreamble; return cmdBld_CfgIePreamble (hCmdBld, (TI_UINT8)ePreamble, fCb, hCb); }
TI_STATUS cmdBld_CfgCtsProtection (TI_HANDLE hCmdBld, TI_UINT8 uCtsProtection, void *fCb, TI_HANDLE hCb) { CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_CTS_PROTECTION) DB_WLAN(hCmdBld).CtsToSelf = uCtsProtection; return cmdBld_CfgIeCtsProtection (hCmdBld, uCtsProtection, fCb, hCb); }
void TWD_GetTwdHtCapabilities (TI_HANDLE hTWD, TTwdHtCapabilities **pTwdHtCapabilities) { TTwd *pTWD = (TTwd *)hTWD; TWlanParams *pWlanParams = &DB_WLAN(pTWD->hCmdBld); *pTwdHtCapabilities = &(pWlanParams->tTwdHtCapabilities); }
/**************************************************************************** * cmdBld_CfgSgEnable() **************************************************************************** * DESCRIPTION: Save Soft Gemini enable parameter * * INPUTS: * * OUTPUT: * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgSgEnable (TI_HANDLE hCmdBld, ESoftGeminiEnableModes eSgEnable, void *fCb, TI_HANDLE hCb) { CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_SG_ENABLE) DB_WLAN(hCmdBld).SoftGeminiEnable = eSgEnable; return cmdBld_CfgIeSgEnable (hCmdBld, eSgEnable, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgSleepAuth () **************************************************************************** * DESCRIPTION: Set the min power level * * INPUTS: * * OUTPUT: * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgSleepAuth (TI_HANDLE hCmdBld, EPowerPolicy eMinPowerLevel, void *fCb, TI_HANDLE hCb) { CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CMD_POWER_AUTH) /* Save th parameter in database */ DB_WLAN(hCmdBld).minPowerLevel = eMinPowerLevel; return cmdBld_CfgIeSleepAuth (hCmdBld, eMinPowerLevel, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgFmCoex() **************************************************************************** * DESCRIPTION: Save and configure FM coexistence parameters * * INPUTS: * * OUTPUT: * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgFmCoex (TI_HANDLE hCmdBld, TFmCoexParams *pFmCoexParams, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; /* Copy params for recovery */ os_memoryCopy (pCmdBld->hOs, (void*)&(DB_WLAN(hCmdBld).tFmCoexParams), (void*)pFmCoexParams, sizeof(TFmCoexParams)); return cmdBld_CfgIeFmCoex (hCmdBld, pFmCoexParams, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgSg() **************************************************************************** * DESCRIPTION: Save Soft Gemini config parameter * * INPUTS: * * OUTPUT: * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgSg (TI_HANDLE hCmdBld, TSoftGeminiParams *pSgParam, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_SG) /* Copy params for recovery */ os_memoryCopy (pCmdBld->hOs, (void*)&DB_WLAN(hCmdBld).SoftGeminiParams, (void*)pSgParam, sizeof(TSoftGeminiParams)); return cmdBld_CfgIeSg (hCmdBld, pSgParam, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgRssiSnrTrigger() **************************************************************************** * DESCRIPTION: Set the RSSI/SNR Trigger parameters. * * INPUTS: * * OUTPUT: None * * RETURNS: None ****************************************************************************/ TI_STATUS cmdBld_CfgRssiSnrTrigger (TI_HANDLE hCmdBld, RssiSnrTriggerCfg_t *pTriggerParam, void *fCb, TI_HANDLE hCb) { CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, (__CFG_RSSI_SNR_TRIGGER_0 + pTriggerParam->index)) DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].index = pTriggerParam->index; DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].threshold = pTriggerParam->threshold; DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].pacing = pTriggerParam->pacing; DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].metric = pTriggerParam->metric; DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].type = pTriggerParam->type; DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].direction = pTriggerParam->direction; DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].hystersis = pTriggerParam->hystersis; DB_WLAN(hCmdBld).tRssiSnrTrigger[pTriggerParam->index].enable = pTriggerParam->enable; return cmdBld_CfgIeRssiSnrTrigger (hCmdBld, pTriggerParam, fCb, hCb); }
TI_STATUS cmdBld_CfgSlotTime (TI_HANDLE hCmdBld, ESlotTime eSlotTime, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_SLOT_TIME) CMD_BLD_MARK_INIT_SEQUENCE_CMD_AS_VALID(hCmdBld, __CFG_SLOT_TIME_JOIN) DB_WLAN(hCmdBld).SlotTime = eSlotTime; TRACE1(pCmdBld->hReport, REPORT_SEVERITY_INFORMATION, "cmdBld_CfgSlotTime: Slot time = %d\n", eSlotTime); /* Configure the new Slot-Time value to the FW. */ return cmdBld_CfgIeSlotTime (hCmdBld, (TI_UINT8)eSlotTime, fCb, hCb); }
TI_STATUS cmdBld_CfgClkRun (TI_HANDLE hCmdBld, TI_BOOL aClkRunEnable, void *fCb, TI_HANDLE hCb) { TWlanParams *pWlanParams = &DB_WLAN(hCmdBld); if (aClkRunEnable) { pWlanParams->FeatureDataFlowOptions |= FEAT_PCI_CLK_RUN_ENABLE; } else { pWlanParams->FeatureDataFlowOptions &= ~FEAT_PCI_CLK_RUN_ENABLE; } return cmdBld_CfgIeFeatureConfig (hCmdBld, pWlanParams->FeatureOptions, pWlanParams->FeatureDataFlowOptions, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgRx() **************************************************************************** * DESCRIPTION: Sets the filters according to the given configuration. * * INPUTS: RxConfigOption - The given Rx filters configuration * RxFilterOption - The given Rx filters options * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgRx (TI_HANDLE hCmdBld, TI_UINT32 uRxConfigOption, TI_UINT32 uRxFilterOption, void *fCb, TI_HANDLE hCb) { DB_WLAN(hCmdBld).RxConfigOption = uRxConfigOption; DB_WLAN(hCmdBld).RxFilterOption = uRxFilterOption; DB_WLAN(hCmdBld).RxConfigOption |= RX_CFG_ENABLE_PHY_HEADER_PLCP; #if defined (TNETW_MASTER_MODE) || defined (TNETW_USB_MODE) DB_WLAN(hCmdBld).RxConfigOption |= RX_CFG_COPY_RX_STATUS; #endif if (DB_WLAN(hCmdBld).RxDisableBroadcast) { DB_WLAN(hCmdBld).RxConfigOption |= RX_CFG_DISABLE_BCAST; } return cmdBld_CfgIeRx (hCmdBld, DB_WLAN(hCmdBld).RxConfigOption, DB_WLAN(hCmdBld).RxFilterOption, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgArmClock() **************************************************************************** * DESCRIPTION: Configure the arm clock * !!! Note that the firmware will set the slot time according to the new clock * * INPUTS: None * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgArmClock (TI_HANDLE hCmdBld, TI_UINT32 uArmClock, void *fCb, TI_HANDLE hCb) { TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; TWlanParams *pWlanParams = &DB_WLAN(hCmdBld); pWlanParams->ArmClock = uArmClock; /* Illegal combination Mac=80, Arm=40 ==> force setting 40/40*/ if (pWlanParams->MacClock == HW_CLOCK_80_MHZ && pWlanParams->ArmClock == HW_CLOCK_40_MHZ) { TRACE0(pCmdBld->hReport, REPORT_SEVERITY_ERROR, "cmdBld_ArmClockSet: Illegal combination Mac=80, Arm=40 ==> force setting 40/40\n"); pWlanParams->MacClock = HW_CLOCK_40_MHZ; } return cmdBld_CfgIeFeatureConfig (hCmdBld, pWlanParams->FeatureOptions, pWlanParams->FeatureDataFlowOptions, fCb, hCb); }
TI_STATUS cmdBld_CfgRxMsduFormat (TI_HANDLE hCmdBld, TI_BOOL bRxMsduForamtEnable, void *fCb, TI_HANDLE hCb) { #if 1 /* WARNING: Have to check how to control the Rx Frame format select (which bit) and then access the HW*/ return TI_OK; #else TCmdBld *pCmdBld = (TCmdBld *)hCmdBld; TWlanParams *pWlanParams = &DB_WLAN(hCmdBld); if (aRxMsduForamtEnable) { pWlanParams->FeatureDataFlowOptions |= DATA_FLOW_RX_MSDU_FRAME; } else { pWlanParams->FeatureDataFlowOptions &= ~DATA_FLOW_RX_MSDU_FRAME; } return cmdBld_CfgIeFeatureConfig (hCmdBld, pWlanParams->FeatureOptions, pWlanParams->FeatureDataFlowOptions, fCb, hCb); #endif }
TI_STATUS TWD_SetDefaults (TI_HANDLE hTWD, TTwdInitParams *pInitParams) { TTwd *pTWD = (TTwd *)hTWD; TWlanParams *pWlanParams = &DB_WLAN(pTWD->hCmdBld); TKeepAliveList *pKlvParams = &DB_KLV(pTWD->hCmdBld); IniFileRadioParam *pRadioParams = &DB_RADIO(pTWD->hCmdBld); IniFileGeneralParam *pGenParams = &DB_GEN(pTWD->hCmdBld); TRateMngParams *pRateMngParams = &DB_RM(pTWD->hCmdBld); TDmaParams *pDmaParams = &DB_DMA(pTWD->hCmdBld); TI_UINT32 k, uIndex; int iParam; pTWD->bRecoveryEnabled = pInitParams->tGeneral.halCtrlRecoveryEnable; pWlanParams->PacketDetectionThreshold = pInitParams->tGeneral.packetDetectionThreshold; pWlanParams->qosNullDataTemplateSize = pInitParams->tGeneral.qosNullDataTemplateSize; pWlanParams->PsPollTemplateSize = pInitParams->tGeneral.PsPollTemplateSize; pWlanParams->probeResponseTemplateSize = pInitParams->tGeneral.probeResponseTemplateSize; pWlanParams->probeRequestTemplateSize = pInitParams->tGeneral.probeRequestTemplateSize; pWlanParams->beaconTemplateSize = pInitParams->tGeneral.beaconTemplateSize; pWlanParams->nullTemplateSize = pInitParams->tGeneral.nullTemplateSize; pWlanParams->disconnTemplateSize = pInitParams->tGeneral.disconnTemplateSize; pWlanParams->ArpRspTemplateSize = pInitParams->tGeneral.ArpRspTemplateSize; /* Beacon broadcast options */ pWlanParams->BcnBrcOptions.BeaconRxTimeout = pInitParams->tGeneral.BeaconRxTimeout; pWlanParams->BcnBrcOptions.BroadcastRxTimeout = pInitParams->tGeneral.BroadcastRxTimeout; pWlanParams->BcnBrcOptions.RxBroadcastInPs = pInitParams->tGeneral.RxBroadcastInPs; pWlanParams->ConsecutivePsPollDeliveryFailureThreshold = pInitParams->tGeneral.ConsecutivePsPollDeliveryFailureThreshold; pWlanParams->RxDisableBroadcast = pInitParams->tGeneral.halCtrlRxDisableBroadcast; pWlanParams->calibrationChannel2_4 = pInitParams->tGeneral.halCtrlCalibrationChannel2_4; pWlanParams->calibrationChannel5_0 = pInitParams->tGeneral.halCtrlCalibrationChannel5_0; /* Not used but need by Palau */ pWlanParams->RtsThreshold = pInitParams->tGeneral.halCtrlRtsThreshold; pWlanParams->CtsToSelf = CTS_TO_SELF_DISABLE; pWlanParams->WiFiWmmPS = pInitParams->tGeneral.WiFiWmmPS; pWlanParams->MaxTxMsduLifetime = pInitParams->tGeneral.halCtrlMaxTxMsduLifetime; pWlanParams->MaxRxMsduLifetime = pInitParams->tGeneral.halCtrlMaxRxMsduLifetime; pWlanParams->rxTimeOut.psPoll = pInitParams->tGeneral.rxTimeOut.psPoll; pWlanParams->rxTimeOut.UPSD = pInitParams->tGeneral.rxTimeOut.UPSD; /* RSSI/SNR Weights for Average calculations */ pWlanParams->tRssiSnrWeights.rssiBeaconAverageWeight = pInitParams->tGeneral.uRssiBeaconAverageWeight; pWlanParams->tRssiSnrWeights.rssiPacketAverageWeight = pInitParams->tGeneral.uRssiPacketAverageWeight; pWlanParams->tRssiSnrWeights.snrBeaconAverageWeight = pInitParams->tGeneral.uSnrBeaconAverageWeight ; pWlanParams->tRssiSnrWeights.snrPacketAverageWeight = pInitParams->tGeneral.uSnrPacketAverageWeight ; /* PM config params */ pWlanParams->uHostClkSettlingTime = pInitParams->tGeneral.uHostClkSettlingTime; pWlanParams->uHostFastWakeupSupport = pInitParams->tGeneral.uHostFastWakeupSupport; /* No used */ pWlanParams->FragmentThreshold = pInitParams->tGeneral.halCtrlFragThreshold; pWlanParams->ListenInterval = (TI_UINT8)pInitParams->tGeneral.halCtrlListenInterval; pWlanParams->RateFallback = pInitParams->tGeneral.halCtrlRateFallbackRetry; pWlanParams->MacClock = pInitParams->tGeneral.halCtrlMacClock; pWlanParams->ArmClock = pInitParams->tGeneral.halCtrlArmClock; /* Data interrupts pacing */ pWlanParams->TxCompletePacingThreshold = pInitParams->tGeneral.TxCompletePacingThreshold; pWlanParams->TxCompletePacingTimeout = pInitParams->tGeneral.TxCompletePacingTimeout; pWlanParams->RxIntrPacingThreshold = pInitParams->tGeneral.RxIntrPacingThreshold; pWlanParams->RxIntrPacingTimeout = pInitParams->tGeneral.RxIntrPacingTimeout; /* Number of Rx mem-blocks to allocate in FW */ pDmaParams->NumRxBlocks = pInitParams->tGeneral.uRxMemBlksNum; /* Configure ARP IP */ pWlanParams->arpFilterType = pInitParams->tArpIpFilter.filterType; IP_COPY (pWlanParams->arp_IP_addr, pInitParams->tArpIpFilter.addr); /* Configure address group */ pWlanParams->numGroupAddrs = pInitParams->tMacAddrFilter.numOfMacAddresses; pWlanParams->isMacAddrFilteringnabled = pInitParams->tMacAddrFilter.isFilterEnabled; for (k = 0; k < pWlanParams->numGroupAddrs; k++) { MAC_COPY (pWlanParams->aGroupAddr[k], pInitParams->tMacAddrFilter.macAddrTable[k]); } /* CoexActivity Table */ pWlanParams->tWlanParamsCoexActivityTable.numOfElements = 0; for (iParam=0; iParam < (int)pInitParams->tGeneral.halCoexActivityTable.numOfElements; iParam++) { TCoexActivity *pSaveCoex = &pWlanParams->tWlanParamsCoexActivityTable.entry[0]; TCoexActivity *pParmCoex = &pInitParams->tGeneral.halCoexActivityTable.entry[0]; int i, saveIndex; /* Check if to overwrite existing entry or put on last index */ for (i=0; i<iParam; i++) { if ((pSaveCoex[i].activityId == pParmCoex[iParam].activityId) && (pSaveCoex[i].coexIp == pParmCoex[iParam].coexIp)) { break; } } if (i == iParam) { /* new entry */ saveIndex = pWlanParams->tWlanParamsCoexActivityTable.numOfElements; pWlanParams->tWlanParamsCoexActivityTable.numOfElements++; } else { /* overwrite existing */ saveIndex = i; } pSaveCoex[saveIndex].coexIp = pParmCoex[iParam].coexIp; pSaveCoex[saveIndex].activityId = pParmCoex[iParam].activityId; pSaveCoex[saveIndex].defaultPriority = pParmCoex[iParam].defaultPriority; pSaveCoex[saveIndex].raisedPriority = pParmCoex[iParam].raisedPriority; pSaveCoex[saveIndex].minService = pParmCoex[iParam].minService; pSaveCoex[saveIndex].maxService = pParmCoex[iParam].maxService; } /* configure keep-alive default mode to enabled */ pKlvParams->enaDisFlag = TI_TRUE; for (uIndex = 0; uIndex < KLV_MAX_TMPL_NUM; uIndex++) { pKlvParams->keepAliveParams[ uIndex ].enaDisFlag = TI_FALSE; } /* Configure the TWD modules */ rxXfer_SetDefaults (pTWD->hRxXfer, pInitParams); txXfer_SetDefaults (pTWD->hTxXfer, pInitParams); txHwQueue_Config (pTWD->hTxHwQueue, pInitParams); MacServices_config (pTWD->hMacServices, pInitParams); /* * 802.11n */ pWlanParams->tTwdHtCapabilities.b11nEnable = pInitParams->tGeneral.b11nEnable; /* Configure HT capabilities setting */ pWlanParams->tTwdHtCapabilities.uChannelWidth = CHANNEL_WIDTH_20MHZ; pWlanParams->tTwdHtCapabilities.uRxSTBC = RXSTBC_SUPPORTED_ONE_SPATIAL_STREAM; pWlanParams->tTwdHtCapabilities.uMaxAMSDU = MAX_MSDU_3839_OCTETS; pWlanParams->tTwdHtCapabilities.uMaxAMPDU = MAX_MPDU_8191_OCTETS; pWlanParams->tTwdHtCapabilities.uAMPDUSpacing = AMPDU_SPC_8_MICROSECONDS; pWlanParams->tTwdHtCapabilities.aRxMCS[0] = (MCS_SUPPORT_MCS_0 | MCS_SUPPORT_MCS_1 | MCS_SUPPORT_MCS_2 | MCS_SUPPORT_MCS_3 | MCS_SUPPORT_MCS_4 | MCS_SUPPORT_MCS_5 | MCS_SUPPORT_MCS_6 | MCS_SUPPORT_MCS_7); os_memoryZero (pTWD->hOs, pWlanParams->tTwdHtCapabilities.aRxMCS + 1, RX_TX_MCS_BITMASK_SIZE - 1); pWlanParams->tTwdHtCapabilities.aTxMCS[0] = (MCS_SUPPORT_MCS_0 | MCS_SUPPORT_MCS_1 | MCS_SUPPORT_MCS_2 | MCS_SUPPORT_MCS_3 | MCS_SUPPORT_MCS_4 | MCS_SUPPORT_MCS_5 | MCS_SUPPORT_MCS_6 | MCS_SUPPORT_MCS_7); os_memoryZero (pTWD->hOs, pWlanParams->tTwdHtCapabilities.aTxMCS + 1, RX_TX_MCS_BITMASK_SIZE - 1); pWlanParams->tTwdHtCapabilities.uRxMaxDataRate = MCS_HIGHEST_SUPPORTED_RECEPTION_DATA_RATE_IN_MBIT_S; pWlanParams->tTwdHtCapabilities.uPCOTransTime = PCO_TRANS_TIME_NO_TRANSITION; pWlanParams->tTwdHtCapabilities.uHTCapabilitiesBitMask = (CAP_BIT_MASK_GREENFIELD_FRAME_FORMAT | CAP_BIT_MASK_SHORT_GI_FOR_20MHZ_PACKETS); pWlanParams->tTwdHtCapabilities.uMCSFeedback = MCS_FEEDBACK_NO; os_memoryCopy(pTWD->hOs, (void*)pRadioParams, (void*)&pInitParams->tIniFileRadioParams, sizeof(IniFileRadioParam)); os_memoryCopy(pTWD->hOs, (void*)pGenParams, (void*)&pInitParams->tPlatformGenParams, sizeof(IniFileGeneralParam)); os_memoryCopy (pTWD->hOs, (void*)&(pWlanParams->tFmCoexParams), (void*)&(pInitParams->tGeneral.tFmCoexParams), sizeof(TFmCoexParams)); /* Rate management params */ pRateMngParams->rateMngParams.InverseCuriosityFactor = pInitParams->tRateMngParams.InverseCuriosityFactor; pRateMngParams->rateMngParams.MaxPer = pInitParams->tRateMngParams.MaxPer; pRateMngParams->rateMngParams.PerAdd = pInitParams->tRateMngParams.PerAdd; pRateMngParams->rateMngParams.PerAddShift = pInitParams->tRateMngParams.PerAddShift; pRateMngParams->rateMngParams.PerAlphaShift = pInitParams->tRateMngParams.PerAlphaShift; pRateMngParams->rateMngParams.PerBeta1Shift = pInitParams->tRateMngParams.PerBeta1Shift; pRateMngParams->rateMngParams.PerBeta2Shift = pInitParams->tRateMngParams.PerBeta2Shift; pRateMngParams->rateMngParams.PerTh1 = pInitParams->tRateMngParams.PerTh1; pRateMngParams->rateMngParams.PerTh2 = pInitParams->tRateMngParams.PerTh2; pRateMngParams->rateMngParams.RateCheckDown = pInitParams->tRateMngParams.RateCheckDown; pRateMngParams->rateMngParams.RateCheckUp = pInitParams->tRateMngParams.RateCheckUp; pRateMngParams->rateMngParams.RateRetryScore = pInitParams->tRateMngParams.RateRetryScore; pRateMngParams->rateMngParams.TxFailHighTh = pInitParams->tRateMngParams.TxFailHighTh; pRateMngParams->rateMngParams.TxFailLowTh = pInitParams->tRateMngParams.TxFailLowTh; /* RATE_MNG_MAX_RETRY_POLICY_PARAMS_LEN */ for (uIndex = 0; uIndex < 13; uIndex++) { pRateMngParams->rateMngParams.RateRetryPolicy[uIndex] = pInitParams->tRateMngParams.RateRetryPolicy[uIndex]; } /* DCO Itrim params */ pWlanParams->dcoItrimEnabled = pInitParams->tDcoItrimParams.enable; pWlanParams->dcoItrimModerationTimeoutUsec = pInitParams->tDcoItrimParams.moderationTimeoutUsec; return TI_OK; }
/**************************************************************************** * cmdBld_CfgPacketDetectionThreshold **************************************************************************** * DESCRIPTION: Sets Packet Detection Threshold * * INPUTS: None * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgPacketDetectionThreshold (TI_HANDLE hCmdBld, TI_UINT32 threshold, void *fCb, TI_HANDLE hCb) { DB_WLAN(hCmdBld).PacketDetectionThreshold = threshold; return cmdBld_CfgIePacketDetectionThreshold (hCmdBld, threshold, fCb, hCb); }
TI_STATUS cmdBld_CfgRxMsduLifeTime (TI_HANDLE hCmdBld, TI_UINT32 uRxMsduLifeTime, void *fCb, TI_HANDLE hCb) { DB_WLAN(hCmdBld).MaxRxMsduLifetime = uRxMsduLifeTime; return cmdBld_CfgIeRxMsduLifeTime (hCmdBld, uRxMsduLifeTime, fCb, hCb); }
/**************************************************************************** * cmdBld_CfgFragmentThreshold() **************************************************************************** * DESCRIPTION: Sets the tx fragmentation Threshold. * * OUTPUT: None * * RETURNS: TI_OK or TI_NOK ****************************************************************************/ TI_STATUS cmdBld_CfgFragmentThreshold (TI_HANDLE hCmdBld, TI_UINT16 uFragmentThreshold, void *fCb, TI_HANDLE hCb) { DB_WLAN(hCmdBld).FragmentThreshold = uFragmentThreshold; return cmdBld_CfgIeFragmentThreshold (hCmdBld, uFragmentThreshold, fCb, hCb); }