Staging: rtl8187se: r8185b_init.c: Fix comment blocks
Reformated comment blocks to meet Coding Style Signed-off-by: Andrew Miller <amiller@amilx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1ee6b74f3b
commit
4d36bf6192
1 changed files with 179 additions and 169 deletions
|
@ -1,22 +1,22 @@
|
||||||
/*++
|
/*
|
||||||
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
* Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||||
|
*
|
||||||
Module Name:
|
* Module Name:
|
||||||
r8185b_init.c
|
* r8185b_init.c
|
||||||
|
*
|
||||||
Abstract:
|
* Abstract:
|
||||||
Hardware Initialization and Hardware IO for RTL8185B
|
* Hardware Initialization and Hardware IO for RTL8185B
|
||||||
|
*
|
||||||
Major Change History:
|
* Major Change History:
|
||||||
When Who What
|
* When Who What
|
||||||
---------- --------------- -------------------------------
|
* ---------- --------------- -------------------------------
|
||||||
2006-11-15 Xiong Created
|
* 2006-11-15 Xiong Created
|
||||||
|
*
|
||||||
Notes:
|
* Notes:
|
||||||
This file is ported from RTL8185B Windows driver.
|
* This file is ported from RTL8185B Windows driver.
|
||||||
|
*
|
||||||
|
*
|
||||||
--*/
|
*/
|
||||||
|
|
||||||
/*--------------------------Include File------------------------------------*/
|
/*--------------------------Include File------------------------------------*/
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
|
@ -110,9 +110,10 @@ static u8 OFDM_CONFIG[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*---------------------------------------------------------------
|
/*---------------------------------------------------------------
|
||||||
* Hardware IO
|
* Hardware IO
|
||||||
* the code is ported from Windows source code
|
* the code is ported from Windows source code
|
||||||
----------------------------------------------------------------*/
|
*---------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
void PlatformIOWrite1Byte(struct net_device *dev, u32 offset, u8 data)
|
void PlatformIOWrite1Byte(struct net_device *dev, u32 offset, u8 data)
|
||||||
{
|
{
|
||||||
|
@ -141,13 +142,13 @@ void PlatformIOWrite4Byte(struct net_device *dev, u32 offset, u32 data)
|
||||||
dataBytes = data>>8;
|
dataBytes = data>>8;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
071010, rcnjko:
|
* 071010, rcnjko:
|
||||||
The critical section is only BB read/write race condition.
|
* The critical section is only BB read/write race condition.
|
||||||
Assumption:
|
* Assumption:
|
||||||
1. We assume NO one will access BB at DIRQL, otherwise, system will crash for
|
* 1. We assume NO one will access BB at DIRQL, otherwise, system will crash for
|
||||||
acquiring the spinlock in such context.
|
* acquiring the spinlock in such context.
|
||||||
2. PlatformIOWrite4Byte() MUST NOT be recursive.
|
* 2. PlatformIOWrite4Byte() MUST NOT be recursive.
|
||||||
*/
|
*/
|
||||||
/* NdisAcquireSpinLock( &(pDevice->IoSpinLock) ); */
|
/* NdisAcquireSpinLock( &(pDevice->IoSpinLock) ); */
|
||||||
|
|
||||||
for (idx = 0; idx < 30; idx++) {
|
for (idx = 0; idx < 30; idx++) {
|
||||||
|
@ -388,10 +389,10 @@ u8 ReadBBPortUchar(struct net_device *dev, u32 addr)
|
||||||
return RegisterContent;
|
return RegisterContent;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Description:
|
* Description:
|
||||||
Perform Antenna settings with antenna diversity on 87SE.
|
* Perform Antenna settings with antenna diversity on 87SE.
|
||||||
Created by Roger, 2008.01.25.
|
* Created by Roger, 2008.01.25.
|
||||||
*/
|
*/
|
||||||
bool SetAntennaConfig87SE(struct net_device *dev,
|
bool SetAntennaConfig87SE(struct net_device *dev,
|
||||||
u8 DefaultAnt, /* 0: Main, 1: Aux. */
|
u8 DefaultAnt, /* 0: Main, 1: Aux. */
|
||||||
bool bAntDiversity) /* 1:Enable, 0: Disable. */
|
bool bAntDiversity) /* 1:Enable, 0: Disable. */
|
||||||
|
@ -459,10 +460,11 @@ bool SetAntennaConfig87SE(struct net_device *dev,
|
||||||
return bAntennaSwitched;
|
return bAntennaSwitched;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
---------------------------------------------------------------
|
*--------------------------------------------------------------
|
||||||
* Hardware Initialization.
|
* Hardware Initialization.
|
||||||
* the code is ported from Windows source code
|
* the code is ported from Windows source code
|
||||||
----------------------------------------------------------------*/
|
*--------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
||||||
{
|
{
|
||||||
|
@ -476,10 +478,10 @@ void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
87S_PCIE :: RADIOCFG.TXT
|
* 87S_PCIE :: RADIOCFG.TXT
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/* Page1 : reg16-reg30 */
|
/* Page1 : reg16-reg30 */
|
||||||
|
@ -577,11 +579,13 @@ void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
||||||
RF_WriteReg(dev, 0x0a, 0x0001); mdelay(1);
|
RF_WriteReg(dev, 0x0a, 0x0001); mdelay(1);
|
||||||
/* For crystal calibration, added by Roger, 2007.12.11. */
|
/* For crystal calibration, added by Roger, 2007.12.11. */
|
||||||
if (priv->bXtalCalibration) { /* reg 30. */
|
if (priv->bXtalCalibration) { /* reg 30. */
|
||||||
/* enable crystal calibration.
|
/*
|
||||||
RF Reg[30], (1)Xin:[12:9], Xout:[8:5], addr[4:0].
|
* enable crystal calibration.
|
||||||
(2)PA Pwr delay timer[15:14], default: 2.4us, set BIT15=0
|
* RF Reg[30], (1)Xin:[12:9], Xout:[8:5], addr[4:0].
|
||||||
(3)RF signal on/off when calibration[13], default: on, set BIT13=0.
|
* (2)PA Pwr delay timer[15:14], default: 2.4us, set BIT15=0
|
||||||
So we should minus 4 BITs offset. */
|
* (3)RF signal on/off when calibration[13], default: on, set BIT13=0.
|
||||||
|
* So we should minus 4 BITs offset.
|
||||||
|
*/
|
||||||
RF_WriteReg(dev, 0x0f, (priv->XtalCal_Xin<<5) | (priv->XtalCal_Xout<<1) | BIT11 | BIT9); mdelay(1);
|
RF_WriteReg(dev, 0x0f, (priv->XtalCal_Xin<<5) | (priv->XtalCal_Xout<<1) | BIT11 | BIT9); mdelay(1);
|
||||||
printk("ZEBRA_Config_85BASIC_HardCode(): (%02x)\n",
|
printk("ZEBRA_Config_85BASIC_HardCode(): (%02x)\n",
|
||||||
(priv->XtalCal_Xin<<5) | (priv->XtalCal_Xout<<1) | BIT11 | BIT9);
|
(priv->XtalCal_Xin<<5) | (priv->XtalCal_Xout<<1) | BIT11 | BIT9);
|
||||||
|
@ -607,18 +611,18 @@ void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
||||||
write_nic_byte(dev, 0x24E, (u1b24E & (~(BIT5|BIT6))));
|
write_nic_byte(dev, 0x24E, (u1b24E & (~(BIT5|BIT6))));
|
||||||
|
|
||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
|
*
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
CCKCONF.TXT
|
* CCKCONF.TXT
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
*/
|
*
|
||||||
/* [POWER SAVE] Power Saving Parameters by jong. 2007-11-27
|
* [POWER SAVE] Power Saving Parameters by jong. 2007-11-27
|
||||||
CCK reg0x00[7]=1'b1 :power saving for TX (default)
|
* CCK reg0x00[7]=1'b1 :power saving for TX (default)
|
||||||
CCK reg0x00[6]=1'b1: power saving for RX (default)
|
* CCK reg0x00[6]=1'b1: power saving for RX (default)
|
||||||
CCK reg0x06[4]=1'b1: turn off channel estimation related circuits if not doing channel estimation.
|
* CCK reg0x06[4]=1'b1: turn off channel estimation related circuits if not doing channel estimation.
|
||||||
CCK reg0x06[3]=1'b1: turn off unused circuits before cca = 1
|
* CCK reg0x06[3]=1'b1: turn off unused circuits before cca = 1
|
||||||
CCK reg0x06[2]=1'b1: turn off cck's circuit if macrst =0
|
* CCK reg0x06[2]=1'b1: turn off cck's circuit if macrst =0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
write_phy_cck(dev, 0x00, 0xc8);
|
write_phy_cck(dev, 0x00, 0xc8);
|
||||||
write_phy_cck(dev, 0x06, 0x1c);
|
write_phy_cck(dev, 0x06, 0x1c);
|
||||||
|
@ -635,10 +639,10 @@ void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
AGC.txt
|
* AGC.txt
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
write_phy_ofdm(dev, 0x00, 0x12);
|
write_phy_ofdm(dev, 0x00, 0x12);
|
||||||
|
|
||||||
|
@ -660,12 +664,12 @@ void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
||||||
PlatformIOWrite4Byte(dev, PhyAddr, 0x00001080); /* Annie, 2006-05-05 */
|
PlatformIOWrite4Byte(dev, PhyAddr, 0x00001080); /* Annie, 2006-05-05 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
|
*
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
OFDMCONF.TXT
|
* OFDMCONF.TXT
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for (i = 0; i < 60; i++) {
|
for (i = 0; i < 60; i++) {
|
||||||
u4bRegOffset = i;
|
u4bRegOffset = i;
|
||||||
|
@ -678,10 +682,10 @@ void ZEBRA_Config_85BASIC_HardCode(struct net_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
by amy for antenna
|
* by amy for antenna
|
||||||
=============================================================================
|
*===========================================================================
|
||||||
*/
|
*/
|
||||||
/* Config Sw/Hw Combinational Antenna Diversity. Added by Roger, 2008.02.26. */
|
/* Config Sw/Hw Combinational Antenna Diversity. Added by Roger, 2008.02.26. */
|
||||||
SetAntennaConfig87SE(dev, priv->bDefaultAntenna1, priv->bSwAntennaDiverity);
|
SetAntennaConfig87SE(dev, priv->bDefaultAntenna1, priv->bSwAntennaDiverity);
|
||||||
}
|
}
|
||||||
|
@ -694,9 +698,9 @@ void UpdateInitialGain(struct net_device *dev)
|
||||||
/* lzm add 080826 */
|
/* lzm add 080826 */
|
||||||
if (priv->eRFPowerState != eRfOn) {
|
if (priv->eRFPowerState != eRfOn) {
|
||||||
/* Don't access BB/RF under disable PLL situation.
|
/* Don't access BB/RF under disable PLL situation.
|
||||||
RT_TRACE(COMP_DIG, DBG_LOUD, ("UpdateInitialGain - pHalData->eRFPowerState!=eRfOn\n"));
|
* RT_TRACE(COMP_DIG, DBG_LOUD, ("UpdateInitialGain - pHalData->eRFPowerState!=eRfOn\n"));
|
||||||
Back to the original state
|
* Back to the original state
|
||||||
*/
|
*/
|
||||||
priv->InitialGain = priv->InitialGainBackUp;
|
priv->InitialGain = priv->InitialGainBackUp;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -758,10 +762,10 @@ void UpdateInitialGain(struct net_device *dev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Description:
|
* Description:
|
||||||
Tx Power tracking mechanism routine on 87SE.
|
* Tx Power tracking mechanism routine on 87SE.
|
||||||
Created by Roger, 2007.12.11.
|
* Created by Roger, 2007.12.11.
|
||||||
*/
|
*/
|
||||||
void InitTxPwrTracking87SE(struct net_device *dev)
|
void InitTxPwrTracking87SE(struct net_device *dev)
|
||||||
{
|
{
|
||||||
u32 u4bRfReg;
|
u32 u4bRfReg;
|
||||||
|
@ -786,10 +790,10 @@ void PhyConfig8185(struct net_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Enable thermal meter indication to implement TxPower tracking on 87SE.
|
* Enable thermal meter indication to implement TxPower tracking on 87SE.
|
||||||
We initialize thermal meter here to avoid unsuccessful configuration.
|
* We initialize thermal meter here to avoid unsuccessful configuration.
|
||||||
Added by Roger, 2007.12.11.
|
* Added by Roger, 2007.12.11.
|
||||||
*/
|
*/
|
||||||
if (priv->bTxPowerTrack)
|
if (priv->bTxPowerTrack)
|
||||||
InitTxPwrTracking87SE(dev);
|
InitTxPwrTracking87SE(dev);
|
||||||
|
|
||||||
|
@ -858,10 +862,10 @@ void HwConfigureRTL8185(struct net_device *dev)
|
||||||
static void MacConfig_85BASIC_HardCode(struct net_device *dev)
|
static void MacConfig_85BASIC_HardCode(struct net_device *dev)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
============================================================================
|
*==========================================================================
|
||||||
MACREG.TXT
|
* MACREG.TXT
|
||||||
============================================================================
|
*==========================================================================
|
||||||
*/
|
*/
|
||||||
int nLinesRead = 0;
|
int nLinesRead = 0;
|
||||||
u32 u4bRegOffset, u4bRegValue, u4bPageIndex = 0;
|
u32 u4bRegOffset, u4bRegValue, u4bPageIndex = 0;
|
||||||
int i;
|
int i;
|
||||||
|
@ -944,15 +948,15 @@ void ActUpdateChannelAccessSetting(struct net_device *dev,
|
||||||
u8 u1bAIFS;
|
u8 u1bAIFS;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
<RJ_TODO_8185B>
|
* <RJ_TODO_8185B>
|
||||||
TODO: We still don't know how to set up these registers, just follow WMAC to
|
* TODO: We still don't know how to set up these registers, just follow WMAC to
|
||||||
verify 8185B FPAG.
|
* verify 8185B FPAG.
|
||||||
|
*
|
||||||
<RJ_TODO_8185B>
|
* <RJ_TODO_8185B>
|
||||||
Jong said CWmin/CWmax register are not functional in 8185B,
|
* Jong said CWmin/CWmax register are not functional in 8185B,
|
||||||
so we shall fill channel access realted register into AC parameter registers,
|
* so we shall fill channel access realted register into AC parameter registers,
|
||||||
even in nQBss.
|
* even in nQBss.
|
||||||
*/
|
*/
|
||||||
ChnlAccessSetting->SIFS_Timer = 0x22; /* Suggested by Jong, 2005.12.08. */
|
ChnlAccessSetting->SIFS_Timer = 0x22; /* Suggested by Jong, 2005.12.08. */
|
||||||
ChnlAccessSetting->DIFS_Timer = 0x1C; /* 2006.06.02, by rcnjko. */
|
ChnlAccessSetting->DIFS_Timer = 0x1C; /* 2006.06.02, by rcnjko. */
|
||||||
ChnlAccessSetting->SlotTimeTimer = 9; /* 2006.06.02, by rcnjko. */
|
ChnlAccessSetting->SlotTimeTimer = 9; /* 2006.06.02, by rcnjko. */
|
||||||
|
@ -978,9 +982,9 @@ void ActUpdateChannelAccessSetting(struct net_device *dev,
|
||||||
if (bFollowLegacySetting) {
|
if (bFollowLegacySetting) {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Follow 802.11 seeting to AC parameter, all AC shall use the same parameter.
|
* Follow 802.11 seeting to AC parameter, all AC shall use the same parameter.
|
||||||
2005.12.01, by rcnjko.
|
* 2005.12.01, by rcnjko.
|
||||||
*/
|
*/
|
||||||
AcParam.longData = 0;
|
AcParam.longData = 0;
|
||||||
AcParam.f.AciAifsn.f.AIFSN = 2; /* Follow 802.11 DIFS. */
|
AcParam.f.AciAifsn.f.AIFSN = 2; /* Follow 802.11 DIFS. */
|
||||||
AcParam.f.AciAifsn.f.ACM = 0;
|
AcParam.f.AciAifsn.f.ACM = 0;
|
||||||
|
@ -1116,10 +1120,12 @@ void ActSetWirelessMode8185(struct net_device *dev, u8 btWirelessMode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 2. Swtich band: RF or BB specific actions,
|
/*
|
||||||
|
* 2. Swtich band: RF or BB specific actions,
|
||||||
* for example, refresh tables in omc8255, or change initial gain if necessary.
|
* for example, refresh tables in omc8255, or change initial gain if necessary.
|
||||||
* Nothing to do for Zebra to switch band.
|
* Nothing to do for Zebra to switch band.
|
||||||
* Update current wireless mode if we swtich to specified band successfully. */
|
* Update current wireless mode if we swtich to specified band successfully.
|
||||||
|
*/
|
||||||
|
|
||||||
ieee->mode = (WIRELESS_MODE)btWirelessMode;
|
ieee->mode = (WIRELESS_MODE)btWirelessMode;
|
||||||
|
|
||||||
|
@ -1161,13 +1167,14 @@ void MgntDisconnectIBSS(struct net_device *dev)
|
||||||
|
|
||||||
priv->ieee80211->state = IEEE80211_NOLINK;
|
priv->ieee80211->state = IEEE80211_NOLINK;
|
||||||
/*
|
/*
|
||||||
Stop Beacon.
|
* Stop Beacon.
|
||||||
|
*
|
||||||
Vista add a Adhoc profile, HW radio off until OID_DOT11_RESET_REQUEST
|
* Vista add a Adhoc profile, HW radio off until OID_DOT11_RESET_REQUEST
|
||||||
Driver would set MSR=NO_LINK, then HW Radio ON, MgntQueue Stuck.
|
* Driver would set MSR=NO_LINK, then HW Radio ON, MgntQueue Stuck.
|
||||||
Because Bcn DMA isn't complete, mgnt queue would stuck until Bcn packet send.
|
* Because Bcn DMA isn't complete, mgnt queue would stuck until Bcn packet send.
|
||||||
|
*
|
||||||
Disable Beacon Queue Own bit, suggested by jong */
|
* Disable Beacon Queue Own bit, suggested by jong
|
||||||
|
*/
|
||||||
ieee80211_stop_send_beacons(priv->ieee80211);
|
ieee80211_stop_send_beacons(priv->ieee80211);
|
||||||
|
|
||||||
priv->ieee80211->link_change(dev);
|
priv->ieee80211->link_change(dev);
|
||||||
|
@ -1198,13 +1205,14 @@ void MgntDisconnectAP(struct net_device *dev, u8 asRsn)
|
||||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Commented out by rcnjko, 2005.01.27:
|
* Commented out by rcnjko, 2005.01.27:
|
||||||
I move SecClearAllKeys() to MgntActSet_802_11_DISASSOCIATE().
|
* I move SecClearAllKeys() to MgntActSet_802_11_DISASSOCIATE().
|
||||||
|
*
|
||||||
2004/09/15, kcwu, the key should be cleared, or the new handshaking will not success
|
* 2004/09/15, kcwu, the key should be cleared, or the new handshaking will not success
|
||||||
|
*
|
||||||
In WPA WPA2 need to Clear all key ... because new key will set after new handshaking.
|
* In WPA WPA2 need to Clear all key ... because new key will set after new handshaking.
|
||||||
2004.10.11, by rcnjko. */
|
* 2004.10.11, by rcnjko.
|
||||||
|
*/
|
||||||
MlmeDisassociateRequest(dev, priv->ieee80211->current_network.bssid, asRsn);
|
MlmeDisassociateRequest(dev, priv->ieee80211->current_network.bssid, asRsn);
|
||||||
|
|
||||||
priv->ieee80211->state = IEEE80211_NOLINK;
|
priv->ieee80211->state = IEEE80211_NOLINK;
|
||||||
|
@ -1214,8 +1222,8 @@ bool MgntDisconnect(struct net_device *dev, u8 asRsn)
|
||||||
{
|
{
|
||||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||||
/*
|
/*
|
||||||
Schedule an workitem to wake up for ps mode, 070109, by rcnjko.
|
* Schedule an workitem to wake up for ps mode, 070109, by rcnjko.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (IS_DOT11D_ENABLE(priv->ieee80211))
|
if (IS_DOT11D_ENABLE(priv->ieee80211))
|
||||||
Dot11d_Reset(priv->ieee80211);
|
Dot11d_Reset(priv->ieee80211);
|
||||||
|
@ -1225,11 +1233,13 @@ bool MgntDisconnect(struct net_device *dev, u8 asRsn)
|
||||||
MgntDisconnectIBSS(dev);
|
MgntDisconnectIBSS(dev);
|
||||||
|
|
||||||
if (priv->ieee80211->iw_mode == IW_MODE_INFRA) {
|
if (priv->ieee80211->iw_mode == IW_MODE_INFRA) {
|
||||||
/* We clear key here instead of MgntDisconnectAP() because that
|
/*
|
||||||
MgntActSet_802_11_DISASSOCIATE() is an interface called by OS,
|
* We clear key here instead of MgntDisconnectAP() because that
|
||||||
e.g. OID_802_11_DISASSOCIATE in Windows while as MgntDisconnectAP() is
|
* MgntActSet_802_11_DISASSOCIATE() is an interface called by OS,
|
||||||
used to handle disassociation related things to AP, e.g. send Disassoc
|
* e.g. OID_802_11_DISASSOCIATE in Windows while as MgntDisconnectAP() is
|
||||||
frame to AP. 2005.01.27, by rcnjko. */
|
* used to handle disassociation related things to AP, e.g. send Disassoc
|
||||||
|
* frame to AP. 2005.01.27, by rcnjko.
|
||||||
|
*/
|
||||||
MgntDisconnectAP(dev, asRsn);
|
MgntDisconnectAP(dev, asRsn);
|
||||||
}
|
}
|
||||||
/* Inidicate Disconnect, 2005.02.23, by rcnjko. */
|
/* Inidicate Disconnect, 2005.02.23, by rcnjko. */
|
||||||
|
@ -1237,13 +1247,13 @@ bool MgntDisconnect(struct net_device *dev, u8 asRsn)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Description:
|
* Description:
|
||||||
Chang RF Power State.
|
* Chang RF Power State.
|
||||||
Note that, only MgntActSet_RF_State() is allowed to set HW_VAR_RF_STATE.
|
* Note that, only MgntActSet_RF_State() is allowed to set HW_VAR_RF_STATE.
|
||||||
|
*
|
||||||
Assumption:
|
* Assumption:
|
||||||
PASSIVE LEVEL.
|
* PASSIVE LEVEL.
|
||||||
*/
|
*/
|
||||||
bool SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
|
bool SetRFPowerState(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
|
||||||
{
|
{
|
||||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||||
|
@ -1274,9 +1284,9 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u
|
||||||
u16 RFWaitCounter = 0;
|
u16 RFWaitCounter = 0;
|
||||||
unsigned long flag;
|
unsigned long flag;
|
||||||
/*
|
/*
|
||||||
Prevent the race condition of RF state change. By Bruce, 2007-11-28.
|
* Prevent the race condition of RF state change. By Bruce, 2007-11-28.
|
||||||
Only one thread can change the RF state at one time, and others should wait to be executed.
|
* Only one thread can change the RF state at one time, and others should wait to be executed.
|
||||||
*/
|
*/
|
||||||
while (true) {
|
while (true) {
|
||||||
spin_lock_irqsave(&priv->rf_ps_lock, flag);
|
spin_lock_irqsave(&priv->rf_ps_lock, flag);
|
||||||
if (priv->RFChangeInProgress) {
|
if (priv->RFChangeInProgress) {
|
||||||
|
@ -1304,9 +1314,9 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u
|
||||||
switch (StateToSet) {
|
switch (StateToSet) {
|
||||||
case eRfOn:
|
case eRfOn:
|
||||||
/*
|
/*
|
||||||
Turn On RF no matter the IPS setting because we need to update the RF state to Ndis under Vista, or
|
* Turn On RF no matter the IPS setting because we need to update the RF state to Ndis under Vista, or
|
||||||
the Windows does not allow the driver to perform site survey any more. By Bruce, 2007-10-02.
|
* the Windows does not allow the driver to perform site survey any more. By Bruce, 2007-10-02.
|
||||||
*/
|
*/
|
||||||
priv->RfOffReason &= (~ChangeSource);
|
priv->RfOffReason &= (~ChangeSource);
|
||||||
|
|
||||||
if (!priv->RfOffReason) {
|
if (!priv->RfOffReason) {
|
||||||
|
@ -1325,12 +1335,12 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet, u
|
||||||
|
|
||||||
if (priv->RfOffReason > RF_CHANGE_BY_IPS) {
|
if (priv->RfOffReason > RF_CHANGE_BY_IPS) {
|
||||||
/*
|
/*
|
||||||
060808, Annie:
|
* 060808, Annie:
|
||||||
Disconnect to current BSS when radio off. Asked by QuanTa.
|
* Disconnect to current BSS when radio off. Asked by QuanTa.
|
||||||
|
*
|
||||||
Calling MgntDisconnect() instead of MgntActSet_802_11_DISASSOCIATE(),
|
* Calling MgntDisconnect() instead of MgntActSet_802_11_DISASSOCIATE(),
|
||||||
because we do NOT need to set ssid to dummy ones.
|
* because we do NOT need to set ssid to dummy ones.
|
||||||
*/
|
*/
|
||||||
MgntDisconnect(dev, disas_lv_ss);
|
MgntDisconnect(dev, disas_lv_ss);
|
||||||
/* Clear content of bssDesc[] and bssDesc4Query[] to avoid reporting old bss to UI. */
|
/* Clear content of bssDesc[] and bssDesc4Query[] to avoid reporting old bss to UI. */
|
||||||
}
|
}
|
||||||
|
@ -1374,27 +1384,27 @@ void InactivePowerSave(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||||
/*
|
/*
|
||||||
This flag "bSwRfProcessing", indicates the status of IPS procedure, should be set if the IPS workitem
|
* This flag "bSwRfProcessing", indicates the status of IPS procedure, should be set if the IPS workitem
|
||||||
is really scheduled.
|
* is really scheduled.
|
||||||
The old code, sets this flag before scheduling the IPS workitem and however, at the same time the
|
* The old code, sets this flag before scheduling the IPS workitem and however, at the same time the
|
||||||
previous IPS workitem did not end yet, fails to schedule the current workitem. Thus, bSwRfProcessing
|
* previous IPS workitem did not end yet, fails to schedule the current workitem. Thus, bSwRfProcessing
|
||||||
blocks the IPS procedure of switching RF.
|
* blocks the IPS procedure of switching RF.
|
||||||
*/
|
*/
|
||||||
priv->bSwRfProcessing = true;
|
priv->bSwRfProcessing = true;
|
||||||
|
|
||||||
MgntActSet_RF_State(dev, priv->eInactivePowerState, RF_CHANGE_BY_IPS);
|
MgntActSet_RF_State(dev, priv->eInactivePowerState, RF_CHANGE_BY_IPS);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
To solve CAM values miss in RF OFF, rewrite CAM values after RF ON. By Bruce, 2007-09-20.
|
* To solve CAM values miss in RF OFF, rewrite CAM values after RF ON. By Bruce, 2007-09-20.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
priv->bSwRfProcessing = false;
|
priv->bSwRfProcessing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Description:
|
* Description:
|
||||||
Enter the inactive power save mode. RF will be off
|
* Enter the inactive power save mode. RF will be off
|
||||||
*/
|
*/
|
||||||
void IPSEnter(struct net_device *dev)
|
void IPSEnter(struct net_device *dev)
|
||||||
{
|
{
|
||||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||||
|
@ -1403,13 +1413,13 @@ void IPSEnter(struct net_device *dev)
|
||||||
rtState = priv->eRFPowerState;
|
rtState = priv->eRFPowerState;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Do not enter IPS in the following conditions:
|
* Do not enter IPS in the following conditions:
|
||||||
(1) RF is already OFF or Sleep
|
* (1) RF is already OFF or Sleep
|
||||||
(2) bSwRfProcessing (indicates the IPS is still under going)
|
* (2) bSwRfProcessing (indicates the IPS is still under going)
|
||||||
(3) Connectted (only disconnected can trigger IPS)
|
* (3) Connectted (only disconnected can trigger IPS)
|
||||||
(4) IBSS (send Beacon)
|
* (4) IBSS (send Beacon)
|
||||||
(5) AP mode (send Beacon)
|
* (5) AP mode (send Beacon)
|
||||||
*/
|
*/
|
||||||
if (rtState == eRfOn && !priv->bSwRfProcessing
|
if (rtState == eRfOn && !priv->bSwRfProcessing
|
||||||
&& (priv->ieee80211->state != IEEE80211_LINKED)) {
|
&& (priv->ieee80211->state != IEEE80211_LINKED)) {
|
||||||
priv->eInactivePowerState = eRfOff;
|
priv->eInactivePowerState = eRfOff;
|
||||||
|
@ -1463,10 +1473,10 @@ void rtl8185b_adapter_start(struct net_device *dev)
|
||||||
PlatformIOWrite2Byte(dev, RFSW_CTRL, 0x569a);
|
PlatformIOWrite2Byte(dev, RFSW_CTRL, 0x569a);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
-----------------------------------------------------------------------------
|
*---------------------------------------------------------------------------
|
||||||
Set up PHY related.
|
* Set up PHY related.
|
||||||
-----------------------------------------------------------------------------
|
*---------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
/* Enable Config3.PARAM_En to revise AnaaParm. */
|
/* Enable Config3.PARAM_En to revise AnaaParm. */
|
||||||
write_nic_byte(dev, CR9346, 0xc0); /* enable config register write */
|
write_nic_byte(dev, CR9346, 0xc0); /* enable config register write */
|
||||||
tmpu8 = read_nic_byte(dev, CONFIG3);
|
tmpu8 = read_nic_byte(dev, CONFIG3);
|
||||||
|
@ -1505,10 +1515,10 @@ void rtl8185b_adapter_start(struct net_device *dev)
|
||||||
PhyConfig8185(dev);
|
PhyConfig8185(dev);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We assume RegWirelessMode has already been initialized before,
|
* We assume RegWirelessMode has already been initialized before,
|
||||||
however, we has to validate the wireless mode here and provide a
|
* however, we has to validate the wireless mode here and provide a
|
||||||
reasonable initialized value if necessary. 2005.01.13, by rcnjko.
|
* reasonable initialized value if necessary. 2005.01.13, by rcnjko.
|
||||||
*/
|
*/
|
||||||
SupportedWirelessMode = GetSupportedWirelessMode8185(dev);
|
SupportedWirelessMode = GetSupportedWirelessMode8185(dev);
|
||||||
if ((ieee->mode != WIRELESS_MODE_B) &&
|
if ((ieee->mode != WIRELESS_MODE_B) &&
|
||||||
(ieee->mode != WIRELESS_MODE_G) &&
|
(ieee->mode != WIRELESS_MODE_G) &&
|
||||||
|
@ -1554,8 +1564,8 @@ void rtl8185b_adapter_start(struct net_device *dev)
|
||||||
MgntActSet_RF_State(dev, eRfOn, 0);
|
MgntActSet_RF_State(dev, eRfOn, 0);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
If inactive power mode is enabled, disable rf while in disconnected state.
|
* If inactive power mode is enabled, disable rf while in disconnected state.
|
||||||
*/
|
*/
|
||||||
if (priv->bInactivePs)
|
if (priv->bInactivePs)
|
||||||
MgntActSet_RF_State(dev , eRfOff, RF_CHANGE_BY_IPS);
|
MgntActSet_RF_State(dev , eRfOff, RF_CHANGE_BY_IPS);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue