MAC_TABLE_ENTRY *FindWdsEntry(
    IN PRTMP_ADAPTER	pAd,
    IN UCHAR 			Wcid,
    IN PUCHAR			pAddr,
    IN UINT32			PhyMode)
{
    MAC_TABLE_ENTRY *pEntry;

    // lookup the match wds entry for the incoming packet.
    pEntry = WdsTableLookupByWcid(pAd, Wcid, pAddr, TRUE);
    if (pEntry == NULL)
        pEntry = WdsTableLookup(pAd, pAddr, TRUE);

    // Only Lazy mode will auto learning, match with FrDs=1 and ToDs=1
    if((pEntry == NULL) && (pAd->WdsTab.Mode >= WDS_LAZY_MODE))
    {
        LONG WdsIdx = WdsEntryAlloc(pAd, pAddr);
        if (WdsIdx >= 0)
        {
            // user doesn't specific a phy mode for WDS link.
            if (pAd->WdsTab.WdsEntry[WdsIdx].PhyMode == 0xff)
                pAd->WdsTab.WdsEntry[WdsIdx].PhyMode = PhyMode;
            pEntry = MacTableInsertWDSEntry(pAd, pAddr, (UCHAR)WdsIdx);
        }
        else
            pEntry = NULL;
    }

    return pEntry;
}
Esempio n. 2
0
VOID AsicUpdateWdsRxWCIDTable(
	IN PRTMP_ADAPTER pAd)
{
	UINT index;
	MAC_TABLE_ENTRY *pEntry = NULL;

	for(index = 0; index < MAX_WDS_ENTRY; index++)
	{
		if (pAd->WdsTab.WdsEntry[index].Valid != TRUE)
			continue;

		pEntry = MacTableInsertWDSEntry(pAd, pAd->WdsTab.WdsEntry[index].PeerWdsAddr, index);

		RTMPSetSupportMCS(pAd,
						OPMODE_AP,
						pEntry,
						pAd->CommonCfg.SupRate,
						pAd->CommonCfg.SupRateLen,
						pAd->CommonCfg.ExtRate,
						pAd->CommonCfg.ExtRateLen,
#ifdef DOT11_VHT_AC
						0,
						NULL,
#endif /* DOT11_VHT_AC */
						&pAd->CommonCfg.HtCapability,
						sizeof(pAd->CommonCfg.HtCapability));

		switch (pAd->WdsTab.WdsEntry[index].PhyMode)
		{
			case 0xff: /* user doesn't specific a Mode for WDS link. */
			case MODE_OFDM: /* specific OFDM mode. */
				pEntry->SupportRateMode = SUPPORT_OFDM_MODE;
				break;

			case MODE_CCK:
				pEntry->SupportRateMode = SUPPORT_CCK_MODE;
				break;

#ifdef DOT11_N_SUPPORT
			case MODE_HTMIX:
			case MODE_HTGREENFIELD:
				pEntry->SupportRateMode = (SUPPORT_HT_MODE | SUPPORT_OFDM_MODE | SUPPORT_CCK_MODE);
				break;
#endif /* DOT11_N_SUPPORT */

			default:
				break;
		}
	}

	return;
}
VOID AsicUpdateWdsRxWCIDTable(
    IN PRTMP_ADAPTER pAd)
{
    UINT index;

    for(index = 0; index < MAX_WDS_ENTRY; index++)
    {
        if (pAd->WdsTab.WdsEntry[index].Valid != TRUE)
            continue;

        MacTableInsertWDSEntry(pAd, pAd->WdsTab.WdsEntry[index].PeerWdsAddr, index);
    }

    return;
}
Esempio n. 4
0
MAC_TABLE_ENTRY *FindWdsEntry(
	IN RTMP_ADAPTER *pAd,
	IN UCHAR Wcid,
	IN UCHAR *pAddr,
	IN UINT32 PhyMode)
{
	MAC_TABLE_ENTRY *pEntry;
	RT_802_11_WDS_ENTRY *wds_entry;

	/* lookup the match wds entry for the incoming packet. */
	pEntry = WdsTableLookupByWcid(pAd, Wcid, pAddr, TRUE);
	if (pEntry == NULL)
		pEntry = WdsTableLookup(pAd, pAddr, TRUE);

	/* Only Lazy mode will auto learning, match with FrDs=1 and ToDs=1 */
	if((pEntry == NULL) && (pAd->WdsTab.Mode >= WDS_LAZY_MODE))
	{
		INT WdsIdx = WdsEntryAlloc(pAd, pAddr);
		if (WdsIdx >= 0 && WdsIdx < MAX_WDS_ENTRY)
		{
			wds_entry = &pAd->WdsTab.WdsEntry[WdsIdx];

			/* user doesn't specific a phy mode for WDS link. */
			if (wds_entry->wdev.PhyMode == 0xff)
				wds_entry->wdev.PhyMode = PhyMode;
			pEntry = MacTableInsertWDSEntry(pAd, pAddr, (UCHAR)WdsIdx);

			RTMPSetSupportMCS(pAd,
							OPMODE_AP,
							pEntry,
							pAd->CommonCfg.SupRate,
							pAd->CommonCfg.SupRateLen,
							pAd->CommonCfg.ExtRate,
							pAd->CommonCfg.ExtRateLen,
#ifdef DOT11_VHT_AC
							0,
							NULL,
#endif /* DOT11_VHT_AC */
							&pAd->CommonCfg.HtCapability,
							sizeof(pAd->CommonCfg.HtCapability));
		}
		else 
			pEntry = NULL;
	}

	return pEntry;
}
Esempio n. 5
0
VOID AsicUpdateWdsRxWCIDTable(RTMP_ADAPTER *pAd)
{
	UINT index;
	MAC_TABLE_ENTRY *pEntry = NULL;
	RT_802_11_WDS_ENTRY *wds_entry;
	
	for(index = 0; index < MAX_WDS_ENTRY; index++)
	{
		wds_entry = &pAd->WdsTab.WdsEntry[index];
		if (pAd->WdsTab.Mode >= WDS_LAZY_MODE) {
			wds_entry->wdev.PhyMode = 0xff;
			if (WMODE_CAP_N(pAd->CommonCfg.PhyMode))
				wds_entry->wdev.PhyMode = MODE_HTMIX;
			else {
				if (WMODE_EQUAL(pAd->CommonCfg.PhyMode, WMODE_B))
					wds_entry->wdev.PhyMode = MODE_CCK;
				else
					wds_entry->wdev.PhyMode = MODE_OFDM;
			}
		}

		if (wds_entry->Valid != TRUE)
			continue;

		pEntry = MacTableInsertWDSEntry(pAd, wds_entry->PeerWdsAddr, index);

		RTMPSetSupportMCS(pAd,
						OPMODE_AP,
						pEntry,
						pAd->CommonCfg.SupRate,
						pAd->CommonCfg.SupRateLen,
						pAd->CommonCfg.ExtRate,
						pAd->CommonCfg.ExtRateLen,
#ifdef DOT11_VHT_AC
						0,
						NULL,
#endif /* DOT11_VHT_AC */
						&pAd->CommonCfg.HtCapability,
						sizeof(pAd->CommonCfg.HtCapability));

		switch (wds_entry->wdev.PhyMode)
		{
			case 0xff: /* user doesn't specific a Mode for WDS link. */
			case MODE_OFDM: /* specific OFDM mode. */
				pEntry->SupportRateMode = SUPPORT_OFDM_MODE;
				if (WMODE_CAP_2G(pAd->CommonCfg.PhyMode))
					pEntry->SupportRateMode |= SUPPORT_CCK_MODE;
				break;

			case MODE_CCK:
				pEntry->SupportRateMode = SUPPORT_CCK_MODE;
				break;

#ifdef DOT11_N_SUPPORT
			case MODE_HTMIX:
			case MODE_HTGREENFIELD:
				pEntry->SupportRateMode = (SUPPORT_HT_MODE | SUPPORT_OFDM_MODE);
				if (WMODE_CAP_2G(pAd->CommonCfg.PhyMode))
					pEntry->SupportRateMode |= SUPPORT_CCK_MODE;
				break;
#endif /* DOT11_N_SUPPORT */
			default:
				break;
		}
	}

	return;
}