本文整理汇总了C++中RTMP_IO_WRITE32函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMP_IO_WRITE32函数的具体用法?C++ RTMP_IO_WRITE32怎么用?C++ RTMP_IO_WRITE32使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMP_IO_WRITE32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendPSMPAction
/*
Description : Send PSMP Action frame If PSMP mode switches.
*/
VOID SendPSMPAction(
IN PRTMP_ADAPTER pAd,
IN UCHAR Wcid,
IN UCHAR Psmp)
{
PUCHAR pOutBuffer = NULL;
NDIS_STATUS NStatus;
//ULONG Idx;
FRAME_PSMP_ACTION Frame;
ULONG FrameLen;
#ifdef RT30xx
UCHAR bbpdata=0;
UINT32 macdata;
#endif // RT30xx //
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
if (NStatus != NDIS_STATUS_SUCCESS)
{
DBGPRINT(RT_DEBUG_ERROR,("BA - MlmeADDBAAction() allocate memory failed \n"));
return;
}
#ifdef CONFIG_STA_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->MacTab.Content[Wcid].Addr);
#endif // CONFIG_STA_SUPPORT //
Frame.Category = CATEGORY_HT;
Frame.Action = SMPS_ACTION;
switch (Psmp)
{
case MMPS_ENABLE:
#ifdef RT30xx
if (IS_RT3090(pAd))
{
// disable MMPS BBP control register
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
bbpdata &= ~(0x04); //bit 2
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
// disable MMPS MAC control register
RTMP_IO_READ32(pAd, 0x1210, &macdata);
macdata &= ~(0x09); //bit 0, 3
RTMP_IO_WRITE32(pAd, 0x1210, macdata);
}
#endif // RT30xx //
Frame.Psmp = 0;
break;
case MMPS_DYNAMIC:
#ifdef RT30xx
if (IS_RT3090(pAd))
{
// enable MMPS BBP control register
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
bbpdata |= 0x04; //bit 2
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
// enable MMPS MAC control register
RTMP_IO_READ32(pAd, 0x1210, &macdata);
macdata |= 0x09; //bit 0, 3
RTMP_IO_WRITE32(pAd, 0x1210, macdata);
}
#endif // RT30xx //
Frame.Psmp = 3;
break;
case MMPS_STATIC:
#ifdef RT30xx
if (IS_RT3090(pAd))
{
// enable MMPS BBP control register
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
bbpdata |= 0x04; //bit 2
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
// enable MMPS MAC control register
RTMP_IO_READ32(pAd, 0x1210, &macdata);
macdata |= 0x09; //bit 0, 3
RTMP_IO_WRITE32(pAd, 0x1210, macdata);
}
#endif // RT30xx //
Frame.Psmp = 1;
break;
}
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(FRAME_PSMP_ACTION), &Frame,
END_OF_ARGS);
MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
MlmeFreeMemory(pAd, pOutBuffer);
DBGPRINT(RT_DEBUG_ERROR,("HT - SendPSMPAction( %d ) \n", Frame.Psmp));
}
示例2: ChgSignalStrengthLed
static void ChgSignalStrengthLed(
IN PRTMP_ADAPTER pAd)
{
RTMP_IO_WRITE32(pAd, GPIO_DIR, 0x00); /* set GPIO to output. */
RTMP_IO_WRITE32(pAd, GPIO_DAT, (pAd->LedCntl.SWMCULedCntl.GPIOPolarity ? pAd->LedCntl.SWMCULedCntl.SignalStrength : ~pAd->LedCntl.SWMCULedCntl.SignalStrength));
}
示例3: NICInitRT3370RFRegisters
VOID NICInitRT3370RFRegisters(IN PRTMP_ADAPTER pAd)
{
INT i;
UINT8 RfReg = 0;
UINT32 data;
CHAR bbpreg;
/* Driver must read EEPROM to get RfIcType before initial RF registers*/
/* Initialize RF register to default value*/
/* Init RF calibration*/
/* Driver should toggle RF R30 bit7 before init RF registers*/
RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg);
RfReg |= 0x80;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
RTMPusecDelay(1000);
RfReg &= 0x7F;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
for (i = 0; i < RT3370_NUM_RF_REG_PARMS; i++)
{
RT30xxWriteRFRegister(pAd, RT3370_RFRegTable[i].Register, RT3370_RFRegTable[i].Value);
}
/* Driver should set RF R6 bit6 on before init RF registers */
RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR)&RfReg);
RfReg |= 0x40;
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR)RfReg);
/* RT3071 version E has fixed this issue*/
if ((pAd->NicConfig2.field.DACTestBit == 1) && ((pAd->MACVersion & 0xffff) < 0x0211))
{
/* patch tx EVM issue temporarily*/
RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
data = ((data & 0xE0FFFFFF) | 0x0D000000);
RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
}
else
{
/* patch CCK ok, OFDM failed issue, just toggle and restore LDO_CFG0.*/
RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
data = ((data & 0xE0FFFFFF) | 0x0D000000);
RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
RTMPusecDelay(1000);
data = ((data & 0xE0FFFFFF) | 0x01000000);
RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
}
/* patch LNA_PE_G1 failed issue*/
RTMP_IO_READ32(pAd, GPIO_SWITCH, &data);
data &= ~(0x20);
RTMP_IO_WRITE32(pAd, GPIO_SWITCH, data);
if (IS_RT3390(pAd)) /* Disable RF filter calibration*/
{
pAd->Mlme.CaliBW20RfR24 = BW20RFR24;
pAd->Mlme.CaliBW40RfR24 = BW40RFR24;
pAd->Mlme.CaliBW20RfR31 = BW20RFR31;
pAd->Mlme.CaliBW40RfR31 = BW40RFR31;
}
else
{
/*For RF filter Calibration*/
/*RTMPFilterCalibration(pAd);*/
}
/* set led open drain enable*/
RTMP_IO_READ32(pAd, OPT_14, &data);
data |= 0x01;
RTMP_IO_WRITE32(pAd, OPT_14, data);
/* set default antenna as main*/
if (pAd->RfIcType == RFIC_3320)
AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
/*
From RT3071 Power Sequence v1.1 document, the Normal Operation Setting Registers as follow :
BBP_R138 / RF_R1 / RF_R15 / RF_R17 / RF_R20 / RF_R21.
*/
/* add by johnli, RF power sequence setup, load RF normal operation-mode setup*/
RT33xxLoadRFNormalModeSetup(pAd);
}
示例4: RT30xxReverseRFSleepModeSetup
//.........这里部分代码省略.........
}
RT30xxWriteRFRegister(pAd, RF_R01, rfreg);
RT30xxReadRFRegister(pAd, RF_R06, &rfreg);
if (IS_RT5390F(pAd) || IS_RT5392C(pAd))
{
rfreg = ((rfreg & ~0xC0) | 0xC0); // vco_ic (VCO bias current control, 11: high)
}
else
{
rfreg = ((rfreg & ~0xC0) | 0x80); // vco_ic (VCO bias current control, 10: mid.)
}
RT30xxWriteRFRegister(pAd, RF_R06, rfreg);
if (!IS_RT5392(pAd))
{
RT30xxReadRFRegister(pAd, RF_R02, &rfreg);
rfreg = ((rfreg & ~0x80) | 0x80); // rescal_en (initiate calibration)
RT30xxWriteRFRegister(pAd, RF_R02, rfreg);
}
RT30xxReadRFRegister(pAd, RF_R22, &rfreg);
rfreg = ((rfreg & ~0xE0) | 0x20); // cp_ic (reference current control, 001: 0.33 mA)
RT30xxWriteRFRegister(pAd, RF_R22, rfreg);
RT30xxReadRFRegister(pAd, RF_R42, &rfreg);
rfreg = ((rfreg & ~0x40) | 0x40); // rx_ctb_en
RT30xxWriteRFRegister(pAd, RF_R42, rfreg);
RT30xxReadRFRegister(pAd, RF_R20, &rfreg);
rfreg = ((rfreg & ~0x77) | 0x00); // ldo_rf_vc and ldo_pll_vc ( 111: +0.15)
RT30xxWriteRFRegister(pAd, RF_R20, rfreg);
RT30xxReadRFRegister(pAd, RF_R03, &rfreg);
rfreg = ((rfreg & ~0x80) | 0x80); // vcocal_en (initiate VCO calibration (reset after completion))
RT30xxWriteRFRegister(pAd, RF_R03, rfreg);
}
else
#endif // RT53xx //
{
// RF_BLOCK_en, RF R1 register Bit 0 to 1
RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
RFValue |= 0x01;
RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
// VCO_IC, RF R7 register Bit 5 to 1 (VCO bias current control, 11: high)
RT30xxReadRFRegister(pAd, RF_R07, &RFValue);
RFValue |= 0x30;
RT30xxWriteRFRegister(pAd, RF_R07, RFValue);
// Idoh, RF R9 register Bit 1, Bit 2 & Bit 3 to 1
RT30xxReadRFRegister(pAd, RF_R09, &RFValue);
RFValue |= 0x0E;
RT30xxWriteRFRegister(pAd, RF_R09, RFValue);
// RX_CTB_en, RF R21 register Bit 7 to 1
RT30xxReadRFRegister(pAd, RF_R21, &RFValue);
RFValue |= 0x80;
RT30xxWriteRFRegister(pAd, RF_R21, RFValue);
}
}
if (IS_RT3090(pAd) || // IS_RT3090 including RT309x and RT3071/72
IS_RT3572(pAd) ||
IS_RT3390(pAd) ||
IS_RT3593(pAd) ||
IS_RT5390(pAd) ||
(IS_RT3070(pAd) && ((pAd->MACVersion & 0xffff) < 0x0201)))
{
if ((!IS_RT3572(pAd)) && (!IS_RT3593(pAd)) && (!IS_RT5390(pAd)) && (!IS_RT3390(pAd)) && (!IS_RT3090(pAd)))
{
RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
if ((pAd->MACVersion & 0xffff) < 0x0211)
RFValue = (RFValue & (~0x77)) | 0x3;
else
RFValue = (RFValue & (~0x77));
RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
}
// RT3071 version E has fixed this issue
if ((pAd->NicConfig2.field.DACTestBit == 1) && ((pAd->MACVersion & 0xffff) < 0x0211))
{
// patch tx EVM issue temporarily
RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
MACValue = ((MACValue & 0xE0FFFFFF) | 0x0D000000);
RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
}
// else if ((!IS_RT3090(pAd) && !IS_RT3593(pAd)) || (pAd->CommonCfg.PatchHWControl.field.LDOCfg == 1))
else if ((!IS_RT3090(pAd) && !IS_RT3593(pAd) && !IS_RT5390(pAd)))
{
RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
MACValue = ((MACValue & 0xE0FFFFFF) | 0x01000000);
RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
}
}
if(IS_RT3572(pAd))
RT30xxWriteRFRegister(pAd, RF_R08, 0x80);
}
示例5: AsicSwitchChannel
//.........这里部分代码省略.........
}
else
{
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0x84);
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R75, 0x50);
}
/* 2.4 G band selection PIN */
rtmp_mac_set_band(pAd, BAND_24G);
/* Turn off unused PA or LNA when only 1T or 1R. */
if (pAd->Antenna.field.TxPath == 1)
{
TxPinCfg &= 0xFFFFFFF3;
}
if (pAd->Antenna.field.RxPath == 1)
{
TxPinCfg &= 0xFFFFF3FF;
}
/* calibration power unbalance issues */
if (pAd->Antenna.field.TxPath == 2)
{
if (pATEInfo->TxAntennaSel == 1)
{
TxPinCfg &= 0xFFFFFFF7;
}
else if (pATEInfo->TxAntennaSel == 2)
{
TxPinCfg &= 0xFFFFFFFD;
}
}
RTMP_IO_WRITE32(pAd, TX_PIN_CFG, TxPinCfg);
}
/* channel > 14 */
else
{
UINT32 TxPinCfg = 0x00050F05;/* 2007.10.09 by Brian : 0x00050505 ==> 0x00050F05 */
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62, (0x37 - pAd->hw_cfg.lan_gain));
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R63, (0x37 - pAd->hw_cfg.lan_gain));
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R64, (0x37 - pAd->hw_cfg.lan_gain));
/* According the Rory's suggestion to solve the middle range issue. */
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R86, 0);
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0xF2);
/* Rx High power VGA offset for LNA select */
if (pAd->NicConfig2.field.ExternalLNAForA)
{
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R75, 0x46);
}
else
{
ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R75, 0x50);
}
ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R91, &BbpValue);
ASSERT((BbpValue == 0x04));
/* 5 G band selection PIN, bit1 and bit2 are complement */
rtmp_mac_set_band(pAd, BAND_5G);
/* Turn off unused PA or LNA when only 1T or 1R. */
示例6: RadarDetectPeriodic
/* Before switch channel, driver needs doing channel switch announcement.*/
VOID RadarDetectPeriodic(
IN PRTMP_ADAPTER pAd)
{
#ifdef RT2880
ULONG Value;
/* Roger add to fix false detection(long pulse only) in the first 60 seconds */
if (pAd->CommonCfg.W56_debug)
{
if (pAd->CommonCfg.W56_idx < 300)
{
pAd->CommonCfg.RadarElectNum = 5;
}
else if (pAd->CommonCfg.W56_total <= 5000)
{
if (pAd->CommonCfg.RadarElectNum > 4)
pAd->CommonCfg.RadarElectNum--;
else
pAd->CommonCfg.RadarElectNum = 3;
}
else if (pAd->CommonCfg.W56_total <= 10000)
{
if (pAd->CommonCfg.RadarElectNum > 5)
pAd->CommonCfg.RadarElectNum--;
else
pAd->CommonCfg.RadarElectNum = 4;
}
else if (pAd->CommonCfg.W56_total <= 20000)
{
if (pAd->CommonCfg.RadarElectNum > 7)
pAd->CommonCfg.RadarElectNum--;
else if (pAd->CommonCfg.RadarElectNum < 5)
pAd->CommonCfg.RadarElectNum++;
else
pAd->CommonCfg.RadarElectNum = 6;
}
else if (pAd->CommonCfg.W56_total <= 30000)
{
if (pAd->CommonCfg.RadarElectNum > 8)
pAd->CommonCfg.RadarElectNum--;
else if (pAd->CommonCfg.RadarElectNum < 6)
pAd->CommonCfg.RadarElectNum++;
else
pAd->CommonCfg.RadarElectNum = 7;
}
else if (pAd->CommonCfg.W56_total <= 50000)
{
if (pAd->CommonCfg.RadarElectNum > 9)
pAd->CommonCfg.RadarElectNum--;
else if (pAd->CommonCfg.RadarElectNum < 6)
pAd->CommonCfg.RadarElectNum++;
else
pAd->CommonCfg.RadarElectNum = 8;
}
else if (pAd->CommonCfg.W56_total <= 70000)
{
if (pAd->CommonCfg.RadarElectNum > 7)
pAd->CommonCfg.RadarElectNum--;
else if (pAd->CommonCfg.RadarElectNum < 8)
pAd->CommonCfg.RadarElectNum++;
else
pAd->CommonCfg.RadarElectNum = 9;
}
else
{
if (pAd->CommonCfg.RadarElectNum < 9)
pAd->CommonCfg.RadarElectNum++;
else
pAd->CommonCfg.RadarElectNum = 10;
}
}
#endif /* RT2880 */
/* need to check channel availability, after switch channel*/
if (pAd->CommonCfg.RadarDetect.RDMode != RD_SILENCE_MODE)
return;
#ifdef RT2880
#ifdef DFS_SOFTWARE_SUPPORT
if (pAd->CommonCfg.dfs_func < HARDWARE_DFS_V1)
{
/* Roger add to fix false detection(long pulse only) in the first 60 seconds */
if ((pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56) || (pAd->CommonCfg.RadarDetect.RDDurRegion == FCC))
{
if (pAd->CommonCfg.W56_debug == 0)
{
RTMP_IO_READ32(pAd, PBF_LIFE_TIMER, &pAd->CommonCfg.W56_hw_1);
RTMP_IO_READ32(pAd, CH_TIME_CFG, &Value);
RTMP_IO_WRITE32(pAd, CH_TIME_CFG, Value | 1);
pAd->CommonCfg.W56_hw_sum = 0;
pAd->CommonCfg.W56_idx = 0;
pAd->CommonCfg.W56_debug = 1;
}
}
}
#endif /* DFS_SOFTWARE_SUPPORT */
#endif /* RT2880 */
//.........这里部分代码省略.........
示例7: RT30xxWriteRFRegister
/*
========================================================================
Routine Description: Write RT30xx RF register through MAC
Arguments:
Return Value:
IRQL =
Note:
========================================================================
*/
NDIS_STATUS RT30xxWriteRFRegister(
IN PRTMP_ADAPTER pAd,
IN UCHAR regID,
IN UCHAR value)
{
RF_CSR_CFG_STRUC rfcsr = { { 0 } };
UINT i = 0;
#ifdef RTMP_MAC_PCI
if ((pAd->bPCIclkOff == TRUE) || (pAd->LastMCUCmd == SLEEP_MCU_CMD))
{
DBGPRINT_ERR(("RT30xxWriteRFRegister. Not allow to write RF 0x%x : fail\n", regID));
return STATUS_UNSUCCESSFUL;
}
#endif /* RTMP_MAC_PCI */
ASSERT((regID <= pAd->chipCap.MaxNumOfRfId));
do
{
RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
if (!rfcsr.field.RF_CSR_KICK)
break;
i++;
}
while ((i < MAX_BUSY_COUNT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
if ((i == MAX_BUSY_COUNT) || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
{
DBGPRINT_RAW(RT_DEBUG_ERROR, ("Retry count exhausted or device removed!!!\n"));
return STATUS_UNSUCCESSFUL;
}
rfcsr.field.RF_CSR_WR = 1;
rfcsr.field.RF_CSR_KICK = 1;
rfcsr.field.TESTCSR_RFACC_REGNUM = regID;
if ((pAd->chipCap.RfReg17WtMethod == RF_REG_WT_METHOD_STEP_ON) && (regID == RF_R17))
{
UCHAR IdRf;
UCHAR RfValue;
BOOLEAN beAdd;
RT30xxReadRFRegister(pAd, RF_R17, &RfValue);
beAdd = (RfValue < value) ? TRUE : FALSE;
IdRf = RfValue;
while(IdRf != value)
{
if (beAdd)
IdRf++;
else
IdRf--;
rfcsr.field.RF_CSR_DATA = IdRf;
RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word);
RtmpOsMsDelay(1);
}
}
rfcsr.field.RF_CSR_DATA = value;
RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word);
return NDIS_STATUS_SUCCESS;
}
示例8: MlmeHardTransmitTxRing
//.........这里部分代码省略.........
bAckRequired = FALSE;
}
else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame)
{
if (pHeader_802_11->Addr1[0] & 0x01) // MULTICAST, BROADCAST
{
bAckRequired = FALSE;
pHeader_802_11->Duration = 0;
}
else
{
bAckRequired = TRUE;
pHeader_802_11->Duration = RTMPCalcDuration(pAd, MlmeRate, 14);
if (pHeader_802_11->FC.SubType == SUBTYPE_PROBE_RSP)
{
bInsertTimestamp = TRUE;
}
}
}
pHeader_802_11->Sequence = pAd->Sequence++;
if (pAd->Sequence > 0xfff)
pAd->Sequence = 0;
// Before radar detection done, mgmt frame can not be sent but probe req
// Because we need to use probe req to trigger driver to send probe req in passive scan
if ((pHeader_802_11->FC.SubType != SUBTYPE_PROBE_REQ)
&& (pAd->CommonCfg.bIEEE80211H == 1)
&& (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE))
{
DBGPRINT(RT_DEBUG_ERROR,("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
//NdisReleaseSpinLock(&pAd->TxRingLock);
return (NDIS_STATUS_FAILURE);
}
#ifdef RT_BIG_ENDIAN
RTMPFrameEndianChange(pAd, (PUCHAR)pHeader_802_11, DIR_WRITE, FALSE);
#endif
//
// fill scatter-and-gather buffer list into TXD. Internally created NDIS PACKET
// should always has only one ohysical buffer, and the whole frame size equals
// to the first scatter buffer size
//
// Initialize TX Descriptor
// For inter-frame gap, the number is for this frame and next frame
// For MLME rate, we will fix as 2Mb to match other vendor's implement
// pAd->CommonCfg.MlmeTransmit.field.MODE = 1;
// management frame doesn't need encryption. so use RESERVED_WCID no matter u are sending to specific wcid or not.
// Only beacon use Nseq=TRUE. So here we use Nseq=FALSE.
if (pMacEntry == NULL)
{
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp, FALSE, bAckRequired, FALSE,
0, RESERVED_WCID, (SrcBufLen - TXWI_SIZE), PID_MGMT, 0, (UCHAR)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
}
else
{
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE,
bInsertTimestamp, FALSE, bAckRequired, FALSE,
0, pMacEntry->Aid, (SrcBufLen - TXWI_SIZE),
pMacEntry->MaxHTPhyMode.field.MCS, 0,
(UCHAR)pMacEntry->MaxHTPhyMode.field.MCS,
IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
}
pAd->TxRing[QueIdx].Cell[SwIdx].pNdisPacket = pPacket;
pAd->TxRing[QueIdx].Cell[SwIdx].pNextNdisPacket = NULL;
// pFirstTxWI->MPDUtotalByteCount = SrcBufLen - TXWI_SIZE;
#ifdef RT_BIG_ENDIAN
RTMPWIEndianChange((PUCHAR)pFirstTxWI, TYPE_TXWI);
#endif
SrcBufPA = PCI_MAP_SINGLE(pAd, pSrcBufVA, SrcBufLen, 0, PCI_DMA_TODEVICE);
RTMPWriteTxDescriptor(pAd, pTxD, TRUE, FIFO_EDCA);
pTxD->LastSec0 = 1;
pTxD->LastSec1 = 1;
pTxD->SDLen0 = SrcBufLen;
pTxD->SDLen1 = 0;
pTxD->SDPtr0 = SrcBufPA;
pTxD->DMADONE = 0;
#ifdef RT_BIG_ENDIAN
RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
#endif
pAd->RalinkCounters.KickTxCount++;
pAd->RalinkCounters.OneSecTxDoneCount++;
// Increase TX_CTX_IDX, but write to register later.
INC_RING_INDEX(pAd->TxRing[QueIdx].TxCpuIdx, TX_RING_SIZE);
RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QueIdx*0x10, pAd->TxRing[QueIdx].TxCpuIdx);
// Make sure to release MGMT ring resource
// NdisReleaseSpinLock(&pAd->TxRingLock);
return NDIS_STATUS_SUCCESS;
}
示例9: RtmpPCIMgmtKickOut
/*
Must be run in Interrupt context
This function handle PCI specific TxDesc and cpu index update and kick the packet out.
*/
int RtmpPCIMgmtKickOut(
IN RTMP_ADAPTER *pAd,
IN UCHAR QueIdx,
IN PNDIS_PACKET pPacket,
IN PUCHAR pSrcBufVA,
IN UINT SrcBufLen)
{
PTXD_STRUC pTxD;
#ifdef RT_BIG_ENDIAN
PTXD_STRUC pDestTxD;
TXD_STRUC TxD;
#endif
ULONG SwIdx = pAd->MgmtRing.TxCpuIdx;
#ifdef RT_BIG_ENDIAN
pDestTxD = (PTXD_STRUC)pAd->MgmtRing.Cell[SwIdx].AllocVa;
TxD = *pDestTxD;
pTxD = &TxD;
RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
#else
pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[SwIdx].AllocVa;
#endif
pAd->MgmtRing.Cell[SwIdx].pNdisPacket = pPacket;
pAd->MgmtRing.Cell[SwIdx].pNextNdisPacket = NULL;
RTMPWriteTxDescriptor(pAd, pTxD, TRUE, FIFO_MGMT);
pTxD->LastSec0 = 1;
pTxD->LastSec1 = 1;
pTxD->DMADONE = 0;
pTxD->SDLen1 = 0;
pTxD->SDPtr0 = PCI_MAP_SINGLE(pAd, pSrcBufVA, SrcBufLen, 0, PCI_DMA_TODEVICE);
pTxD->SDLen0 = SrcBufLen;
#ifdef RT_BIG_ENDIAN
RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
#endif
//==================================================================
/* DBGPRINT_RAW(RT_DEBUG_TRACE, ("MLMEHardTransmit\n"));
for (i = 0; i < (TXWI_SIZE+24); i++)
{
DBGPRINT_RAW(RT_DEBUG_TRACE, ("%x:", *(pSrcBufVA+i)));
if ( i%4 == 3)
DBGPRINT_RAW(RT_DEBUG_TRACE, (" :: "));
if ( i%16 == 15)
DBGPRINT_RAW(RT_DEBUG_TRACE, ("\n "));
}
DBGPRINT_RAW(RT_DEBUG_TRACE, ("\n "));*/
//=======================================================================
pAd->RalinkCounters.KickTxCount++;
pAd->RalinkCounters.OneSecTxDoneCount++;
// Increase TX_CTX_IDX, but write to register later.
INC_RING_INDEX(pAd->MgmtRing.TxCpuIdx, MGMT_RING_SIZE);
RTMP_IO_WRITE32(pAd, TX_MGMTCTX_IDX, pAd->MgmtRing.TxCpuIdx);
return 0;
}
示例10: RTMP_BBP_IO_READ8
VOID RTMP_BBP_IO_READ8(
PRTMP_ADAPTER pAd,
UCHAR bbp_id,
UINT8 *pValue,
BOOLEAN bViaMCU)
{
BBP_CSR_CFG_STRUC BbpCsr;
int _busyCnt, _secCnt, _regID;
ULONG __IrqFlags = 0;
#ifdef RT65xx
if (IS_RT65XX(pAd))
return;
#endif /* RT65xx */
if ((bViaMCU) == TRUE)
RTMP_MAC_SHR_MSEL_PROTECT_LOCK(pAd, __IrqFlags);
_regID = ((bViaMCU) == TRUE ? H2M_BBP_AGENT : BBP_CSR_CFG);
for (_busyCnt=0; _busyCnt<MAX_BUSY_COUNT; _busyCnt++)
{
RTMP_IO_READ32(pAd, _regID, &BbpCsr.word);
if (BbpCsr.field.Busy == BUSY)
continue;
BbpCsr.word = 0;
BbpCsr.field.fRead = 1;
BbpCsr.field.BBP_RW_MODE = 1;
BbpCsr.field.Busy = 1;
BbpCsr.field.RegNum = bbp_id;
RTMP_IO_WRITE32(pAd, _regID, BbpCsr.word);
if ((bViaMCU) == TRUE)
{
AsicSendCommandToMcuBBP(pAd, 0x80, 0xff, 0x0, 0x0, FALSE);
/*RtmpusecDelay(1000);*/
}
for (_secCnt=0; _secCnt<MAX_BUSY_COUNT; _secCnt++)
{
RTMP_IO_READ32(pAd, _regID, &BbpCsr.word);
if (BbpCsr.field.Busy == IDLE)
break;
}
if ((BbpCsr.field.Busy == IDLE) && (BbpCsr.field.RegNum == bbp_id))
{
*pValue = (UCHAR)BbpCsr.field.Value;
break;
}
}
if (BbpCsr.field.Busy == BUSY)
{
DBGPRINT_ERR(("BBP(viaMCU=%d) read R%d fail\n", bViaMCU, bbp_id));
*pValue = pAd->BbpWriteLatch[bbp_id];
if (bViaMCU == TRUE)
{
RTMP_IO_READ32(pAd, _regID, &BbpCsr.word);
BbpCsr.field.Busy = 0;
RTMP_IO_WRITE32(pAd, _regID, BbpCsr.word);
}
}
if (bViaMCU == TRUE)
RTMP_MAC_SHR_MSEL_PROTECT_UNLOCK(pAd, __IrqFlags);
}
示例11: GetPacketFromRxRing
//.........这里部分代码省略.........
#ifdef RT_BIG_ENDIAN
PRXD_STRUC pDestRxD;
RXD_STRUC RxD;
#endif
PNDIS_PACKET pRxPacket = NULL;
PNDIS_PACKET pNewPacket;
PVOID AllocVa;
NDIS_PHYSICAL_ADDRESS AllocPa;
BOOLEAN bReschedule = FALSE;
RTMP_DMACB *pRxCell;
RTMP_SEM_LOCK(&pAd->RxRingLock);
if (*pRxPending == 0)
{
// Get how may packets had been received
RTMP_IO_READ32(pAd, RX_DRX_IDX , &pAd->RxRing.RxDmaIdx);
if (pAd->RxRing.RxSwReadIdx == pAd->RxRing.RxDmaIdx)
{
// no more rx packets
bReschedule = FALSE;
goto done;
}
// get rx pending count
if (pAd->RxRing.RxDmaIdx > pAd->RxRing.RxSwReadIdx)
*pRxPending = pAd->RxRing.RxDmaIdx - pAd->RxRing.RxSwReadIdx;
else
*pRxPending = pAd->RxRing.RxDmaIdx + RX_RING_SIZE - pAd->RxRing.RxSwReadIdx;
}
pRxCell = &pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx];
#ifdef RT_BIG_ENDIAN
pDestRxD = (PRXD_STRUC) pRxCell->AllocVa;
RxD = *pDestRxD;
pRxD = &RxD;
RTMPDescriptorEndianChange((PUCHAR)pRxD, TYPE_RXD);
#else
// Point to Rx indexed rx ring descriptor
pRxD = (PRXD_STRUC) pRxCell->AllocVa;
#endif
if (pRxD->DDONE == 0)
{
*pRxPending = 0;
// DMAIndx had done but DDONE bit not ready
bReschedule = TRUE;
goto done;
}
// return rx descriptor
NdisMoveMemory(pSaveRxD, pRxD, RXD_SIZE);
pNewPacket = RTMP_AllocateRxPacketBuffer(pAd, RX_BUFFER_AGGRESIZE, FALSE, &AllocVa, &AllocPa);
if (pNewPacket)
{
// unmap the rx buffer
PCI_UNMAP_SINGLE(pAd, pRxCell->DmaBuf.AllocPa,
pRxCell->DmaBuf.AllocSize, PCI_DMA_FROMDEVICE);
pRxPacket = pRxCell->pNdisPacket;
pRxCell->DmaBuf.AllocSize = RX_BUFFER_AGGRESIZE;
pRxCell->pNdisPacket = (PNDIS_PACKET) pNewPacket;
pRxCell->DmaBuf.AllocVa = AllocVa;
pRxCell->DmaBuf.AllocPa = AllocPa;
/* update SDP0 to new buffer of rx packet */
pRxD->SDP0 = AllocPa;
}
else
{
//DBGPRINT(RT_DEBUG_TRACE,("No Rx Buffer\n"));
pRxPacket = NULL;
bReschedule = TRUE;
}
pRxD->DDONE = 0;
// had handled one rx packet
*pRxPending = *pRxPending - 1;
// update rx descriptor and kick rx
#ifdef RT_BIG_ENDIAN
RTMPDescriptorEndianChange((PUCHAR)pRxD, TYPE_RXD);
WriteBackToDescriptor((PUCHAR)pDestRxD, (PUCHAR)pRxD, FALSE, TYPE_RXD);
#endif
INC_RING_INDEX(pAd->RxRing.RxSwReadIdx, RX_RING_SIZE);
pAd->RxRing.RxCpuIdx = (pAd->RxRing.RxSwReadIdx == 0) ? (RX_RING_SIZE-1) : (pAd->RxRing.RxSwReadIdx-1);
RTMP_IO_WRITE32(pAd, RX_CRX_IDX, pAd->RxRing.RxCpuIdx);
done:
RTMP_SEM_UNLOCK(&pAd->RxRingLock);
*pbReschedule = bReschedule;
return pRxPacket;
}
示例12: RTMP_BBP_IO_WRITE8
VOID RTMP_BBP_IO_WRITE8(
RTMP_ADAPTER *pAd,
UCHAR bbp_id,
UINT8 Value,
BOOLEAN bViaMCU)
{
BBP_CSR_CFG_STRUC BbpCsr;
int _busyCnt=0, _regID;
BOOLEAN brc;
ULONG __IrqFlags = 0;
#ifdef RT65xx
if (IS_RT65XX(pAd))
return;
#endif /* RT65xx */
if (bViaMCU == TRUE)
RTMP_MAC_SHR_MSEL_PROTECT_LOCK(pAd, __IrqFlags);
_regID = (bViaMCU == TRUE ? H2M_BBP_AGENT : BBP_CSR_CFG);
for (_busyCnt=1; _busyCnt<MAX_BUSY_COUNT; _busyCnt++)
{
RTMP_IO_READ32((pAd), _regID, &BbpCsr.word);
if (BbpCsr.field.Busy == BUSY)
{
if ( (bViaMCU == TRUE) && ((_busyCnt % 20) == 0))
{
BbpCsr.field.Busy = IDLE;
RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, BbpCsr.word);
}
continue;
}
BbpCsr.word = 0;
BbpCsr.field.fRead = 0;
BbpCsr.field.BBP_RW_MODE = 1;
BbpCsr.field.Busy = 1;
BbpCsr.field.Value = Value;
BbpCsr.field.RegNum = bbp_id;
RTMP_IO_WRITE32((pAd), _regID, BbpCsr.word);
if (bViaMCU == TRUE)
{
brc = AsicSendCommandToMcuBBP(pAd, 0x80, 0xff, 0x0, 0x0, FALSE);
if (pAd->OpMode == OPMODE_AP)
RtmpusecDelay(1000);
if (brc == FALSE)
{
BbpCsr.field.Busy = IDLE;
RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, BbpCsr.word);
}
}
pAd->BbpWriteLatch[bbp_id] = Value;
break;
}
if (_busyCnt == MAX_BUSY_COUNT)
{
DBGPRINT_ERR(("BBP write R%d fail\n", bbp_id));
if(bViaMCU == TRUE)
{
RTMP_IO_READ32(pAd, H2M_BBP_AGENT, &BbpCsr.word);
BbpCsr.field.Busy = 0;
RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, BbpCsr.word);
}
}
if (bViaMCU == TRUE)
RTMP_MAC_SHR_MSEL_PROTECT_UNLOCK(pAd, __IrqFlags);
}
示例13: CFG80211DRV_OpsChgVirtualInf
//.........这里部分代码省略.........
#ifdef CONFIG_STA_SUPPORT
/* Change Device Type */
if (newType == RT_CMD_80211_IFTYPE_ADHOC)
{
Set_NetworkType_Proc(pAd, "Adhoc");
}
else if ((newType == RT_CMD_80211_IFTYPE_STATION) ||
(newType == RT_CMD_80211_IFTYPE_P2P_CLIENT))
{
CFG80211DBG(RT_DEBUG_TRACE, ("80211> Change the Interface to STA Mode\n"));
#ifdef CONFIG_AP_SUPPORT
if (pAd->cfg80211_ctrl.isCfgInApMode == RT_CMD_80211_IFTYPE_AP && RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP))
CFG80211DRV_DisableApInterface(pAd);
#endif /* CONFIG_AP_SUPPORT */
pAd->cfg80211_ctrl.isCfgInApMode = RT_CMD_80211_IFTYPE_STATION;
}
else
#endif /*CONFIG_STA_SUPPORT*/
if ((newType == RT_CMD_80211_IFTYPE_AP) ||
(newType == RT_CMD_80211_IFTYPE_P2P_GO))
{
CFG80211DBG(RT_DEBUG_TRACE, ("80211> Change the Interface to AP Mode\n"));
pAd->cfg80211_ctrl.isCfgInApMode = RT_CMD_80211_IFTYPE_AP;
}
#ifdef CONFIG_STA_SUPPORT
else if (newType == RT_CMD_80211_IFTYPE_MONITOR)
{
/* set packet filter */
Set_NetworkType_Proc(pAd, "Monitor");
if (pVifParm->MonFilterFlag != 0)
{
UINT32 Filter;
RTMP_IO_READ32(pAd, RX_FILTR_CFG, &Filter);
if ((pVifParm->MonFilterFlag & RT_CMD_80211_FILTER_FCSFAIL) == RT_CMD_80211_FILTER_FCSFAIL)
{
Filter = Filter & (~0x01);
}
else
{
Filter = Filter | 0x01;
}
if ((pVifParm->MonFilterFlag & RT_CMD_80211_FILTER_PLCPFAIL) == RT_CMD_80211_FILTER_PLCPFAIL)
{
Filter = Filter & (~0x02);
}
else
{
Filter = Filter | 0x02;
}
if ((pVifParm->MonFilterFlag & RT_CMD_80211_FILTER_CONTROL) == RT_CMD_80211_FILTER_CONTROL)
{
Filter = Filter & (~0xFF00);
}
else
{
Filter = Filter | 0xFF00;
}
if ((pVifParm->MonFilterFlag & RT_CMD_80211_FILTER_OTHER_BSS) == RT_CMD_80211_FILTER_OTHER_BSS)
{
Filter = Filter & (~0x08);
}
else
{
Filter = Filter | 0x08;
}
RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, Filter);
pVifParm->MonFilterFlag = Filter;
}
}
#endif /*CONFIG_STA_SUPPORT*/
if ((newType == RT_CMD_80211_IFTYPE_P2P_CLIENT) ||
(newType == RT_CMD_80211_IFTYPE_P2P_GO))
{
COPY_MAC_ADDR(pAd->cfg80211_ctrl.P2PCurrentAddress, pVifParm->net_dev->dev_addr);
}
else
{
#ifdef RT_CFG80211_P2P_SUPPORT
pCfg80211_ctrl->bP2pCliPmEnable = FALSE;
pCfg80211_ctrl->bPreKeepSlient = FALSE;
pCfg80211_ctrl->bKeepSlient = FALSE;
pCfg80211_ctrl->NoAIndex = MAX_LEN_OF_MAC_TABLE;
pCfg80211_ctrl->MyGOwcid = MAX_LEN_OF_MAC_TABLE;
pCfg80211_ctrl->CTWindows= 0; /* CTWindows and OppPS parameter field */
#endif /* RT_CFG80211_P2P_SUPPORT */
}
return TRUE;
}
示例14: NICInitRT3070RFRegisters
VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
{
INT i;
UCHAR RFValue;
/*
Driver must read EEPROM to get RfIcType before initial RF registers
Initialize RF register to default value
*/
if (IS_RT3070(pAd) || IS_RT3071(pAd))
{
/*
Init RF calibration
Driver should toggle RF R30 bit7 before init RF registers
*/
UINT8 RfReg = 0;
UINT32 data;
RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg);
RfReg |= 0x80;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
RTMPusecDelay(1000);
RfReg &= 0x7F;
RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
/* set default antenna as main */
if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
/* Initialize RF register to default value */
for (i = 0; i < NUM_RF_3020_REG_PARMS; i++)
{
RT30xxWriteRFRegister(pAd, RT3020_RFRegTable[i].Register, RT3020_RFRegTable[i].Value);
}
RT30xxWriteRFRegister(pAd, RF_R31, 0x14);
/* add by johnli */
if (IS_RT3070(pAd))
{
/*
The DAC issue(LDO_CFG0) has been fixed in RT3070(F).
The voltage raising patch is no longer needed for RT3070(F)
*/
if ((pAd->MACVersion & 0xffff) < 0x0201)
{
/* Update MAC 0x05D4 from 01xxxxxx to 0Dxxxxxx (voltage 1.2V to 1.35V) for RT3070 to improve yield rate */
RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
data = ((data & 0xF0FFFFFF) | 0x0D000000);
RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
}
}
else if (IS_RT3071(pAd))
{
/* Driver should set RF R6 bit6 on before init RF registers */
RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR)&RfReg);
RfReg |= 0x40;
RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR)RfReg);
/* RT3071 version E has fixed this issue */
if ((pAd->NicConfig2.field.DACTestBit == 1) && ((pAd->MACVersion & 0xffff) < 0x0211))
{
/* patch tx EVM issue temporarily */
RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
data = ((data & 0xE0FFFFFF) | 0x0D000000);
RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
}
else
{
RTMP_IO_READ32(pAd, LDO_CFG0, &data);
data = ((data & 0xE0FFFFFF) | 0x01000000);
RTMP_IO_WRITE32(pAd, LDO_CFG0, data);
}
/* patch LNA_PE_G1 failed issue */
RTUSBReadMACRegister(pAd, GPIO_SWITCH, &data);
data &= ~(0x20);
RTUSBWriteMACRegister(pAd, GPIO_SWITCH, data);
}
/* For RF filter Calibration */
RTMPFilterCalibration(pAd);
/*
Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F).
Raising RF voltage is no longer needed for RT3070(F)
*/
if ((IS_RT3070(pAd)) && ((pAd->MACVersion & 0xffff) < 0x0201))
{
RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
}
else if ((IS_RT3071(pAd)) && ((pAd->MACVersion & 0xffff) < 0x0211))
{
RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
}
/* set led open drain enable */
RTUSBReadMACRegister(pAd, OPT_14, &data);
data |= 0x01;
//.........这里部分代码省略.........
示例15: APMakeAllBssBeacon
//.........这里部分代码省略.........
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 */
}