Пример #1
0
static void switchChannel_recvCmd4Debug(TI_HANDLE hSwitchChannel, dot11_CHANNEL_SWITCH_t *channelSwitch, TI_BOOL BeaconPacket, TI_UINT8 channel)
{

	switchChannel_t             *pSwitchChannel = (switchChannel_t *)hSwitchChannel;
	paramInfo_t                 param;

	if (pSwitchChannel==NULL) {
		return;
	}


	/* The following is for debug purposes only
	    It will be operated when the Switch Channel cmd is opertated from debug CLI */
	if (pSwitchChannel->ignoreCancelSwitchChannelCmd != 0) {
		if (pSwitchChannel->ignoreCancelSwitchChannelCmd == 1) {
			/* update the new SCC params */
			pSwitchChannel->curChannelSwitchCmdParams.channelNumber = channelSwitch->channelNumber;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchCount = channelSwitch->channelSwitchCount;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchMode = channelSwitch->channelSwitchMode;

			pSwitchChannel->ignoreCancelSwitchChannelCmd = 2;
		} else if (channelSwitch->channelSwitchCount>0) {
			channelSwitch->channelSwitchCount --;
		} else {
			pSwitchChannel->ignoreCancelSwitchChannelCmd = 0;
		}


		/* search in the buffer pointer to the beginning of the
		    Switch Cahnnel Announcement IE according to the IE ID */

		/* Checking channel number validity */
		param.content.channel = channelSwitch->channelNumber;
		param.paramType = REGULATORY_DOMAIN_IS_CHANNEL_SUPPORTED;
		regulatoryDomain_getParam(pSwitchChannel->hRegulatoryDomain,&param);
		if (( !param.content.bIsChannelSupprted ) ||
		        (channelSwitch->channelSwitchCount == 0) ||
		        (channelSwitch->channelSwitchMode == SC_SWITCH_CHANNEL_MODE_TX_SUS)) {   /* Trigger Roaming, if TX mode is disabled, the new channel number is invalid,
                or the TBTT count is 0 */
			apConn_reportRoamingEvent(pSwitchChannel->hApConn, ROAMING_TRIGGER_SWITCH_CHANNEL, NULL);
		} else {  /* Invoke Switch Channel command */
			/* update the new SCC params */
			pSwitchChannel->curChannelSwitchCmdParams.channelNumber = channelSwitch->channelNumber;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchCount = channelSwitch->channelSwitchCount;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchMode = channelSwitch->channelSwitchMode;
			switchChannel_smEvent((TI_UINT8*)&pSwitchChannel->currentState, SC_EVENT_SC_CMD, pSwitchChannel);
		}
	}

}
TI_STATUS roamingMngr_setParam(TI_HANDLE hRoamingMngr, paramInfo_t *pParam)
{
	roamingMngr_t *pRoamingMngr = (roamingMngr_t*)hRoamingMngr;
	TI_STATUS      status       = TI_OK;

	if (pParam == NULL) {
		TRACE0(pRoamingMngr->hReport, REPORT_SEVERITY_ERROR , "roamingMngr_setParam(): pParam is NULL!\n");
		return TI_NOK;
	}

	TRACE1(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION , "roamingMngr_setParam   %X \n", pParam->paramType);

	switch (pParam->paramType) {

	case ROAMING_MNGR_APPLICATION_CONFIGURATION: {
		roamingMngrConfigParams_t   *pRoamingMngrConfigParams;

		pRoamingMngrConfigParams = &pParam->content.roamingConfigBuffer;

		/* Configure the Roaming Parmeters */
		TRACE3(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_setParam Configuration: \n                                  enableDisable= %d,\n  lowPassFilterRoamingAttempt=%d,\n                                  apQualityThreshold=%d\n", pRoamingMngrConfigParams->roamingMngrConfig.enableDisable, pRoamingMngrConfigParams->roamingMngrConfig.lowPassFilterRoamingAttempt, pRoamingMngrConfigParams->roamingMngrConfig.apQualityThreshold);

		pRoamingMngr->roamingMngrConfig.apQualityThreshold = pRoamingMngrConfigParams->roamingMngrConfig.apQualityThreshold;
		pRoamingMngr->roamingMngrConfig.lowPassFilterRoamingAttempt = pRoamingMngrConfigParams->roamingMngrConfig.lowPassFilterRoamingAttempt;
		pRoamingMngr->lowPassFilterRoamingAttemptInMsec = pRoamingMngrConfigParams->roamingMngrConfig.lowPassFilterRoamingAttempt * 1000;

		/* Configure the Roaming Trigger thresholds */
		TRACE7(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_setParam Thresholds: \n                                  dataRetryThreshold= %d,\n  lowQualityForBackgroungScanCondition=%d,\n                                  lowRssiThreshold=%d,\n lowSNRThreshold=%d,\n                                  normalQualityForBackgroungScanCondition=%d,\n                                  numExpectedTbttForBSSLoss=%d,\n txRateThreshold=%d \n \n", pRoamingMngrConfigParams->roamingMngrThresholdsConfig.dataRetryThreshold, pRoamingMngrConfigParams->roamingMngrThresholdsConfig.lowQualityForBackgroungScanCondition, pRoamingMngrConfigParams->roamingMngrThresholdsConfig.lowRssiThreshold, pRoamingMngrConfigParams->roamingMngrThresholdsConfig.lowSnrThreshold, pRoamingMngrConfigParams->roamingMngrThresholdsConfig.normalQualityForBackgroungScanCondition, pRoamingMngrConfigParams->roamingMngrThresholdsConfig.numExpectedTbttForBSSLoss, pRoamingMngrConfigParams->roamingMngrThresholdsConfig.txRateThreshold);

		os_memoryCopy(pRoamingMngr->hOs, &pRoamingMngr->roamingMngrThresholdsConfig, &pRoamingMngrConfigParams->roamingMngrThresholdsConfig, sizeof(roamingMngrThresholdsConfig_t));

		status = apConn_setRoamThresholds(pRoamingMngr->hAPConnection, &pRoamingMngrConfigParams->roamingMngrThresholdsConfig);

		if (pRoamingMngr->roamingMngrConfig.enableDisable &&
		        !pRoamingMngrConfigParams->roamingMngrConfig.enableDisable) {  /* disable Roaming Manager */
			apConn_unregisterRoamMngrCallb(pRoamingMngr->hAPConnection);
			pRoamingMngr->roamingMngrConfig.enableDisable = ROAMING_DISABLED;
			return (roamingMngr_smEvent(ROAMING_EVENT_STOP, pRoamingMngr));
		} else if (!pRoamingMngr->roamingMngrConfig.enableDisable &&
		           pRoamingMngrConfigParams->roamingMngrConfig.enableDisable) {  /* enable Roaming Manager */
			/* Save the Roaming Configuration parameters */
			pRoamingMngr->roamingMngrConfig.enableDisable = pRoamingMngrConfigParams->roamingMngrConfig.enableDisable;
			/* register Roaming callback */
			apConn_registerRoamMngrCallb(pRoamingMngr->hAPConnection,
			                             roamingMngr_triggerRoamingCb,
			                             roamingMngr_connStatusCb,
			                             roamingMngr_updateNeighborApListCb);
		}
	}
	break;


	/*********** For Debug Purposes ***********/

	case ROAMING_MNGR_TRIGGER_EVENT:
		/* Enable/disable Internal Roaming */
		TRACE1(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_setParam TRIGGER_EVENT=  %d \n", pParam->content.roamingTriggerType);
		apConn_reportRoamingEvent(pRoamingMngr->hAPConnection, (apConn_roamingTrigger_e)pParam->content.roamingTriggerType, NULL);
		break;

	case ROAMING_MNGR_CONN_STATUS:
		/* External request to connect to BBSID */
		TRACE1(pRoamingMngr->hReport, REPORT_SEVERITY_INFORMATION, "roamingMngr_setParam CONN_STATUS=  %d \n", pParam->content.roamingConnStatus);
		roamingMngr_connStatusCb(pRoamingMngr, &pParam->content.roamingConnStatus);
		break;

	default:
		TRACE1(pRoamingMngr->hReport, REPORT_SEVERITY_ERROR, "roamingMngr_setParam bad param=  %X\n", pParam->paramType);

		break;
	}


	return status;
}
Пример #3
0
void switchChannel_recvCmd(TI_HANDLE hSwitchChannel, dot11_CHANNEL_SWITCH_t *channelSwitch, TI_UINT8 channel)
{

	switchChannel_t             *pSwitchChannel = (switchChannel_t *)hSwitchChannel;
	paramInfo_t                 param;


	if (pSwitchChannel==NULL) {
		return;
	}

	param.paramType = REGULATORY_DOMAIN_DFS_CHANNELS_RANGE;
	regulatoryDomain_getParam(pSwitchChannel->hRegulatoryDomain, &param);

	if (!pSwitchChannel->dot11SpectrumManagementRequired ||
	        (channel < param.content.DFS_ChannelRange.minDFS_channelNum) ||
	        (channel > param.content.DFS_ChannelRange.maxDFS_channelNum)) {   /* Do not parse Switch Channel IE, when SpectrumManagement is disabled,
            or the channel is non-DFS channel */
		return;
	}
#ifdef TI_DBG
	/* for debug purposes only */
	if (pSwitchChannel->ignoreCancelSwitchChannelCmd != 0) {
		return;
	}
#endif

	if (channelSwitch == NULL) {  /* No SC IE, update regDomain */
		param.paramType = REGULATORY_DOMAIN_UPDATE_CHANNEL_VALIDITY;
		param.content.channel = channel;
		regulatoryDomain_setParam(pSwitchChannel->hRegulatoryDomain, &param);
	} else {  /* SC IE exists */

		/* Checking channel number validity */
		param.content.channel = channelSwitch->channelNumber;
		param.paramType = REGULATORY_DOMAIN_IS_CHANNEL_SUPPORTED;
		regulatoryDomain_getParam(pSwitchChannel->hRegulatoryDomain,&param);
		if ( ( !param.content.bIsChannelSupprted )   ||
		        (channelSwitch->channelSwitchCount == 0) ||
		        (channelSwitch->channelSwitchMode == SC_SWITCH_CHANNEL_MODE_TX_SUS)) {   /* Trigger Roaming, if TX mode is disabled, the new channel number is invalid,
                or the TBTT count is 0 */

			if (channelSwitch->channelSwitchMode == SC_SWITCH_CHANNEL_MODE_TX_SUS) {
				param.paramType = REGULATORY_DOMAIN_SET_CHANNEL_VALIDITY;
				param.content.channelValidity.channelNum = channel;
				param.content.channelValidity.channelValidity = TI_FALSE;
				regulatoryDomain_setParam(pSwitchChannel->hRegulatoryDomain, &param);
			}

			if (TI_TRUE == pSwitchChannel->switchChannelStarted) {
				apConn_reportRoamingEvent(pSwitchChannel->hApConn, ROAMING_TRIGGER_SWITCH_CHANNEL, NULL);
			}

		} else {  /* Invoke Switch Channel command */
			/* update the new SCC params */
			pSwitchChannel->curChannelSwitchCmdParams.channelNumber = channelSwitch->channelNumber;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchCount = channelSwitch->channelSwitchCount;
			pSwitchChannel->curChannelSwitchCmdParams.channelSwitchMode = channelSwitch->channelSwitchMode;
			switchChannel_smEvent((TI_UINT8*)&pSwitchChannel->currentState, SC_EVENT_SC_CMD, pSwitchChannel);
		}

	}

}