VOID APMakeAllBssBeacon(RTMP_ADAPTER *pAd) { INT i; UCHAR NumOfBcns; /* choose the Beacon number */ NumOfBcns = GetBcnNum(pAd); #if defined(RTMP_MAC) || defined(RLT_MAC) if ((pAd->chipCap.hif_type == HIF_RTMP) || (pAd->chipCap.hif_type == HIF_RLT)) { INT j; /* before MakeBssBeacon, clear all beacon TxD's valid bit Note: can not use MAX_MBSSID_NUM here, or 1. when MBSS_SUPPORT is enabled; 2. MAX_MBSSID_NUM will be 8; 3. if HW_BEACON_OFFSET is 0x0200, we will overwrite other shared memory of chip. use pAd->ApCfg.BssidNum to avoid the case is best */ UINT8 TXWISize = pAd->chipCap.TXWISize; for (i=0; i<HW_BEACON_MAX_COUNT(pAd); i++) { for (j=0; j < TXWISize; j+=4) { RTMP_CHIP_UPDATE_BEACON(pAd, pAd->BeaconOffset[i] + j, 0, 4); } } } #endif /* defined(RTMP_MAC) || defined(RLT_MAC) */ for(i=0; i<pAd->ApCfg.BssidNum; i++) APMakeBssBeacon(pAd, i); AsicSetMbssMode(pAd, NumOfBcns); }
VOID APMakeAllBssBeacon( IN PRTMP_ADAPTER pAd) { INT i, j; UINT32 regValue; UCHAR NumOfMacs; UCHAR NumOfBcns; UINT8 TXWISize = pAd->chipCap.TXWISize; /* before MakeBssBeacon, clear all beacon TxD's valid bit */ /* Note: can not use MAX_MBSSID_NUM here, or 1. when MBSS_SUPPORT is enabled; 2. MAX_MBSSID_NUM will be 8; 3. if HW_BEACON_OFFSET is 0x0200, we will overwrite other shared memory SRAM of chip */ /* use pAd->ApCfg.BssidNum to avoid the case is best */ /* choose the Beacon number */ NumOfBcns = GetBcnNum(pAd); for (i=0; i<HW_BEACON_MAX_COUNT(pAd); i++) { for (j=0; j < TXWISize; j+=4) { RTMP_CHIP_UPDATE_BEACON(pAd, pAd->BeaconOffset[i] + j, 0, 4); } } for(i=0; i<pAd->ApCfg.BssidNum; i++) { APMakeBssBeacon(pAd, i); } RTMP_IO_READ32(pAd, MAC_BSSID_DW1, ®Value); regValue &= 0x0000FFFF; /* Note: 1.The MAC address of Mesh and AP-Client link are different from Main BSSID. 2.If the Mesh link is included, its MAC address shall follow the last MBSSID's MAC by increasing 1. 3.If the AP-Client link is included, its MAC address shall follow the Mesh interface MAC by increasing 1. */ NumOfMacs = pAd->ApCfg.BssidNum + MAX_MESH_NUM + MAX_APCLI_NUM; /* set Multiple BSSID mode */ if (NumOfMacs <= 1) { pAd->ApCfg.MacMask = ~(1-1); /*regValue |= 0x0; */ } else if (NumOfMacs <= 2) { if ((pAd->CurrentAddress[5] % 2 != 0) ) DBGPRINT(RT_DEBUG_ERROR, ("The 2-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 2\n")); regValue |= (1<<16); pAd->ApCfg.MacMask = ~(2-1); } else if (NumOfMacs <= 4) { if (pAd->CurrentAddress[5] % 4 != 0) DBGPRINT(RT_DEBUG_ERROR, ("The 4-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 4\n")); regValue |= (2<<16); pAd->ApCfg.MacMask = ~(4-1); } else if (NumOfMacs <= 8) { if (pAd->CurrentAddress[5] % 8 != 0) DBGPRINT(RT_DEBUG_ERROR, ("The 8-BSSID mode is enabled, the BSSID byte5 MUST be the multiple of 8\n")); regValue |= (3<<16); pAd->ApCfg.MacMask = ~(8-1); } else if (NumOfMacs <= 16) { /* Set MULTI_BSSID_MODE_BIT4 in MAC register 0x1014 */ regValue |= (1<<22); pAd->ApCfg.MacMask = ~(16-1); } /* set Multiple BSSID Beacon number */ if (NumOfBcns > 1) { if (NumOfBcns > 8) regValue |= (((NumOfBcns - 1) >> 3) << 23); regValue |= (((NumOfBcns - 1) & 0x7) << 18); } /* set as 0/1 bit-21 of MAC_BSSID_DW1(offset: 0x1014) to disable/enable the new MAC address assignment. */ if (pAd->chipCap.MBSSIDMode >= MBSSID_MODE1) { regValue |= (1 << 21); #ifdef ENHANCE_NEW_MBSSID_MODE if (pAd->chipCap.MBSSIDMode == MBSSID_MODE2) regValue |= (1 << 24); else if (pAd->chipCap.MBSSIDMode == MBSSID_MODE3) regValue |= (2 << 24); else if (pAd->chipCap.MBSSIDMode == MBSSID_MODE4) regValue |= (3 << 24); else if (pAd->chipCap.MBSSIDMode == MBSSID_MODE5) regValue |= (4 << 24); else if (pAd->chipCap.MBSSIDMode == MBSSID_MODE6) regValue |= (5 << 24); #endif /* ENHANCE_NEW_MBSSID_MODE */ } RTMP_IO_WRITE32(pAd, MAC_BSSID_DW1, regValue); #ifdef HDR_TRANS_SUPPORT /* point WCID MAC table to 0x1800 This is for debug. But HDR_TRANS doesn't work if you remove it. Check after IC formal release. */ regValue |= 0x18000000; RTMP_IO_WRITE32(pAd, HT_MAC_BSSID_DW1, regValue); #endif /* HDR_TRANS_SUPPORT */ }