10 static u32 RF_CHANNEL_TABLE_ZEBRA[] = {
29 #define rtl819XPHY_REG_1T2RArray Rtl8192UsbPHY_REG_1T2RArray
30 #define rtl819XMACPHY_Array_PG Rtl8192UsbMACPHY_Array_PG
31 #define rtl819XMACPHY_Array Rtl8192UsbMACPHY_Array
32 #define rtl819XRadioA_Array Rtl8192UsbRadioA_Array
33 #define rtl819XRadioB_Array Rtl8192UsbRadioB_Array
34 #define rtl819XRadioC_Array Rtl8192UsbRadioC_Array
35 #define rtl819XRadioD_Array Rtl8192UsbRadioD_Array
36 #define rtl819XAGCTAB_Array Rtl8192UsbAGCTAB_Array
50 if (((dwBitMask>>i)&0x1) == 1)
89 u32 OriginalValue, BitShift, NewValue;
95 NewValue = (((OriginalValue) & (~dwBitMask)) | (dwData << BitShift));
112 u32 Ret = 0, OriginalValue, BitShift;
116 Ret =(OriginalValue & dwBitMask) >> BitShift;
152 NewOffset = Offset -30;
154 else if (Offset >= 16)
161 NewOffset = Offset - 15;
224 u32 DataAndAddr = 0, NewOffset = 0;
237 NewOffset = Offset - 30;
239 else if (Offset >= 16)
244 NewOffset = Offset - 15;
256 DataAndAddr = (Data<<16) | (NewOffset&0x3f);
297 u32 Original_Value, BitShift, New_Value;
307 Original_Value = phy_FwRFSerialRead(dev, eRFPath, RegAddr);
309 New_Value = ((Original_Value) & (~BitMask)) | (Data<< BitShift);
311 phy_FwRFSerialWrite(dev, eRFPath, RegAddr, New_Value);
313 phy_FwRFSerialWrite(dev, eRFPath, RegAddr, Data);
324 New_Value = (((Original_Value) & (~BitMask)) | (Data<< BitShift));
344 u32 Original_Value, Readback_Value, BitShift;
352 Original_Value = phy_FwRFSerialRead(dev, eRFPath, RegAddr);
354 Readback_Value = (Original_Value & BitMask) >> BitShift;
356 return (Readback_Value);
362 Readback_Value = (Original_Value & BitMask) >> BitShift;
363 return (Readback_Value);
389 Data |= ((Offset&0xFF)<<12);
391 Data |= ((eRFPath&0x3)<<20);
452 Data |= ((Offset&0xFF)<<12);
454 Data |= ((eRFPath&0x3)<<20);
494 u32 dwArrayLen = 0,
i;
511 for(
i = 0;
i<dwArrayLen;
i=
i+3){
512 if(pdwArray[
i] == 0x318)
514 pdwArray[
i+2] = 0x00000800;
519 RT_TRACE(
COMP_DBG,
"The Rtl8190MACPHY_Array[0] is %x Rtl8190MACPHY_Array[1] is %x Rtl8190MACPHY_Array[2] is %x\n",
520 pdwArray[
i], pdwArray[i+1], pdwArray[i+2]);
541 u32 *rtl8192PhyRegArrayTable =
NULL, *rtl8192AgcTabArrayTable =
NULL;
544 PHY_REGArrayLen = PHY_REGArrayLengthDTM;
545 AGCTAB_ArrayLen = AGCTAB_ArrayLengthDTM;
546 Rtl8190PHY_REGArray_Table = Rtl819XPHY_REGArrayDTM;
547 Rtl8190AGCTAB_Array_Table = Rtl819XAGCTAB_ArrayDTM;
698 u32 i, CheckTimes = 4, dwRegRead = 0;
700 u32 WriteData[] = {0xfffff027, 0xaa55a02f, 0x00000027, 0x55aa502f};
707 for(i=0 ; i < CheckTimes ; i++)
726 WriteData[
i] &= 0xfff;
743 if(dwRegRead != WriteData[i])
766 u8 bRegValue = 0, eCheckItem = 0, rtStatus = 0;
867 RT_TRACE(
COMP_INIT,
"Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x) \n",
1033 PHY_SetRF8225CckTxPower(
Adapter, powerlevel);
1034 PHY_SetRF8225OfdmTxPower(
Adapter, powerlevelOFDM24G);
1062 bool bResult =
true;
1066 if(eRFPowerState == priv->
ieee80211->eRFPowerState)
1077 switch( eRFPowerState )
1119 RT_TRACE(
COMP_ERR,
"SetRFPowerState819xUsb(): unknow state to set: 0x%X!!!\n", eRFPowerState);
1131 pHalData->eRFPowerState = eRFPowerState;
1132 switch(pHalData->RFChipID )
1135 switch(pHalData->eRFPowerState)
1155 if( pMgntInfo->bMediaConnect ==
TRUE )
1198 SwChnlCmd* CmdTable,
1209 if(CmdTable ==
NULL)
1214 if(CmdTableIdx >= CmdTableSz)
1216 RT_TRACE(
COMP_ERR,
"phy_SetSwChnlCmdArray(): Access invalid index, please check size of the table, CmdTableIdx:%d, CmdTableSz:%d\n",
1217 CmdTableIdx, CmdTableSz);
1221 pCmd = CmdTable + CmdTableIdx;
1222 pCmd->CmdID =
CmdID;
1223 pCmd->Para1 =
Para1;
1224 pCmd->Para2 =
Para2;
1245 u32 PreCommonCmdCnt;
1247 u32 PostCommonCmdCnt;
1250 SwChnlCmd *CurrentCmd =
NULL;
1272 PreCommonCmdCnt = 0;
1279 PostCommonCmdCnt = 0;
1289 if (!(channel >= 1 && channel <= 14))
1302 if (!(channel >= 1 && channel <= 14))
1327 CurrentCmd=&PreCommonCmd[*
step];
1330 CurrentCmd=&RfDependCmd[*
step];
1333 CurrentCmd=&PostCommonCmd[*
step];
1341 (*delay)=CurrentCmd->msDelay;
1352 switch(CurrentCmd->CmdID)
1381 (*delay)=CurrentCmd->msDelay;
1449 for(eRFPath = 0; eRFPath < 2; eRFPath++){
1517 RT_TRACE(
COMP_SWBW,
"==>rtl8192_SetBWModeWorkItem() Switch to %s bandwidth\n", \
1624 PHY_SetRF8225Bandwidth(
Adapter, pHalData->CurrentChannelBW);
1699 #define SCAN_RX_INITIAL_GAIN 0x17
1700 #define POWER_DETECTION_TH 0x08
1756 SetTxPowerLevel8190(
Adapter,priv->CurrentChannel);
1759 SetTxPowerLevel8190(
Adapter,priv->CurrentChannel);