Exemple #1
0
VOID
p2pStateAbort_AP_CHANNEL_DETECT(IN P_ADAPTER_T prAdapter,
				IN P_P2P_FSM_INFO_T prP2pFsmInfo,
				IN P_P2P_SPECIFIC_BSS_INFO_T
				prP2pSpecificBssInfo,
				IN ENUM_P2P_STATE_T eNextState)
{
	P_P2P_CHNL_REQ_INFO_T prChnlReqInfo = (P_P2P_CHNL_REQ_INFO_T) NULL;
	P_P2P_CONNECTION_SETTINGS_T prP2pConnSettings =
	    (P_P2P_CONNECTION_SETTINGS_T) NULL;

	do {
		if (eNextState == P2P_STATE_REQING_CHANNEL) {
			UINT_8 ucPreferedChnl = 0;
			ENUM_BAND_T eBand = BAND_NULL;
			ENUM_CHNL_EXT_T eSco = CHNL_EXT_SCN;

			prChnlReqInfo = &(prP2pFsmInfo->rChnlReqInfo);

/* Determine the channel for AP. */
			if (cnmPreferredChannel(prAdapter,
						&eBand,
						&ucPreferedChnl,
						&eSco) == FALSE) {
				prP2pConnSettings =
				    prAdapter->rWifiVar.prP2PConnSettings;

				if ((ucPreferedChnl =
				     prP2pConnSettings->ucOperatingChnl)
				    == 0) {
					if (scnQuerySparseChannel(prAdapter,
								  &eBand,
								  &ucPreferedChnl)
					    == FALSE) {
/* What to do? */
						ASSERT(FALSE);
/* TODO: Pick up a valid channel from channel list. */
						ucPreferedChnl = 1;
						eBand = BAND_2G4;
					}
				}
			}

			prChnlReqInfo->eChannelReqType =
			    CHANNEL_REQ_TYPE_GO_START_BSS;
			prChnlReqInfo->ucReqChnlNum =
			    prP2pSpecificBssInfo->ucPreferredChannel =
			    ucPreferedChnl;
			prChnlReqInfo->eBand = prP2pSpecificBssInfo->eRfBand =
			    eBand;
			prChnlReqInfo->eChnlSco =
			    prP2pSpecificBssInfo->eRfSco = eSco;
		} else {
			p2pFuncCancelScan(prAdapter,
					  &(prP2pFsmInfo->rScanReqInfo));
		}
	} while (FALSE);

	return;
}				/* p2pStateAbort_AP_CHANNEL_DETECT */
/*----------------------------------------------------------------------------*/
VOID
rlmBssInitForAP(
    P_ADAPTER_T  prAdapter,
    P_BSS_INFO_T prBssInfo
    )
{
    ENUM_BAND_T         eBand;
    UINT_8              ucChannel;
    ENUM_CHNL_EXT_T     eSCO;

    ASSERT(prAdapter);
    ASSERT(prBssInfo);

    if (prBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) {
        return;
    }

    /* Operation band, channel shall be ready before invoking this function.
     * Bandwidth may be ready if other network is connected
     */
    prBssInfo->fg40mBwAllowed = FALSE;
    prBssInfo->fgAssoc40mBwAllowed = FALSE;
    prBssInfo->eBssSCO = CHNL_EXT_SCN;

    if (RLM_AP_IS_BW_40_ALLOWED(prAdapter, prBssInfo)) {
        /* In this case, the first BSS's SCO is 40MHz and known, so AP can
         * apply 40MHz bandwidth, but the first BSS's SCO may be changed
         * later if its Beacon lost timeout occurs
         */
        if (cnmPreferredChannel(prAdapter, &eBand, &ucChannel, &eSCO) &&
            eSCO != CHNL_EXT_SCN && ucChannel == prBssInfo->ucPrimaryChannel &&
            eBand == prBssInfo->eBand) {
            prBssInfo->eBssSCO = eSCO;
        }
        else if (cnmBss40mBwPermitted(prAdapter, prBssInfo->ucNetTypeIndex)) {
            prBssInfo->eBssSCO = rlmDecideScoForAP(prAdapter, prBssInfo);
        }

        if (prBssInfo->eBssSCO != CHNL_EXT_SCN) {
            prBssInfo->fg40mBwAllowed = TRUE;
            prBssInfo->fgAssoc40mBwAllowed = TRUE;

            prBssInfo->ucHtOpInfo1 = (UINT_8)
                (((UINT_32) prBssInfo->eBssSCO) | HT_OP_INFO1_STA_CHNL_WIDTH);

            rlmUpdateBwByChListForAP(prAdapter, prBssInfo);
        }
    }

    DBGLOG(RLM, INFO, ("WLAN AP SCO=%d\n", prBssInfo->eBssSCO));
}
Exemple #3
0
/*----------------------------------------------------------------------------*/
VOID rlmBssInitForAP(P_ADAPTER_T prAdapter, P_BSS_INFO_T prBssInfo)
{
	ENUM_BAND_T eBand;
	UINT_8 ucChannel, i;
	ENUM_CHNL_EXT_T eSCO;

	ASSERT(prAdapter);
	ASSERT(prBssInfo);

	if (prBssInfo->eCurrentOPMode != OP_MODE_ACCESS_POINT) {
		return;
	}

	/* Operation band, channel shall be ready before invoking this function.
	 * Bandwidth may be ready if other network is connected
	 */
	prBssInfo->fg40mBwAllowed = FALSE;
	prBssInfo->fgAssoc40mBwAllowed = FALSE;
	prBssInfo->eBssSCO = CHNL_EXT_SCN;

    /* Check if AP can set its bw to 40MHz
     * But if any of BSS is setup in 40MHz, the second BSS would prefer to use 20MHz
     * in order to remain in SCC case
     */
    if (cnmBss40mBwPermitted(prAdapter, prBssInfo->ucBssIndex)) {
		/* In this case, the first BSS's SCO is 40MHz and known, so AP can
		 * apply 40MHz bandwidth, but the first BSS's SCO may be changed
		 * later if its Beacon lost timeout occurs
		 */
		if (cnmPreferredChannel(prAdapter, &eBand, &ucChannel, &eSCO) &&
		    eSCO != CHNL_EXT_SCN && ucChannel == prBssInfo->ucPrimaryChannel &&
		    eBand == prBssInfo->eBand) {
			prBssInfo->eBssSCO = eSCO;
		} else {
			prBssInfo->eBssSCO = rlmDecideScoForAP(prAdapter, prBssInfo);
		}

		if (prBssInfo->eBssSCO != CHNL_EXT_SCN) {
			prBssInfo->fg40mBwAllowed = TRUE;
			prBssInfo->fgAssoc40mBwAllowed = TRUE;

			prBssInfo->ucHtOpInfo1 = (UINT_8)
			    (((UINT_32) prBssInfo->eBssSCO) | HT_OP_INFO1_STA_CHNL_WIDTH);

			rlmUpdateBwByChListForAP(prAdapter, prBssInfo);
		}
	}

	/* Filled the VHT BW/S1/S2 and MCS rate set */
    if(prBssInfo->ucPhyTypeSet & PHY_TYPE_BIT_VHT) {
    	for(i = 0 ; i < 8 ; i++ ){
            prBssInfo->u2VhtBasicMcsSet |= BITS(2*i,(2*i+1));
    	}
    	prBssInfo->u2VhtBasicMcsSet &= (VHT_CAP_INFO_MCS_MAP_MCS9 << VHT_CAP_INFO_MCS_1SS_OFFSET);
        
        if(cnmGetBssMaxBw(prAdapter, prBssInfo->ucBssIndex) < MAX_BW_80MHZ || prBssInfo->eBand == BAND_2G4) {
            prBssInfo->ucVhtChannelWidth = VHT_OP_CHANNEL_WIDTH_20_40;
            prBssInfo->ucVhtChannelFrequencyS1 = 0;
            prBssInfo->ucVhtChannelFrequencyS2 = 0;
        }
        else if(cnmGetBssMaxBw(prAdapter, prBssInfo->ucBssIndex) == MAX_BW_80MHZ) {        
            prBssInfo->ucVhtChannelWidth = VHT_OP_CHANNEL_WIDTH_80;
            prBssInfo->ucVhtChannelFrequencyS1 = nicGetVhtS1(prBssInfo->ucPrimaryChannel);
            prBssInfo->ucVhtChannelFrequencyS2 = 0;
        }
        else {
            //4 TODO: BW160 / BW80+80 support
        }
    }
    else {
        prBssInfo->ucVhtChannelWidth = VHT_OP_CHANNEL_WIDTH_20_40;
        prBssInfo->ucVhtChannelFrequencyS1 = 0;
        prBssInfo->ucVhtChannelFrequencyS2 = 0;
    }



    DBGLOG(RLM, INFO, ("WLAN AP SCO=%d BW=%d S1=%d S2=%d CH=%d Band=%d\n", 
        prBssInfo->eBssSCO,
        prBssInfo->ucVhtChannelWidth,
        prBssInfo->ucVhtChannelFrequencyS1,
        prBssInfo->ucVhtChannelFrequencyS2,
        prBssInfo->ucVhtChannelWidth,
        prBssInfo->eBand
        ));
    
}