u32 rtl8192_CalculateBitShift(u32 bitmask)
{
u32 i;
+
i = ffs(bitmask) - 1;
return i;
}
+
/******************************************************************************
* function: This function checks different RF type to execute legal judgement.
* If RF Path is illegal, we will return false.
{
u8 ret = 1;
struct r8192_priv *priv = ieee80211_priv(dev);
+
if (priv->rf_type == RF_2T4R) {
ret = 0;
} else if (priv->rf_type == RF_1T2R) {
}
return ret;
}
+
/******************************************************************************
* function: This function sets specific bits to BB register
* input: net_device *dev
}
return;
}
+
/******************************************************************************
* function: This function reads specific bits from BB register
* input: net_device *dev
return (reg & bitmask) >> bitshift;
}
+
static u32 phy_FwRFSerialRead(struct net_device *dev, RF90_RADIO_PATH_E eRFPath,
u32 offset);
u32 ret = 0;
u32 new_offset = 0;
BB_REGISTER_DEFINITION_T *pPhyReg = &priv->PHYRegDef[eRFPath];
+
rtl8192_setBBreg(dev, pPhyReg->rfLSSIReadBack, bLSSIReadBackData, 0);
/* Make sure RF register offset is correct */
offset &= 0x3f;
}
return ret;
-
}
/******************************************************************************
return reg;
}
}
+
/******************************************************************************
* function: We support firmware to execute RF-R/W.
* input: net_device *dev
u32 data = 0;
u8 time = 0;
u32 tmp;
+
/* Firmware RF Write control.
* We can not execute the scheme in the initial step.
* Otherwise, RF-R/W will waste much time.
read_nic_dword(dev, RF_DATA, ®);
return reg;
-
}
/******************************************************************************
/* According to test, we must delay 20us to wait firmware
to finish RF write operation. */
/* We support delay in firmware side now. */
-
}
-
/******************************************************************************
* function: This function reads BB parameters from header file we generate,
* and do register read/write
pdwArray[i+2]);
}
return;
-
}
/******************************************************************************
* notice: BB parameters may change all the time, so please make
* sure it has been synced with the newest.
*****************************************************************************/
-
void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType)
{
u32 i;
#ifdef TO_DO_LIST
u32 *rtl8192PhyRegArrayTable = NULL, *rtl8192AgcTabArrayTable = NULL;
+
if (Adapter->bInHctTest) {
PHY_REGArrayLen = PHY_REGArrayLengthDTM;
AGCTAB_ArrayLen = AGCTAB_ArrayLengthDTM;
}
}
return;
-
-
}
+
/******************************************************************************
* function: This function initializes Register definition offset for
* Radio Path A/B/C/D
void rtl8192_InitBBRFRegDef(struct net_device *dev)
{
struct r8192_priv *priv = ieee80211_priv(dev);
+
/* RF Interface Software Control */
/* 16 LSBs if read 32-bit from 0x870 */
priv->PHYRegDef[RF90_PATH_A].rfintfs = rFPGA0_XAB_RFInterfaceSW;
priv->PHYRegDef[RF90_PATH_B].rfLSSIReadBack = rFPGA0_XB_LSSIReadBack;
priv->PHYRegDef[RF90_PATH_C].rfLSSIReadBack = rFPGA0_XC_LSSIReadBack;
priv->PHYRegDef[RF90_PATH_D].rfLSSIReadBack = rFPGA0_XD_LSSIReadBack;
-
}
+
/******************************************************************************
* function: This function is to write register and then readback to make
* sure whether BB and RF is OK
u32 i, CheckTimes = 4, reg = 0;
u32 WriteAddr[4];
u32 WriteData[] = {0xfffff027, 0xaa55a02f, 0x00000027, 0x55aa502f};
+
/* Initialize register address offset to be checked */
WriteAddr[HW90_BLOCK_MAC] = 0x100;
WriteAddr[HW90_BLOCK_PHY0] = 0x900;
switch (CheckBlock) {
case HW90_BLOCK_MAC:
RT_TRACE(COMP_ERR,
- "PHY_CheckBBRFOK(): Never Write 0x100 here!");
+ "PHY_CheckBBRFOK(): Never Write 0x100 here!\n");
break;
case HW90_BLOCK_PHY0:
return ret;
}
-
/******************************************************************************
* function: This function initializes BB&RF
* input: net_device *dev
struct r8192_priv *priv = ieee80211_priv(dev);
u8 reg_u8 = 0, eCheckItem = 0, status = 0;
u32 reg_u32 = 0;
+
/**************************************
* <1> Initialize BaseBand
*************************************/
0x200);
return;
}
+
/******************************************************************************
* function: This function initializes BB&RF
* input: net_device *dev
return;
}
+
/******************************************************************************
* function: This function obtains the initialization value of Tx power Level
* offset
{
struct r8192_priv *priv = ieee80211_priv(dev);
u8 tmp;
+
read_nic_dword(dev, rTxAGC_Rate18_06,
&priv->MCSTxPowerLevelOriginalOffset[0]);
read_nic_dword(dev, rTxAGC_Rate54_24,
return ret;
}
+
/******************************************************************************
* function: This function sets Tx Power of the channel
* input: net_device *dev
return true;
}
+
/******************************************************************************
* function: This function sets channel step by step
* input: net_device *dev
break;
}
}
+
/******************************************************************************
* function: Callback routine of the work item for switch channel.
* input: net_device *dev
case WIRELESS_MODE_A:
case WIRELESS_MODE_N_5G:
if (channel <= 14) {
- RT_TRACE(COMP_ERR, "WIRELESS_MODE_A but channel<=14");
+ RT_TRACE(COMP_ERR, "WIRELESS_MODE_A but channel<=14\n");
return false;
}
break;
case WIRELESS_MODE_B:
if (channel > 14) {
- RT_TRACE(COMP_ERR, "WIRELESS_MODE_B but channel>14");
+ RT_TRACE(COMP_ERR, "WIRELESS_MODE_B but channel>14\n");
return false;
}
break;
case WIRELESS_MODE_G:
case WIRELESS_MODE_N_24G:
if (channel > 14) {
- RT_TRACE(COMP_ERR, "WIRELESS_MODE_G but channel>14");
+ RT_TRACE(COMP_ERR, "WIRELESS_MODE_G but channel>14\n");
return false;
}
break;
return true;
}
-
/******************************************************************************
* function: Callback routine of the work item for set bandwidth mode.
* input: net_device *dev
}
priv->SetBWModeInProgress = false;
- RT_TRACE(COMP_SWBW, "<==SetBWMode819xUsb(), %d",
+ RT_TRACE(COMP_SWBW, "<==SetBWMode819xUsb(), %d\n",
atomic_read(&priv->ieee80211->atm_swbw));
}