Commit df35bf66 authored by Florian Schilhabel's avatar Florian Schilhabel Committed by Greg Kroah-Hartman

Staging: rtl8192su: some work on SetBWModeCallback8192SUsbWorkItem

mostly cosmetics.
Signed-off-by: default avatarFlorian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 8e399b03
...@@ -3607,128 +3607,103 @@ void SetBWModeCallback8192SUsb(struct net_device *dev) ...@@ -3607,128 +3607,103 @@ void SetBWModeCallback8192SUsb(struct net_device *dev)
RT_TRACE(COMP_SCAN, "<==SetBWMode8190Pci()" ); RT_TRACE(COMP_SCAN, "<==SetBWMode8190Pci()" );
} }
// /*
// Callback routine of the work item for set bandwidth mode. * Callback routine of the work item for set bandwidth mode.
// *
// use in phy only (in win it's work) * use in phy only (in win it's work)
*/
void SetBWModeCallback8192SUsbWorkItem(struct net_device *dev) void SetBWModeCallback8192SUsbWorkItem(struct net_device *dev)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
u8 regBwOpMode; u8 regBwOpMode;
// Added it for 20/40 mhz switch time evaluation by guangan 070531
//u32 NowL, NowH;
//u8Byte BeginTime, EndTime;
u8 regRRSR_RSC; u8 regRRSR_RSC;
RT_TRACE(COMP_SCAN, "==>SetBWModeCallback8192SUsbWorkItem() Switch to %s bandwidth\n", \ RT_TRACE(COMP_SCAN, "%s(): Switch to %s bandwidth", __func__,
priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20?"20MHz":"40MHz"); priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ? "20MHz" : "40MHz");
if(priv->rf_chip == RF_PSEUDO_11N) if (priv->rf_chip == RF_PSEUDO_11N) {
{
priv->SetBWModeInProgress= FALSE; priv->SetBWModeInProgress= FALSE;
return; return;
} }
if(!priv->up) if(!priv->up)
return; return;
/* Set MAC register */
// Added it for 20/40 mhz switch time evaluation by guangan 070531
//NowL = read_nic_dword(dev, TSFR);
//NowH = read_nic_dword(dev, TSFR+4);
//BeginTime = ((u8Byte)NowH << 32) + NowL;
//3<1>Set MAC register
regBwOpMode = read_nic_byte(dev, BW_OPMODE); regBwOpMode = read_nic_byte(dev, BW_OPMODE);
regRRSR_RSC = read_nic_byte(dev, RRSR+2); regRRSR_RSC = read_nic_byte(dev, RRSR+2);
switch (priv->CurrentChannelBW) {
switch(priv->CurrentChannelBW)
{
case HT_CHANNEL_WIDTH_20: case HT_CHANNEL_WIDTH_20:
regBwOpMode |= BW_OPMODE_20MHZ; regBwOpMode |= BW_OPMODE_20MHZ;
// 2007/02/07 Mark by Emily becasue we have not verify whether this register works /* we have not verified whether this register works */
write_nic_byte(dev, BW_OPMODE, regBwOpMode); write_nic_byte(dev, BW_OPMODE, regBwOpMode);
break; break;
case HT_CHANNEL_WIDTH_20_40: case HT_CHANNEL_WIDTH_20_40:
regBwOpMode &= ~BW_OPMODE_20MHZ; regBwOpMode &= ~BW_OPMODE_20MHZ;
// 2007/02/07 Mark by Emily becasue we have not verify whether this register works /* we have not verified whether this register works */
write_nic_byte(dev, BW_OPMODE, regBwOpMode); write_nic_byte(dev, BW_OPMODE, regBwOpMode);
regRRSR_RSC = (regRRSR_RSC&0x90) |(priv->nCur40MhzPrimeSC<<5); regRRSR_RSC = (regRRSR_RSC&0x90) | (priv->nCur40MhzPrimeSC<<5);
write_nic_byte(dev, RRSR+2, regRRSR_RSC); write_nic_byte(dev, RRSR+2, regRRSR_RSC);
break; break;
default: default:
RT_TRACE(COMP_DBG, "SetBWModeCallback8192SUsbWorkItem(): unknown Bandwidth: %#X\n", RT_TRACE(COMP_DBG, "%s(): unknown Bandwidth: %#X", __func__,
priv->CurrentChannelBW); priv->CurrentChannelBW);
break; break;
} }
/* Set PHY related register */
//3 <2>Set PHY related register switch (priv->CurrentChannelBW) {
switch(priv->CurrentChannelBW)
{
case HT_CHANNEL_WIDTH_20: case HT_CHANNEL_WIDTH_20:
rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x0); rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x0);
rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x0); rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x0);
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0xff, 0x58); rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0xff, 0x58);
break; break;
case HT_CHANNEL_WIDTH_20_40: case HT_CHANNEL_WIDTH_20_40:
rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x1); rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x1);
rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x1); rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x1);
/*
// Set Control channel to upper or lower. These settings are required only for 40MHz * Set Control channel to upper or lower.
rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1)); * These settings are required only for 40MHz
rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00, priv->nCur40MhzPrimeSC); */
rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand,
(priv->nCur40MhzPrimeSC>>1));
rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00,
priv->nCur40MhzPrimeSC);
rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0xff, 0x18); rtl8192_setBBreg(dev, rFPGA0_AnalogParameter2, 0xff, 0x18);
break; break;
default: default:
RT_TRACE(COMP_DBG, "SetBWModeCallback8192SUsbWorkItem(): unknown Bandwidth: %#X\n"\ RT_TRACE(COMP_DBG, "%s(): unknown Bandwidth: %#X", __func__,
,priv->CurrentChannelBW); priv->CurrentChannelBW);
break; break;
} }
//Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315 /*
* Skip over setting of J-mode in BB register here.
* Default value is "None J mode".
*/
//3<3>Set RF related register /* Set RF related register */
switch( priv->rf_chip ) switch (priv->rf_chip) {
{
case RF_8225: case RF_8225:
PHY_SetRF8225Bandwidth(dev, priv->CurrentChannelBW); PHY_SetRF8225Bandwidth(dev, priv->CurrentChannelBW);
break; break;
case RF_8256: case RF_8256:
// Please implement this function in Hal8190PciPhy8256.c /* Please implement this function in Hal8190PciPhy8256.c */
//PHY_SetRF8256Bandwidth(dev, priv->CurrentChannelBW); /* PHY_SetRF8256Bandwidth(dev, priv->CurrentChannelBW); */
break; break;
case RF_6052: case RF_6052:
PHY_RF6052SetBandwidth(dev, priv->CurrentChannelBW); PHY_RF6052SetBandwidth(dev, priv->CurrentChannelBW);
break; break;
case RF_8258: case RF_8258:
// Please implement this function in Hal8190PciPhy8258.c /* Please implement this function in Hal8190PciPhy8258.c */
// PHY_SetRF8258Bandwidth(); /* PHY_SetRF8258Bandwidth(); */
break; break;
case RF_PSEUDO_11N: case RF_PSEUDO_11N:
// Do Nothing /* Do Nothing */
break; break;
default: default:
//RT_ASSERT(FALSE, ("Unknown rf_chip: %d\n", priv->rf_chip)); RT_TRACE(COMP_DBG, "%s(): unknown rf_chip: %d", __func__,
priv->rf_chip);
break; break;
} }
priv->SetBWModeInProgress= FALSE; priv->SetBWModeInProgress= FALSE;
RT_TRACE(COMP_SCAN, "<==SetBWModeCallback8192SUsbWorkItem()" );
} }
//--------------------------Move to oter DIR later-------------------------------*/ //--------------------------Move to oter DIR later-------------------------------*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment