staging: rtl8192e: Fix more checkpatch.pl warnings
v2 cover staging: rtl8192e: Fix more checkpatch.pl warnings
New cleanup patchset for rtl8192e. It fixes (mostly) checkpatch.pl warnings. When applied, checkpatch.pl warning count drops to 34 (from 1111). It should apply cleanly to staging-next/testing (c610f7f7) branches.
Series was smoke tested on rtl8192e card vs staging-next:
- Module load/unload
- Interface up/down
Most of changes are related to checkpatch.pl with the exception of
- bugfix - staging: rtl8192e: Fix DeviceID in rtl8192_pci_findadapter() This is clearly (in my opinion) typo - I checked two rtl8192e cards from different vendors and both had DeviceID == 0x8192.
- Removal of unimplemented/unused iwpriv handlers - they just give false sense of hope to iwpriv user
Additional changes in v2:
- Fix (most) LONG_LINE warnings
- Replace memcpy() with custom macro - later __aligned(2) will be added to structures (where possible) - I prefer not to do this change before I have working hardware. Unfortunantely these cards are grumpy and refuse to enable radio in PC mPCIe slot (even after soldering W_DISABLE override and using two different antenna sets)
- Fix (most) remaining PREFER_PR_LEVEL warnings
Notes from v1:
This series of patches fixes another set of checkpatch.pl warnings.
Most of the patches are trivial, with the exception of #8, #7 and #5; Driver logic should not be affected.
Some of the patches cause LONG_LINE warnings, but fix has to wait until I do more driver refactorings (It's hard to keep line length when variable names have 30 characters).
Mateusz Kulikowski (21):
staging: rtl8192e: Fix SPACE_BEFORE_TAB warnings
staging: rtl8192e: Copy comments from r819XE_phyreg.h to r8192E_phyreg.h
staging: rtl8192e: remove r819xE_phyreg.h
staging: rtl8192e: Fix SPACING errors
staging: rtl8192e: Remove bb tx gains from r8192_priv
staging: rtl8192e: Fix LINE_SPACING warning
staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtllib_parse_info_param()
staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtl_dm.c
staging: rtl8192e: Fix DeviceID in rtl8192_pci_findadapter()
staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned()
staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param()
staging: rtl8192e: replace memcmp() with ether_addr_equal_unaligned()
staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
staging: rtl8192e: Fix LONG_LINE warnings
staging: rtl8192e: Fix LONG_LINE warnings - modify variables
staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param()
staging: rtl8192e: Fix LONG_LINE warnings (conditions)
staging: rtl8192e: fix LONG_LINE warnings - replace ?: expressions
staging: rtl8192e: Fix LONG_LINE in rtllib_parse_mife_generic()
staging: rtl8192e: Fix LONG_LINE in simplify rtl8192_process_phyinfo()
staging: rtl8192e: Remove unimplemented iwpriv handlers
drivers/staging/rtl8192e/dot11d.h | 4 +- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 144 +- .../staging/rtl8192e/rtl8192e/r8192E_firmware.c | 42 +- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 51 +- drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h | 1496 ++++++++++--------- drivers/staging/rtl8192e/rtl8192e/r819xE_phyreg.h | 908 ------------ drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 53 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 10 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 21 +- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 1546 ++++++++------------ drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 9 + drivers/staging/rtl8192e/rtl8192e/rtl_pci.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 89 +- drivers/staging/rtl8192e/rtl819x_BAProc.c | 12 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 3 +- drivers/staging/rtl8192e/rtl819x_TSProc.c | 21 +- drivers/staging/rtl8192e/rtllib.h | 8 +- drivers/staging/rtl8192e/rtllib_crypt.c | 17 +- drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 77 +- drivers/staging/rtl8192e/rtllib_debug.h | 3 +- drivers/staging/rtl8192e/rtllib_rx.c | 797 +++++----- drivers/staging/rtl8192e/rtllib_softmac.c | 360 ++--- drivers/staging/rtl8192e/rtllib_softmac_wx.c | 5 +- drivers/staging/rtl8192e/rtllib_tx.c | 87 +- drivers/staging/rtl8192e/rtllib_wx.c | 4 +- 25 files changed, 2289 insertions(+), 3480 deletions(-) delete mode 100644 drivers/staging/rtl8192e/rtl8192e/r819xE_phyreg.h
Signature · 1 line
1.8.4.1
PATCH v2 1/21 staging: rtl8192e: Fix SPACE_BEFORE_TAB warnings
Reformat r8192E_phyreg.h to make checkpatch happy.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h | 1442 ++++++++++----------- 1 file changed, 721 insertions(+), 721 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h +721 -721
@@ -3,7 +3,7 @@* * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with
@@ -20,48 +20,48 @@#define _R819XU_PHYREG_H -#define RF_DATA 0x1d4 - -#define rPMAC_Reset 0x100 -#define rPMAC_TxStart 0x104 -#define rPMAC_TxLegacySIG 0x108 -#define rPMAC_TxHTSIG1 0x10c -#define rPMAC_TxHTSIG2 0x110 -#define rPMAC_PHYDebug 0x114 -#define rPMAC_TxPacketNum 0x118 -#define rPMAC_TxIdle 0x11c -#define rPMAC_TxMACHeader0 0x120 -#define rPMAC_TxMACHeader1 0x124 -#define rPMAC_TxMACHeader2 0x128 -#define rPMAC_TxMACHeader3 0x12c -#define rPMAC_TxMACHeader4 0x130 -#define rPMAC_TxMACHeader5 0x134 -#define rPMAC_TxDataType 0x138 -#define rPMAC_TxRandomSeed 0x13c -#define rPMAC_CCKPLCPPreamble 0x140 -#define rPMAC_CCKPLCPHeader 0x144 -#define rPMAC_CCKCRC16 0x148 -#define rPMAC_OFDMRxCRC32OK 0x170 -#define rPMAC_OFDMRxCRC32Er 0x174 -#define rPMAC_OFDMRxParityEr 0x178 -#define rPMAC_OFDMRxCRC8Er 0x17c -#define rPMAC_CCKCRxRC16Er 0x180 -#define rPMAC_CCKCRxRC32Er 0x184 -#define rPMAC_CCKCRxRC32OK 0x188 -#define rPMAC_TxStatus 0x18c - -#define MCS_TXAGC 0x340 -#define CCK_TXAGC 0x348 +#define RF_DATA 0x1d4 + +#define rPMAC_Reset 0x100 +#define rPMAC_TxStart 0x104 +#define rPMAC_TxLegacySIG 0x108 +#define rPMAC_TxHTSIG1 0x10c +#define rPMAC_TxHTSIG2 0x110 +#define rPMAC_PHYDebug 0x114 +#define rPMAC_TxPacketNum 0x118 +#define rPMAC_TxIdle 0x11c +#define rPMAC_TxMACHeader0 0x120 +#define rPMAC_TxMACHeader1 0x124 +#define rPMAC_TxMACHeader2 0x128 +#define rPMAC_TxMACHeader3 0x12c +#define rPMAC_TxMACHeader4 0x130 +#define rPMAC_TxMACHeader5 0x134 +#define rPMAC_TxDataType 0x138 +#define rPMAC_TxRandomSeed 0x13c +#define rPMAC_CCKPLCPPreamble 0x140 +#define rPMAC_CCKPLCPHeader 0x144 +#define rPMAC_CCKCRC16 0x148 +#define rPMAC_OFDMRxCRC32OK 0x170 +#define rPMAC_OFDMRxCRC32Er 0x174 +#define rPMAC_OFDMRxParityEr 0x178 +#define rPMAC_OFDMRxCRC8Er 0x17c +#define rPMAC_CCKCRxRC16Er 0x180 +#define rPMAC_CCKCRxRC32Er 0x184 +#define rPMAC_CCKCRxRC32OK 0x188 +#define rPMAC_TxStatus 0x18c + +#define MCS_TXAGC 0x340 +#define CCK_TXAGC 0x348/*---------------------0x400~0x4ff----------------------*/ -#define MacBlkCtrl 0x403 - -#define rFPGA0_RFMOD 0x800 -#define rFPGA0_TxInfo 0x804 -#define rFPGA0_PSDFunction 0x808 -#define rFPGA0_TxGainStage 0x80c -#define rFPGA0_RFTiming1 0x810 -#define rFPGA0_RFTiming2 0x814 +#define MacBlkCtrl 0x403 + +#define rFPGA0_RFMOD 0x800 +#define rFPGA0_TxInfo 0x804 +#define rFPGA0_PSDFunction 0x808 +#define rFPGA0_TxGainStage 0x80c +#define rFPGA0_RFTiming1 0x810 +#define rFPGA0_RFTiming2 0x814#define rFPGA0_XA_HSSIParameter1 0x820#define rFPGA0_XA_HSSIParameter2 0x824#define rFPGA0_XB_HSSIParameter1 0x828
@@ -94,49 +94,49 @@#define rFPGA0_XB_LSSIReadBack 0x8a4#define rFPGA0_XC_LSSIReadBack 0x8a8#define rFPGA0_XD_LSSIReadBack 0x8ac -#define rFPGA0_PSDReport 0x8b4 +#define rFPGA0_PSDReport 0x8b4#define rFPGA0_XAB_RFInterfaceRB 0x8e0#define rFPGA0_XCD_RFInterfaceRB 0x8e4 -#define rFPGA1_RFMOD 0x900 -#define rFPGA1_TxBlock 0x904 -#define rFPGA1_DebugSelect 0x908 -#define rFPGA1_TxInfo 0x90c - -#define rCCK0_System 0xa00 -#define rCCK0_AFESetting 0xa04 -#define rCCK0_CCA 0xa08 -#define rCCK0_RxAGC1 0xa0c -#define rCCK0_RxAGC2 0xa10 -#define rCCK0_RxHP 0xa14 +#define rFPGA1_RFMOD 0x900 +#define rFPGA1_TxBlock 0x904 +#define rFPGA1_DebugSelect 0x908 +#define rFPGA1_TxInfo 0x90c + +#define rCCK0_System 0xa00 +#define rCCK0_AFESetting 0xa04 +#define rCCK0_CCA 0xa08 +#define rCCK0_RxAGC1 0xa0c +#define rCCK0_RxAGC2 0xa10 +#define rCCK0_RxHP 0xa14#define rCCK0_DSPParameter1 0xa18#define rCCK0_DSPParameter2 0xa1c -#define rCCK0_TxFilter1 0xa20 -#define rCCK0_TxFilter2 0xa24 -#define rCCK0_DebugPort 0xa28 +#define rCCK0_TxFilter1 0xa20 +#define rCCK0_TxFilter2 0xa24 +#define rCCK0_DebugPort 0xa28#define rCCK0_FalseAlarmReport 0xa2c -#define rCCK0_TRSSIReport 0xa50 -#define rCCK0_RxReport 0xa54 +#define rCCK0_TRSSIReport 0xa50 +#define rCCK0_RxReport 0xa54#define rCCK0_FACounterLower 0xa5c#define rCCK0_FACounterUpper 0xa58 -#define rOFDM0_LSTF 0xc00 +#define rOFDM0_LSTF 0xc00#define rOFDM0_TRxPathEnable 0xc04 -#define rOFDM0_TRMuxPar 0xc08 -#define rOFDM0_TRSWIsolation 0xc0c -#define rOFDM0_XARxAFE 0xc10 +#define rOFDM0_TRMuxPar 0xc08 +#define rOFDM0_TRSWIsolation 0xc0c +#define rOFDM0_XARxAFE 0xc10#define rOFDM0_XARxIQImbalance 0xc14 -#define rOFDM0_XBRxAFE 0xc18 +#define rOFDM0_XBRxAFE 0xc18#define rOFDM0_XBRxIQImbalance 0xc1c -#define rOFDM0_XCRxAFE 0xc20 +#define rOFDM0_XCRxAFE 0xc20#define rOFDM0_XCRxIQImbalance 0xc24 -#define rOFDM0_XDRxAFE 0xc28 +#define rOFDM0_XDRxAFE 0xc28#define rOFDM0_XDRxIQImbalance 0xc2c -#define rOFDM0_RxDetector1 0xc30 -#define rOFDM0_RxDetector2 0xc34 -#define rOFDM0_RxDetector3 0xc38 -#define rOFDM0_RxDetector4 0xc3c -#define rOFDM0_RxDSP 0xc40 +#define rOFDM0_RxDetector1 0xc30 +#define rOFDM0_RxDetector2 0xc34 +#define rOFDM0_RxDetector3 0xc38 +#define rOFDM0_RxDetector4 0xc3c +#define rOFDM0_RxDSP 0xc40#define rOFDM0_CFOandDAGC 0xc44#define rOFDM0_CCADropThreshold 0xc48#define rOFDM0_ECCAThreshold 0xc4c
@@ -151,702 +151,702 @@#define rOFDM0_AGCParameter1 0xc70#define rOFDM0_AGCParameter2 0xc74#define rOFDM0_AGCRSSITable 0xc78 -#define rOFDM0_HTSTFAGC 0xc7c +#define rOFDM0_HTSTFAGC 0xc7c#define rOFDM0_XATxIQImbalance 0xc80 -#define rOFDM0_XATxAFE 0xc84 +#define rOFDM0_XATxAFE 0xc84#define rOFDM0_XBTxIQImbalance 0xc88 -#define rOFDM0_XBTxAFE 0xc8c +#define rOFDM0_XBTxAFE 0xc8c#define rOFDM0_XCTxIQImbalance 0xc90 -#define rOFDM0_XCTxAFE 0xc94 +#define rOFDM0_XCTxAFE 0xc94#define rOFDM0_XDTxIQImbalance 0xc98 -#define rOFDM0_XDTxAFE 0xc9c +#define rOFDM0_XDTxAFE 0xc9c#define rOFDM0_RxHPParameter 0xce0#define rOFDM0_TxPseudoNoiseWgt 0xce4 -#define rOFDM0_FrameSync 0xcf0 -#define rOFDM0_DFSReport 0xcf4 -#define rOFDM0_TxCoeff1 0xca4 -#define rOFDM0_TxCoeff2 0xca8 -#define rOFDM0_TxCoeff3 0xcac -#define rOFDM0_TxCoeff4 0xcb0 -#define rOFDM0_TxCoeff5 0xcb4 -#define rOFDM0_TxCoeff6 0xcb8 +#define rOFDM0_FrameSync 0xcf0 +#define rOFDM0_DFSReport 0xcf4 +#define rOFDM0_TxCoeff1 0xca4 +#define rOFDM0_TxCoeff2 0xca8 +#define rOFDM0_TxCoeff3 0xcac +#define rOFDM0_TxCoeff4 0xcb0 +#define rOFDM0_TxCoeff5 0xcb4 +#define rOFDM0_TxCoeff6 0xcb8 -#define rOFDM1_LSTF 0xd00 +#define rOFDM1_LSTF 0xd00#define rOFDM1_TRxPathEnable 0xd04 -#define rOFDM1_CFO 0xd08 -#define rOFDM1_CSI1 0xd10 -#define rOFDM1_SBD 0xd14 -#define rOFDM1_CSI2 0xd18 -#define rOFDM1_CFOTracking 0xd2c +#define rOFDM1_CFO 0xd08 +#define rOFDM1_CSI1 0xd10 +#define rOFDM1_SBD 0xd14 +#define rOFDM1_CSI2 0xd18 +#define rOFDM1_CFOTracking 0xd2c#define rOFDM1_TRxMesaure1 0xd34 -#define rOFDM1_IntfDet 0xd3c -#define rOFDM1_PseudoNoiseStateAB 0xd50 -#define rOFDM1_PseudoNoiseStateCD 0xd54 -#define rOFDM1_RxPseudoNoiseWgt 0xd58 -#define rOFDM_PHYCounter1 0xda0 -#define rOFDM_PHYCounter2 0xda4 -#define rOFDM_PHYCounter3 0xda8 -#define rOFDM_ShortCFOAB 0xdac -#define rOFDM_ShortCFOCD 0xdb0 -#define rOFDM_LongCFOAB 0xdb4 -#define rOFDM_LongCFOCD 0xdb8 -#define rOFDM_TailCFOAB 0xdbc -#define rOFDM_TailCFOCD 0xdc0 +#define rOFDM1_IntfDet 0xd3c +#define rOFDM1_PseudoNoiseStateAB 0xd50 +#define rOFDM1_PseudoNoiseStateCD 0xd54 +#define rOFDM1_RxPseudoNoiseWgt 0xd58 +#define rOFDM_PHYCounter1 0xda0 +#define rOFDM_PHYCounter2 0xda4 +#define rOFDM_PHYCounter3 0xda8 +#define rOFDM_ShortCFOAB 0xdac +#define rOFDM_ShortCFOCD 0xdb0 +#define rOFDM_LongCFOAB 0xdb4 +#define rOFDM_LongCFOCD 0xdb8 +#define rOFDM_TailCFOAB 0xdbc +#define rOFDM_TailCFOCD 0xdc0#define rOFDM_PWMeasure1 0xdc4#define rOFDM_PWMeasure2 0xdc8 -#define rOFDM_BWReport 0xdcc -#define rOFDM_AGCReport 0xdd0 -#define rOFDM_RxSNR 0xdd4 -#define rOFDM_RxEVMCSI 0xdd8 -#define rOFDM_SIGReport 0xddc +#define rOFDM_BWReport 0xdcc +#define rOFDM_AGCReport 0xdd0 +#define rOFDM_RxSNR 0xdd4 +#define rOFDM_RxEVMCSI 0xdd8 +#define rOFDM_SIGReport 0xddc -#define rTxAGC_Rate18_06 0xe00 -#define rTxAGC_Rate54_24 0xe04 -#define rTxAGC_CCK_Mcs32 0xe08 -#define rTxAGC_Mcs03_Mcs00 0xe10 -#define rTxAGC_Mcs07_Mcs04 0xe14 -#define rTxAGC_Mcs11_Mcs08 0xe18 -#define rTxAGC_Mcs15_Mcs12 0xe1c +#define rTxAGC_Rate18_06 0xe00 +#define rTxAGC_Rate54_24 0xe04 +#define rTxAGC_CCK_Mcs32 0xe08 +#define rTxAGC_Mcs03_Mcs00 0xe10 +#define rTxAGC_Mcs07_Mcs04 0xe14 +#define rTxAGC_Mcs11_Mcs08 0xe18 +#define rTxAGC_Mcs15_Mcs12 0xe1c#define rZebra1_HSSIEnable 0x0#define rZebra1_TRxEnable1 0x1#define rZebra1_TRxEnable2 0x2 -#define rZebra1_AGC 0x4 +#define rZebra1_AGC 0x4#define rZebra1_ChargePump 0x5 -#define rZebra1_Channel 0x7 -#define rZebra1_TxGain 0x8 -#define rZebra1_TxLPF 0x9 -#define rZebra1_RxLPF 0xb +#define rZebra1_Channel 0x7 +#define rZebra1_TxGain 0x8 +#define rZebra1_TxLPF 0x9 +#define rZebra1_RxLPF 0xb#define rZebra1_RxHPFCorner 0xc -#define rGlobalCtrl 0 -#define rRTL8256_TxLPF 19 -#define rRTL8256_RxLPF 11 +#define rGlobalCtrl 0 +#define rRTL8256_TxLPF 19 +#define rRTL8256_RxLPF 11 -#define rRTL8258_TxLPF 0x11 -#define rRTL8258_RxLPF 0x13 +#define rRTL8258_TxLPF 0x11 +#define rRTL8258_RxLPF 0x13#define rRTL8258_RSSILPF 0xa -#define bBBResetB 0x100 -#define bGlobalResetB 0x200 -#define bOFDMTxStart 0x4 -#define bCCKTxStart 0x8 -#define bCRC32Debug 0x100 -#define bPMACLoopback 0x10 -#define bTxLSIG 0xffffff -#define bOFDMTxRate 0xf -#define bOFDMTxReserved 0x10 -#define bOFDMTxLength 0x1ffe0 -#define bOFDMTxParity 0x20000 -#define bTxHTSIG1 0xffffff -#define bTxHTMCSRate 0x7f -#define bTxHTBW 0x80 -#define bTxHTLength 0xffff00 -#define bTxHTSIG2 0xffffff -#define bTxHTSmoothing 0x1 -#define bTxHTSounding 0x2 -#define bTxHTReserved 0x4 -#define bTxHTAggreation 0x8 -#define bTxHTSTBC 0x30 -#define bTxHTAdvanceCoding 0x40 -#define bTxHTShortGI 0x80 -#define bTxHTNumberHT_LTF 0x300 -#define bTxHTCRC8 0x3fc00 -#define bCounterReset 0x10000 -#define bNumOfOFDMTx 0xffff -#define bNumOfCCKTx 0xffff0000 -#define bTxIdleInterval 0xffff -#define bOFDMService 0xffff0000 -#define bTxMACHeader 0xffffffff -#define bTxDataInit 0xff -#define bTxHTMode 0x100 -#define bTxDataType 0x30000 -#define bTxRandomSeed 0xffffffff -#define bCCKTxPreamble 0x1 -#define bCCKTxSFD 0xffff0000 -#define bCCKTxSIG 0xff -#define bCCKTxService 0xff00 -#define bCCKLengthExt 0x8000 -#define bCCKTxLength 0xffff0000 -#define bCCKTxCRC16 0xffff -#define bCCKTxStatus 0x1 -#define bOFDMTxStatus 0x2 - -#define bRFMOD 0x1 -#define bJapanMode 0x2 -#define bCCKTxSC 0x30 -#define bCCKEn 0x1000000 -#define bOFDMEn 0x2000000 -#define bOFDMRxADCPhase 0x10000 -#define bOFDMTxDACPhase 0x40000 -#define bXATxAGC 0x3f -#define bXBTxAGC 0xf00 -#define bXCTxAGC 0xf000 -#define bXDTxAGC 0xf0000 -#define bPAStart 0xf0000000 -#define bTRStart 0x00f00000 -#define bRFStart 0x0000f000 -#define bBBStart 0x000000f0 -#define bBBCCKStart 0x0000000f -#define bPAEnd 0xf -#define bTREnd 0x0f000000 -#define bRFEnd 0x000f0000 -#define bCCAMask 0x000000f0 -#define bR2RCCAMask 0x00000f00 -#define bHSSI_R2TDelay 0xf8000000 -#define bHSSI_T2RDelay 0xf80000 -#define bContTxHSSI 0x400 -#define bIGFromCCK 0x200 -#define bAGCAddress 0x3f -#define bRxHPTx 0x7000 -#define bRxHPT2R 0x38000 -#define bRxHPCCKIni 0xc0000 -#define bAGCTxCode 0xc00000 -#define bAGCRxCode 0x300000 -#define b3WireDataLength 0x800 -#define b3WireAddressLength 0x400 -#define b3WireRFPowerDown 0x1 -#define b5GPAPEPolarity 0x40000000 -#define b2GPAPEPolarity 0x80000000 -#define bRFSW_TxDefaultAnt 0x3 -#define bRFSW_TxOptionAnt 0x30 -#define bRFSW_RxDefaultAnt 0x300 -#define bRFSW_RxOptionAnt 0x3000 -#define bRFSI_3WireData 0x1 -#define bRFSI_3WireClock 0x2 -#define bRFSI_3WireLoad 0x4 -#define bRFSI_3WireRW 0x8 -#define bRFSI_3Wire 0xf -#define bRFSI_RFENV 0x10 -#define bRFSI_TRSW 0x20 -#define bRFSI_TRSWB 0x40 -#define bRFSI_ANTSW 0x100 -#define bRFSI_ANTSWB 0x200 -#define bRFSI_PAPE 0x400 -#define bRFSI_PAPE5G 0x800 -#define bBandSelect 0x1 -#define bHTSIG2_GI 0x80 -#define bHTSIG2_Smoothing 0x01 -#define bHTSIG2_Sounding 0x02 -#define bHTSIG2_Aggreaton 0x08 -#define bHTSIG2_STBC 0x30 -#define bHTSIG2_AdvCoding 0x40 +#define bBBResetB 0x100 +#define bGlobalResetB 0x200 +#define bOFDMTxStart 0x4 +#define bCCKTxStart 0x8 +#define bCRC32Debug 0x100 +#define bPMACLoopback 0x10 +#define bTxLSIG 0xffffff +#define bOFDMTxRate 0xf +#define bOFDMTxReserved 0x10 +#define bOFDMTxLength 0x1ffe0 +#define bOFDMTxParity 0x20000 +#define bTxHTSIG1 0xffffff +#define bTxHTMCSRate 0x7f +#define bTxHTBW 0x80 +#define bTxHTLength 0xffff00 +#define bTxHTSIG2 0xffffff +#define bTxHTSmoothing 0x1 +#define bTxHTSounding 0x2 +#define bTxHTReserved 0x4 +#define bTxHTAggreation 0x8 +#define bTxHTSTBC 0x30 +#define bTxHTAdvanceCoding 0x40 +#define bTxHTShortGI 0x80 +#define bTxHTNumberHT_LTF 0x300 +#define bTxHTCRC8 0x3fc00 +#define bCounterReset 0x10000 +#define bNumOfOFDMTx 0xffff +#define bNumOfCCKTx 0xffff0000 +#define bTxIdleInterval 0xffff +#define bOFDMService 0xffff0000 +#define bTxMACHeader 0xffffffff +#define bTxDataInit 0xff +#define bTxHTMode 0x100 +#define bTxDataType 0x30000 +#define bTxRandomSeed 0xffffffff +#define bCCKTxPreamble 0x1 +#define bCCKTxSFD 0xffff0000 +#define bCCKTxSIG 0xff +#define bCCKTxService 0xff00 +#define bCCKLengthExt 0x8000 +#define bCCKTxLength 0xffff0000 +#define bCCKTxCRC16 0xffff +#define bCCKTxStatus 0x1 +#define bOFDMTxStatus 0x2 + +#define bRFMOD 0x1 +#define bJapanMode 0x2 +#define bCCKTxSC 0x30 +#define bCCKEn 0x1000000 +#define bOFDMEn 0x2000000 +#define bOFDMRxADCPhase 0x10000 +#define bOFDMTxDACPhase 0x40000 +#define bXATxAGC 0x3f +#define bXBTxAGC 0xf00 +#define bXCTxAGC 0xf000 +#define bXDTxAGC 0xf0000 +#define bPAStart 0xf0000000 +#define bTRStart 0x00f00000 +#define bRFStart 0x0000f000 +#define bBBStart 0x000000f0 +#define bBBCCKStart 0x0000000f +#define bPAEnd 0xf +#define bTREnd 0x0f000000 +#define bRFEnd 0x000f0000 +#define bCCAMask 0x000000f0 +#define bR2RCCAMask 0x00000f00 +#define bHSSI_R2TDelay 0xf8000000 +#define bHSSI_T2RDelay 0xf80000 +#define bContTxHSSI 0x400 +#define bIGFromCCK 0x200 +#define bAGCAddress 0x3f +#define bRxHPTx 0x7000 +#define bRxHPT2R 0x38000 +#define bRxHPCCKIni 0xc0000 +#define bAGCTxCode 0xc00000 +#define bAGCRxCode 0x300000 +#define b3WireDataLength 0x800 +#define b3WireAddressLength 0x400 +#define b3WireRFPowerDown 0x1 +#define b5GPAPEPolarity 0x40000000 +#define b2GPAPEPolarity 0x80000000 +#define bRFSW_TxDefaultAnt 0x3 +#define bRFSW_TxOptionAnt 0x30 +#define bRFSW_RxDefaultAnt 0x300 +#define bRFSW_RxOptionAnt 0x3000 +#define bRFSI_3WireData 0x1 +#define bRFSI_3WireClock 0x2 +#define bRFSI_3WireLoad 0x4 +#define bRFSI_3WireRW 0x8 +#define bRFSI_3Wire 0xf +#define bRFSI_RFENV 0x10 +#define bRFSI_TRSW 0x20 +#define bRFSI_TRSWB 0x40 +#define bRFSI_ANTSW 0x100 +#define bRFSI_ANTSWB 0x200 +#define bRFSI_PAPE 0x400 +#define bRFSI_PAPE5G 0x800 +#define bBandSelect 0x1 +#define bHTSIG2_GI 0x80 +#define bHTSIG2_Smoothing 0x01 +#define bHTSIG2_Sounding 0x02 +#define bHTSIG2_Aggreaton 0x08 +#define bHTSIG2_STBC 0x30 +#define bHTSIG2_AdvCoding 0x40#define bHTSIG2_NumOfHTLTF 0x300 -#define bHTSIG2_CRC8 0x3fc -#define bHTSIG1_MCS 0x7f -#define bHTSIG1_BandWidth 0x80 -#define bHTSIG1_HTLength 0xffff -#define bLSIG_Rate 0xf -#define bLSIG_Reserved 0x10 -#define bLSIG_Length 0x1fffe -#define bLSIG_Parity 0x20 -#define bCCKRxPhase 0x4 -#define bLSSIReadAddress 0x3f000000 -#define bLSSIReadEdge 0x80000000 -#define bLSSIReadBackData 0xfff -#define bLSSIReadOKFlag 0x1000 -#define bCCKSampleRate 0x8 - -#define bRegulator0Standby 0x1 -#define bRegulatorPLLStandby 0x2 -#define bRegulator1Standby 0x4 -#define bPLLPowerUp 0x8 -#define bDPLLPowerUp 0x10 -#define bDA10PowerUp 0x20 -#define bAD7PowerUp 0x200 -#define bDA6PowerUp 0x2000 -#define bXtalPowerUp 0x4000 -#define b40MDClkPowerUP 0x8000 -#define bDA6DebugMode 0x20000 -#define bDA6Swing 0x380000 -#define bADClkPhase 0x4000000 -#define b80MClkDelay 0x18000000 -#define bAFEWatchDogEnable 0x20000000 -#define bXtalCap 0x0f000000 -#define bXtalCap01 0xc0000000 -#define bXtalCap23 0x3 -#define bXtalCap92x 0x0f000000 -#define bIntDifClkEnable 0x400 -#define bExtSigClkEnable 0x800 +#define bHTSIG2_CRC8 0x3fc +#define bHTSIG1_MCS 0x7f +#define bHTSIG1_BandWidth 0x80 +#define bHTSIG1_HTLength 0xffff +#define bLSIG_Rate 0xf +#define bLSIG_Reserved 0x10 +#define bLSIG_Length 0x1fffe +#define bLSIG_Parity 0x20 +#define bCCKRxPhase 0x4 +#define bLSSIReadAddress 0x3f000000 +#define bLSSIReadEdge 0x80000000 +#define bLSSIReadBackData 0xfff +#define bLSSIReadOKFlag 0x1000 +#define bCCKSampleRate 0x8 + +#define bRegulator0Standby 0x1 +#define bRegulatorPLLStandby 0x2 +#define bRegulator1Standby 0x4 +#define bPLLPowerUp 0x8 +#define bDPLLPowerUp 0x10 +#define bDA10PowerUp 0x20 +#define bAD7PowerUp 0x200 +#define bDA6PowerUp 0x2000 +#define bXtalPowerUp 0x4000 +#define b40MDClkPowerUP 0x8000 +#define bDA6DebugMode 0x20000 +#define bDA6Swing 0x380000 +#define bADClkPhase 0x4000000 +#define b80MClkDelay 0x18000000 +#define bAFEWatchDogEnable 0x20000000 +#define bXtalCap 0x0f000000 +#define bXtalCap01 0xc0000000 +#define bXtalCap23 0x3 +#define bXtalCap92x 0x0f000000 +#define bIntDifClkEnable 0x400 +#define bExtSigClkEnable 0x800#define bBandgapMbiasPowerUp 0x10000 -#define bAD11SHGain 0xc0000 -#define bAD11InputRange 0x700000 -#define bAD11OPCurrent 0x3800000 -#define bIPathLoopback 0x4000000 -#define bQPathLoopback 0x8000000 -#define bAFELoopback 0x10000000 -#define bDA10Swing 0x7e0 -#define bDA10Reverse 0x800 -#define bDAClkSource 0x1000 -#define bAD7InputRange 0x6000 -#define bAD7Gain 0x38000 -#define bAD7OutputCMMode 0x40000 -#define bAD7InputCMMode 0x380000 -#define bAD7Current 0xc00000 -#define bRegulatorAdjust 0x7000000 -#define bAD11PowerUpAtTx 0x1 -#define bDA10PSAtTx 0x10 -#define bAD11PowerUpAtRx 0x100 -#define bDA10PSAtRx 0x1000 - -#define bCCKRxAGCFormat 0x200 - -#define bPSDFFTSamplepPoint 0xc000 -#define bPSDAverageNum 0x3000 -#define bIQPathControl 0xc00 -#define bPSDFreq 0x3ff -#define bPSDAntennaPath 0x30 -#define bPSDIQSwitch 0x40 -#define bPSDRxTrigger 0x400000 -#define bPSDTxTrigger 0x80000000 -#define bPSDSineToneScale 0x7f000000 -#define bPSDReport 0xffff - -#define bOFDMTxSC 0x30000000 -#define bCCKTxOn 0x1 -#define bOFDMTxOn 0x2 -#define bDebugPage 0xfff -#define bDebugItem 0xff -#define bAntL 0x10 -#define bAntNonHT 0x100 -#define bAntHT1 0x1000 -#define bAntHT2 0x10000 -#define bAntHT1S1 0x100000 -#define bAntNonHTS1 0x1000000 - -#define bCCKBBMode 0x3 -#define bCCKTxPowerSaving 0x80 -#define bCCKRxPowerSaving 0x40 -#define bCCKSideBand 0x10 -#define bCCKScramble 0x8 -#define bCCKAntDiversity 0x8000 +#define bAD11SHGain 0xc0000 +#define bAD11InputRange 0x700000 +#define bAD11OPCurrent 0x3800000 +#define bIPathLoopback 0x4000000 +#define bQPathLoopback 0x8000000 +#define bAFELoopback 0x10000000 +#define bDA10Swing 0x7e0 +#define bDA10Reverse 0x800 +#define bDAClkSource 0x1000 +#define bAD7InputRange 0x6000 +#define bAD7Gain 0x38000 +#define bAD7OutputCMMode 0x40000 +#define bAD7InputCMMode 0x380000 +#define bAD7Current 0xc00000 +#define bRegulatorAdjust 0x7000000 +#define bAD11PowerUpAtTx 0x1 +#define bDA10PSAtTx 0x10 +#define bAD11PowerUpAtRx 0x100 +#define bDA10PSAtRx 0x1000 + +#define bCCKRxAGCFormat 0x200 + +#define bPSDFFTSamplepPoint 0xc000 +#define bPSDAverageNum 0x3000 +#define bIQPathControl 0xc00 +#define bPSDFreq 0x3ff +#define bPSDAntennaPath 0x30 +#define bPSDIQSwitch 0x40 +#define bPSDRxTrigger 0x400000 +#define bPSDTxTrigger 0x80000000 +#define bPSDSineToneScale 0x7f000000 +#define bPSDReport 0xffff + +#define bOFDMTxSC 0x30000000 +#define bCCKTxOn 0x1 +#define bOFDMTxOn 0x2 +#define bDebugPage 0xfff +#define bDebugItem 0xff +#define bAntL 0x10 +#define bAntNonHT 0x100 +#define bAntHT1 0x1000 +#define bAntHT2 0x10000 +#define bAntHT1S1 0x100000 +#define bAntNonHTS1 0x1000000 + +#define bCCKBBMode 0x3 +#define bCCKTxPowerSaving 0x80 +#define bCCKRxPowerSaving 0x40 +#define bCCKSideBand 0x10 +#define bCCKScramble 0x8 +#define bCCKAntDiversity 0x8000#define bCCKCarrierRecovery 0x4000 -#define bCCKTxRate 0x3000 -#define bCCKDCCancel 0x0800 -#define bCCKISICancel 0x0400 -#define bCCKMatchFilter 0x0200 -#define bCCKEqualizer 0x0100 -#define bCCKPreambleDetect 0x800000 -#define bCCKFastFalseCCA 0x400000 -#define bCCKChEstStart 0x300000 -#define bCCKCCACount 0x080000 -#define bCCKcs_lim 0x070000 -#define bCCKBistMode 0x80000000 -#define bCCKCCAMask 0x40000000 +#define bCCKTxRate 0x3000 +#define bCCKDCCancel 0x0800 +#define bCCKISICancel 0x0400 +#define bCCKMatchFilter 0x0200 +#define bCCKEqualizer 0x0100 +#define bCCKPreambleDetect 0x800000 +#define bCCKFastFalseCCA 0x400000 +#define bCCKChEstStart 0x300000 +#define bCCKCCACount 0x080000 +#define bCCKcs_lim 0x070000 +#define bCCKBistMode 0x80000000 +#define bCCKCCAMask 0x40000000#define bCCKTxDACPhase 0x4#define bCCKRxADCPhase 0x20000000#define bCCKr_cp_mode0 0x0100 -#define bCCKTxDCOffset 0xf0 -#define bCCKRxDCOffset 0xf -#define bCCKCCAMode 0xc000 -#define bCCKFalseCS_lim 0x3f00 -#define bCCKCS_ratio 0xc00000 -#define bCCKCorgBit_sel 0x300000 -#define bCCKPD_lim 0x0f0000 -#define bCCKNewCCA 0x80000000 -#define bCCKRxHPofIG 0x8000 -#define bCCKRxIG 0x7f00 -#define bCCKLNAPolarity 0x800000 -#define bCCKRx1stGain 0x7f0000 -#define bCCKRFExtend 0x20000000 -#define bCCKRxAGCSatLevel 0x1f000000 -#define bCCKRxAGCSatCount 0xe0 -#define bCCKRxRFSettle 0x1f -#define bCCKFixedRxAGC 0x8000 -#define bCCKAntennaPolarity 0x2000 -#define bCCKTxFilterType 0x0c00 +#define bCCKTxDCOffset 0xf0 +#define bCCKRxDCOffset 0xf +#define bCCKCCAMode 0xc000 +#define bCCKFalseCS_lim 0x3f00 +#define bCCKCS_ratio 0xc00000 +#define bCCKCorgBit_sel 0x300000 +#define bCCKPD_lim 0x0f0000 +#define bCCKNewCCA 0x80000000 +#define bCCKRxHPofIG 0x8000 +#define bCCKRxIG 0x7f00 +#define bCCKLNAPolarity 0x800000 +#define bCCKRx1stGain 0x7f0000 +#define bCCKRFExtend 0x20000000 +#define bCCKRxAGCSatLevel 0x1f000000 +#define bCCKRxAGCSatCount 0xe0 +#define bCCKRxRFSettle 0x1f +#define bCCKFixedRxAGC 0x8000 +#define bCCKAntennaPolarity 0x2000 +#define bCCKTxFilterType 0x0c00#define bCCKRxAGCReportType 0x0300 -#define bCCKRxDAGCEn 0x80000000 -#define bCCKRxDAGCPeriod 0x20000000 +#define bCCKRxDAGCEn 0x80000000 +#define bCCKRxDAGCPeriod 0x20000000#define bCCKRxDAGCSatLevel 0x1f000000 -#define bCCKTimingRecovery 0x800000 -#define bCCKTxC0 0x3f0000 -#define bCCKTxC1 0x3f000000 -#define bCCKTxC2 0x3f -#define bCCKTxC3 0x3f00 -#define bCCKTxC4 0x3f0000 -#define bCCKTxC5 0x3f000000 -#define bCCKTxC6 0x3f -#define bCCKTxC7 0x3f00 -#define bCCKDebugPort 0xff0000 -#define bCCKDACDebug 0x0f000000 -#define bCCKFalseAlarmEnable 0x8000 -#define bCCKFalseAlarmRead 0x4000 -#define bCCKTRSSI 0x7f -#define bCCKRxAGCReport 0xfe -#define bCCKRxReport_AntSel 0x80000000 -#define bCCKRxReport_MFOff 0x40000000 +#define bCCKTimingRecovery 0x800000 +#define bCCKTxC0 0x3f0000 +#define bCCKTxC1 0x3f000000 +#define bCCKTxC2 0x3f +#define bCCKTxC3 0x3f00 +#define bCCKTxC4 0x3f0000 +#define bCCKTxC5 0x3f000000 +#define bCCKTxC6 0x3f +#define bCCKTxC7 0x3f00 +#define bCCKDebugPort 0xff0000 +#define bCCKDACDebug 0x0f000000 +#define bCCKFalseAlarmEnable 0x8000 +#define bCCKFalseAlarmRead 0x4000 +#define bCCKTRSSI 0x7f +#define bCCKRxAGCReport 0xfe +#define bCCKRxReport_AntSel 0x80000000 +#define bCCKRxReport_MFOff 0x40000000#define bCCKRxRxReport_SQLoss 0x20000000 -#define bCCKRxReport_Pktloss 0x10000000 +#define bCCKRxReport_Pktloss 0x10000000#define bCCKRxReport_Lockedbit 0x08000000#define bCCKRxReport_RateError 0x04000000 -#define bCCKRxReport_RxRate 0x03000000 +#define bCCKRxReport_RxRate 0x03000000#define bCCKRxFACounterLower 0xff#define bCCKRxFACounterUpper 0xff000000 -#define bCCKRxHPAGCStart 0xe000 -#define bCCKRxHPAGCFinal 0x1c00 +#define bCCKRxHPAGCStart 0xe000 +#define bCCKRxHPAGCFinal 0x1c00#define bCCKRxFalseAlarmEnable 0x8000 -#define bCCKFACounterFreeze 0x4000 - -#define bCCKTxPathSel 0x10000000 -#define bCCKDefaultRxPath 0xc000000 -#define bCCKOptionRxPath 0x3000000 - -#define bNumOfSTF 0x3 -#define bShift_L 0xc0 -#define bGI_TH 0xc -#define bRxPathA 0x1 -#define bRxPathB 0x2 -#define bRxPathC 0x4 -#define bRxPathD 0x8 -#define bTxPathA 0x1 -#define bTxPathB 0x2 -#define bTxPathC 0x4 -#define bTxPathD 0x8 -#define bTRSSIFreq 0x200 -#define bADCBackoff 0x3000 -#define bDFIRBackoff 0xc000 -#define bTRSSILatchPhase 0x10000 -#define bRxIDCOffset 0xff -#define bRxQDCOffset 0xff00 -#define bRxDFIRMode 0x1800000 -#define bRxDCNFType 0xe000000 -#define bRXIQImb_A 0x3ff -#define bRXIQImb_B 0xfc00 -#define bRXIQImb_C 0x3f0000 -#define bRXIQImb_D 0xffc00000 -#define bDC_dc_Notch 0x60000 -#define bRxNBINotch 0x1f000000 -#define bPD_TH 0xf -#define bPD_TH_Opt2 0xc000 -#define bPWED_TH 0x700 -#define bIfMF_Win_L 0x800 -#define bPD_Option 0x1000 -#define bMF_Win_L 0xe000 -#define bBW_Search_L 0x30000 -#define bwin_enh_L 0xc0000 -#define bBW_TH 0x700000 -#define bED_TH2 0x3800000 -#define bBW_option 0x4000000 -#define bRatio_TH 0x18000000 -#define bWindow_L 0xe0000000 -#define bSBD_Option 0x1 -#define bFrame_TH 0x1c -#define bFS_Option 0x60 -#define bDC_Slope_check 0x80 -#define bFGuard_Counter_DC_L 0xe00 -#define bFrame_Weight_Short 0x7000 -#define bSub_Tune 0xe00000 -#define bFrame_DC_Length 0xe000000 -#define bSBD_start_offset 0x30000000 -#define bFrame_TH_2 0x7 -#define bFrame_GI2_TH 0x38 -#define bGI2_Sync_en 0x40 -#define bSarch_Short_Early 0x300 -#define bSarch_Short_Late 0xc00 -#define bSarch_GI2_Late 0x70000 -#define bCFOAntSum 0x1 -#define bCFOAcc 0x2 -#define bCFOStartOffset 0xc -#define bCFOLookBack 0x70 -#define bCFOSumWeight 0x80 -#define bDAGCEnable 0x10000 -#define bTXIQImb_A 0x3ff -#define bTXIQImb_B 0xfc00 -#define bTXIQImb_C 0x3f0000 -#define bTXIQImb_D 0xffc00000 -#define bTxIDCOffset 0xff -#define bTxQDCOffset 0xff00 -#define bTxDFIRMode 0x10000 -#define bTxPesudoNoiseOn 0x4000000 -#define bTxPesudoNoise_A 0xff -#define bTxPesudoNoise_B 0xff00 -#define bTxPesudoNoise_C 0xff0000 -#define bTxPesudoNoise_D 0xff000000 -#define bCCADropOption 0x20000 -#define bCCADropThres 0xfff00000 -#define bEDCCA_H 0xf -#define bEDCCA_L 0xf0 -#define bLambda_ED 0x300 -#define bRxInitialGain 0x7f -#define bRxAntDivEn 0x80 -#define bRxAGCAddressForLNA 0x7f00 -#define bRxHighPowerFlow 0x8000 -#define bRxAGCFreezeThres 0xc0000 -#define bRxFreezeStep_AGC1 0x300000 -#define bRxFreezeStep_AGC2 0xc00000 -#define bRxFreezeStep_AGC3 0x3000000 -#define bRxFreezeStep_AGC0 0xc000000 -#define bRxRssi_Cmp_En 0x10000000 -#define bRxQuickAGCEn 0x20000000 -#define bRxAGCFreezeThresMode 0x40000000 -#define bRxOverFlowCheckType 0x80000000 -#define bRxAGCShift 0x7f -#define bTRSW_Tri_Only 0x80 -#define bPowerThres 0x300 -#define bRxAGCEn 0x1 -#define bRxAGCTogetherEn 0x2 -#define bRxAGCMin 0x4 -#define bRxHP_Ini 0x7 -#define bRxHP_TRLNA 0x70 -#define bRxHP_RSSI 0x700 -#define bRxHP_BBP1 0x7000 -#define bRxHP_BBP2 0x70000 -#define bRxHP_BBP3 0x700000 -#define bRSSI_H 0x7f0000 -#define bRSSI_Gen 0x7f000000 -#define bRxSettle_TRSW 0x7 -#define bRxSettle_LNA 0x38 -#define bRxSettle_RSSI 0x1c0 -#define bRxSettle_BBP 0xe00 -#define bRxSettle_RxHP 0x7000 -#define bRxSettle_AntSW_RSSI 0x38000 -#define bRxSettle_AntSW 0xc0000 -#define bRxProcessTime_DAGC 0x300000 -#define bRxSettle_HSSI 0x400000 -#define bRxProcessTime_BBPPW 0x800000 -#define bRxAntennaPowerShift 0x3000000 -#define bRSSITableSelect 0xc000000 -#define bRxHP_Final 0x7000000 -#define bRxHTSettle_BBP 0x7 -#define bRxHTSettle_HSSI 0x8 -#define bRxHTSettle_RxHP 0x70 -#define bRxHTSettle_BBPPW 0x80 -#define bRxHTSettle_Idle 0x300 -#define bRxHTSettle_Reserved 0x1c00 -#define bRxHTRxHPEn 0x8000 -#define bRxHTAGCFreezeThres 0x30000 -#define bRxHTAGCTogetherEn 0x40000 -#define bRxHTAGCMin 0x80000 -#define bRxHTAGCEn 0x100000 -#define bRxHTDAGCEn 0x200000 -#define bRxHTRxHP_BBP 0x1c00000 -#define bRxHTRxHP_Final 0xe0000000 -#define bRxPWRatioTH 0x3 -#define bRxPWRatioEn 0x4 -#define bRxMFHold 0x3800 -#define bRxPD_Delay_TH1 0x38 -#define bRxPD_Delay_TH2 0x1c0 -#define bRxPD_DC_COUNT_MAX 0x600 -#define bRxPD_Delay_TH 0x8000 -#define bRxProcess_Delay 0xf0000 -#define bRxSearchrange_GI2_Early 0x700000 -#define bRxFrame_Guard_Counter_L 0x3800000 -#define bRxSGI_Guard_L 0xc000000 -#define bRxSGI_Search_L 0x30000000 -#define bRxSGI_TH 0xc0000000 -#define bDFSCnt0 0xff -#define bDFSCnt1 0xff00 -#define bDFSFlag 0xf0000 - -#define bMFWeightSum 0x300000 -#define bMinIdxTH 0x7f000000 - -#define bDAFormat 0x40000 - -#define bTxChEmuEnable 0x01000000 - -#define bTRSWIsolation_A 0x7f -#define bTRSWIsolation_B 0x7f00 -#define bTRSWIsolation_C 0x7f0000 -#define bTRSWIsolation_D 0x7f000000 - -#define bExtLNAGain 0x7c00 - -#define bSTBCEn 0x4 -#define bAntennaMapping 0x10 -#define bNss 0x20 -#define bCFOAntSumD 0x200 -#define bPHYCounterReset 0x8000000 -#define bCFOReportGet 0x4000000 -#define bOFDMContinueTx 0x10000000 -#define bOFDMSingleCarrier 0x20000000 -#define bOFDMSingleTone 0x40000000 -#define bHTDetect 0x100 -#define bCFOEn 0x10000 -#define bCFOValue 0xfff00000 -#define bSigTone_Re 0x3f -#define bSigTone_Im 0x7f00 -#define bCounter_CCA 0xffff -#define bCounter_ParityFail 0xffff0000 -#define bCounter_RateIllegal 0xffff -#define bCounter_CRC8Fail 0xffff0000 -#define bCounter_MCSNoSupport 0xffff -#define bCounter_FastSync 0xffff -#define bShortCFO 0xfff -#define bShortCFOTLength 12 -#define bShortCFOFLength 11 -#define bLongCFO 0x7ff -#define bLongCFOTLength 11 -#define bLongCFOFLength 11 -#define bTailCFO 0x1fff -#define bTailCFOTLength 13 -#define bTailCFOFLength 12 - -#define bmax_en_pwdB 0xffff -#define bCC_power_dB 0xffff0000 -#define bnoise_pwdB 0xffff -#define bPowerMeasTLength 10 -#define bPowerMeasFLength 3 -#define bRx_HT_BW 0x1 -#define bRxSC 0x6 -#define bRx_HT 0x8 - -#define bNB_intf_det_on 0x1 -#define bIntf_win_len_cfg 0x30 -#define bNB_Intf_TH_cfg 0x1c0 - -#define bRFGain 0x3f -#define bTableSel 0x40 -#define bTRSW 0x80 - -#define bRxSNR_A 0xff -#define bRxSNR_B 0xff00 -#define bRxSNR_C 0xff0000 -#define bRxSNR_D 0xff000000 -#define bSNREVMTLength 8 -#define bSNREVMFLength 1 - -#define bCSI1st 0xff -#define bCSI2nd 0xff00 -#define bRxEVM1st 0xff0000 -#define bRxEVM2nd 0xff000000 - -#define bSIGEVM 0xff -#define bPWDB 0xff00 -#define bSGIEN 0x10000 - -#define bSFactorQAM1 0xf -#define bSFactorQAM2 0xf0 -#define bSFactorQAM3 0xf00 -#define bSFactorQAM4 0xf000 -#define bSFactorQAM5 0xf0000 -#define bSFactorQAM6 0xf0000 -#define bSFactorQAM7 0xf00000 -#define bSFactorQAM8 0xf000000 -#define bSFactorQAM9 0xf0000000 -#define bCSIScheme 0x100000 - -#define bNoiseLvlTopSet 0x3 -#define bChSmooth 0x4 -#define bChSmoothCfg1 0x38 -#define bChSmoothCfg2 0x1c0 -#define bChSmoothCfg3 0xe00 -#define bChSmoothCfg4 0x7000 -#define bMRCMode 0x800000 -#define bTHEVMCfg 0x7000000 - -#define bLoopFitType 0x1 -#define bUpdCFO 0x40 -#define bUpdCFOOffData 0x80 -#define bAdvUpdCFO 0x100 -#define bAdvTimeCtrl 0x800 -#define bUpdClko 0x1000 -#define bFC 0x6000 -#define bTrackingMode 0x8000 -#define bPhCmpEnable 0x10000 -#define bUpdClkoLTF 0x20000 -#define bComChCFO 0x40000 -#define bCSIEstiMode 0x80000 -#define bAdvUpdEqz 0x100000 -#define bUChCfg 0x7000000 -#define bUpdEqz 0x8000000 - -#define bTxAGCRate18_06 0x7f7f7f7f -#define bTxAGCRate54_24 0x7f7f7f7f +#define bCCKFACounterFreeze 0x4000 + +#define bCCKTxPathSel 0x10000000 +#define bCCKDefaultRxPath 0xc000000 +#define bCCKOptionRxPath 0x3000000 + +#define bNumOfSTF 0x3 +#define bShift_L 0xc0 +#define bGI_TH 0xc +#define bRxPathA 0x1 +#define bRxPathB 0x2 +#define bRxPathC 0x4 +#define bRxPathD 0x8 +#define bTxPathA 0x1 +#define bTxPathB 0x2 +#define bTxPathC 0x4 +#define bTxPathD 0x8 +#define bTRSSIFreq 0x200 +#define bADCBackoff 0x3000 +#define bDFIRBackoff 0xc000 +#define bTRSSILatchPhase 0x10000 +#define bRxIDCOffset 0xff +#define bRxQDCOffset 0xff00 +#define bRxDFIRMode 0x1800000 +#define bRxDCNFType 0xe000000 +#define bRXIQImb_A 0x3ff +#define bRXIQImb_B 0xfc00 +#define bRXIQImb_C 0x3f0000 +#define bRXIQImb_D 0xffc00000 +#define bDC_dc_Notch 0x60000 +#define bRxNBINotch 0x1f000000 +#define bPD_TH 0xf +#define bPD_TH_Opt2 0xc000 +#define bPWED_TH 0x700 +#define bIfMF_Win_L 0x800 +#define bPD_Option 0x1000 +#define bMF_Win_L 0xe000 +#define bBW_Search_L 0x30000 +#define bwin_enh_L 0xc0000 +#define bBW_TH 0x700000 +#define bED_TH2 0x3800000 +#define bBW_option 0x4000000 +#define bRatio_TH 0x18000000 +#define bWindow_L 0xe0000000 +#define bSBD_Option 0x1 +#define bFrame_TH 0x1c +#define bFS_Option 0x60 +#define bDC_Slope_check 0x80 +#define bFGuard_Counter_DC_L 0xe00 +#define bFrame_Weight_Short 0x7000 +#define bSub_Tune 0xe00000 +#define bFrame_DC_Length 0xe000000 +#define bSBD_start_offset 0x30000000 +#define bFrame_TH_2 0x7 +#define bFrame_GI2_TH 0x38 +#define bGI2_Sync_en 0x40 +#define bSarch_Short_Early 0x300 +#define bSarch_Short_Late 0xc00 +#define bSarch_GI2_Late 0x70000 +#define bCFOAntSum 0x1 +#define bCFOAcc 0x2 +#define bCFOStartOffset 0xc +#define bCFOLookBack 0x70 +#define bCFOSumWeight 0x80 +#define bDAGCEnable 0x10000 +#define bTXIQImb_A 0x3ff +#define bTXIQImb_B 0xfc00 +#define bTXIQImb_C 0x3f0000 +#define bTXIQImb_D 0xffc00000 +#define bTxIDCOffset 0xff +#define bTxQDCOffset 0xff00 +#define bTxDFIRMode 0x10000 +#define bTxPesudoNoiseOn 0x4000000 +#define bTxPesudoNoise_A 0xff +#define bTxPesudoNoise_B 0xff00 +#define bTxPesudoNoise_C 0xff0000 +#define bTxPesudoNoise_D 0xff000000 +#define bCCADropOption 0x20000 +#define bCCADropThres 0xfff00000 +#define bEDCCA_H 0xf +#define bEDCCA_L 0xf0 +#define bLambda_ED 0x300 +#define bRxInitialGain 0x7f +#define bRxAntDivEn 0x80 +#define bRxAGCAddressForLNA 0x7f00 +#define bRxHighPowerFlow 0x8000 +#define bRxAGCFreezeThres 0xc0000 +#define bRxFreezeStep_AGC1 0x300000 +#define bRxFreezeStep_AGC2 0xc00000 +#define bRxFreezeStep_AGC3 0x3000000 +#define bRxFreezeStep_AGC0 0xc000000 +#define bRxRssi_Cmp_En 0x10000000 +#define bRxQuickAGCEn 0x20000000 +#define bRxAGCFreezeThresMode 0x40000000 +#define bRxOverFlowCheckType 0x80000000 +#define bRxAGCShift 0x7f +#define bTRSW_Tri_Only 0x80 +#define bPowerThres 0x300 +#define bRxAGCEn 0x1 +#define bRxAGCTogetherEn 0x2 +#define bRxAGCMin 0x4 +#define bRxHP_Ini 0x7 +#define bRxHP_TRLNA 0x70 +#define bRxHP_RSSI 0x700 +#define bRxHP_BBP1 0x7000 +#define bRxHP_BBP2 0x70000 +#define bRxHP_BBP3 0x700000 +#define bRSSI_H 0x7f0000 +#define bRSSI_Gen 0x7f000000 +#define bRxSettle_TRSW 0x7 +#define bRxSettle_LNA 0x38 +#define bRxSettle_RSSI 0x1c0 +#define bRxSettle_BBP 0xe00 +#define bRxSettle_RxHP 0x7000 +#define bRxSettle_AntSW_RSSI 0x38000 +#define bRxSettle_AntSW 0xc0000 +#define bRxProcessTime_DAGC 0x300000 +#define bRxSettle_HSSI 0x400000 +#define bRxProcessTime_BBPPW 0x800000 +#define bRxAntennaPowerShift 0x3000000 +#define bRSSITableSelect 0xc000000 +#define bRxHP_Final 0x7000000 +#define bRxHTSettle_BBP 0x7 +#define bRxHTSettle_HSSI 0x8 +#define bRxHTSettle_RxHP 0x70 +#define bRxHTSettle_BBPPW 0x80 +#define bRxHTSettle_Idle 0x300 +#define bRxHTSettle_Reserved 0x1c00 +#define bRxHTRxHPEn 0x8000 +#define bRxHTAGCFreezeThres 0x30000 +#define bRxHTAGCTogetherEn 0x40000 +#define bRxHTAGCMin 0x80000 +#define bRxHTAGCEn 0x100000 +#define bRxHTDAGCEn 0x200000 +#define bRxHTRxHP_BBP 0x1c00000 +#define bRxHTRxHP_Final 0xe0000000 +#define bRxPWRatioTH 0x3 +#define bRxPWRatioEn 0x4 +#define bRxMFHold 0x3800 +#define bRxPD_Delay_TH1 0x38 +#define bRxPD_Delay_TH2 0x1c0 +#define bRxPD_DC_COUNT_MAX 0x600 +#define bRxPD_Delay_TH 0x8000 +#define bRxProcess_Delay 0xf0000 +#define bRxSearchrange_GI2_Early 0x700000 +#define bRxFrame_Guard_Counter_L 0x3800000 +#define bRxSGI_Guard_L 0xc000000 +#define bRxSGI_Search_L 0x30000000 +#define bRxSGI_TH 0xc0000000 +#define bDFSCnt0 0xff +#define bDFSCnt1 0xff00 +#define bDFSFlag 0xf0000 + +#define bMFWeightSum 0x300000 +#define bMinIdxTH 0x7f000000 + +#define bDAFormat 0x40000 + +#define bTxChEmuEnable 0x01000000 + +#define bTRSWIsolation_A 0x7f +#define bTRSWIsolation_B 0x7f00 +#define bTRSWIsolation_C 0x7f0000 +#define bTRSWIsolation_D 0x7f000000 + +#define bExtLNAGain 0x7c00 + +#define bSTBCEn 0x4 +#define bAntennaMapping 0x10 +#define bNss 0x20 +#define bCFOAntSumD 0x200 +#define bPHYCounterReset 0x8000000 +#define bCFOReportGet 0x4000000 +#define bOFDMContinueTx 0x10000000 +#define bOFDMSingleCarrier 0x20000000 +#define bOFDMSingleTone 0x40000000 +#define bHTDetect 0x100 +#define bCFOEn 0x10000 +#define bCFOValue 0xfff00000 +#define bSigTone_Re 0x3f +#define bSigTone_Im 0x7f00 +#define bCounter_CCA 0xffff +#define bCounter_ParityFail 0xffff0000 +#define bCounter_RateIllegal 0xffff +#define bCounter_CRC8Fail 0xffff0000 +#define bCounter_MCSNoSupport 0xffff +#define bCounter_FastSync 0xffff +#define bShortCFO 0xfff +#define bShortCFOTLength 12 +#define bShortCFOFLength 11 +#define bLongCFO 0x7ff +#define bLongCFOTLength 11 +#define bLongCFOFLength 11 +#define bTailCFO 0x1fff +#define bTailCFOTLength 13 +#define bTailCFOFLength 12 + +#define bmax_en_pwdB 0xffff +#define bCC_power_dB 0xffff0000 +#define bnoise_pwdB 0xffff +#define bPowerMeasTLength 10 +#define bPowerMeasFLength 3 +#define bRx_HT_BW 0x1 +#define bRxSC 0x6 +#define bRx_HT 0x8 + +#define bNB_intf_det_on 0x1 +#define bIntf_win_len_cfg 0x30 +#define bNB_Intf_TH_cfg 0x1c0 + +#define bRFGain 0x3f +#define bTableSel 0x40 +#define bTRSW 0x80 + +#define bRxSNR_A 0xff +#define bRxSNR_B 0xff00 +#define bRxSNR_C 0xff0000 +#define bRxSNR_D 0xff000000 +#define bSNREVMTLength 8 +#define bSNREVMFLength 1 + +#define bCSI1st 0xff +#define bCSI2nd 0xff00 +#define bRxEVM1st 0xff0000 +#define bRxEVM2nd 0xff000000 + +#define bSIGEVM 0xff +#define bPWDB 0xff00 +#define bSGIEN 0x10000 + +#define bSFactorQAM1 0xf +#define bSFactorQAM2 0xf0 +#define bSFactorQAM3 0xf00 +#define bSFactorQAM4 0xf000 +#define bSFactorQAM5 0xf0000 +#define bSFactorQAM6 0xf0000 +#define bSFactorQAM7 0xf00000 +#define bSFactorQAM8 0xf000000 +#define bSFactorQAM9 0xf0000000 +#define bCSIScheme 0x100000 + +#define bNoiseLvlTopSet 0x3 +#define bChSmooth 0x4 +#define bChSmoothCfg1 0x38 +#define bChSmoothCfg2 0x1c0 +#define bChSmoothCfg3 0xe00 +#define bChSmoothCfg4 0x7000 +#define bMRCMode 0x800000 +#define bTHEVMCfg 0x7000000 + +#define bLoopFitType 0x1 +#define bUpdCFO 0x40 +#define bUpdCFOOffData 0x80 +#define bAdvUpdCFO 0x100 +#define bAdvTimeCtrl 0x800 +#define bUpdClko 0x1000 +#define bFC 0x6000 +#define bTrackingMode 0x8000 +#define bPhCmpEnable 0x10000 +#define bUpdClkoLTF 0x20000 +#define bComChCFO 0x40000 +#define bCSIEstiMode 0x80000 +#define bAdvUpdEqz 0x100000 +#define bUChCfg 0x7000000 +#define bUpdEqz 0x8000000 + +#define bTxAGCRate18_06 0x7f7f7f7f +#define bTxAGCRate54_24 0x7f7f7f7f#define bTxAGCRateMCS32 0x7f -#define bTxAGCRateCCK 0x7f00 +#define bTxAGCRateCCK 0x7f00#define bTxAGCRateMCS3_MCS0 0x7f7f7f7f#define bTxAGCRateMCS7_MCS4 0x7f7f7f7f#define bTxAGCRateMCS11_MCS8 0x7f7f7f7f#define bTxAGCRateMCS15_MCS12 0x7f7f7f7f -#define bRxPesudoNoiseOn 0x20000000 -#define bRxPesudoNoise_A 0xff -#define bRxPesudoNoise_B 0xff00 -#define bRxPesudoNoise_C 0xff0000 -#define bRxPesudoNoise_D 0xff000000 -#define bPesudoNoiseState_A 0xffff -#define bPesudoNoiseState_B 0xffff0000 -#define bPesudoNoiseState_C 0xffff -#define bPesudoNoiseState_D 0xffff0000 - -#define bZebra1_HSSIEnable 0x8 -#define bZebra1_TRxControl 0xc00 -#define bZebra1_TRxGainSetting 0x07f -#define bZebra1_RxCorner 0xc00 -#define bZebra1_TxChargePump 0x38 -#define bZebra1_RxChargePump 0x7 -#define bZebra1_ChannelNum 0xf80 -#define bZebra1_TxLPFBW 0x400 -#define bZebra1_RxLPFBW 0x600 - -#define bRTL8256RegModeCtrl1 0x100 -#define bRTL8256RegModeCtrl0 0x40 -#define bRTL8256_TxLPFBW 0x18 -#define bRTL8256_RxLPFBW 0x600 - -#define bRTL8258_TxLPFBW 0xc -#define bRTL8258_RxLPFBW 0xc00 -#define bRTL8258_RSSILPFBW 0xc0 - -#define bByte0 0x1 -#define bByte1 0x2 -#define bByte2 0x4 -#define bByte3 0x8 -#define bWord0 0x3 -#define bWord1 0xc -#define bDWord 0xf - -#define bMaskByte0 0xff -#define bMaskByte1 0xff00 -#define bMaskByte2 0xff0000 -#define bMaskByte3 0xff000000 -#define bMaskHWord 0xffff0000 -#define bMaskLWord 0x0000ffff -#define bMaskDWord 0xffffffff - -#define bMask12Bits 0xfff - -#define bEnable 0x1 -#define bDisable 0x0 - -#define LeftAntenna 0x0 -#define RightAntenna 0x1 - -#define tCheckTxStatus 500 -#define tUpdateRxCounter 100 - -#define rateCCK 0 -#define rateOFDM 1 -#define rateHT 2 - -#define bPMAC_End 0x1ff -#define bFPGAPHY0_End 0x8ff -#define bFPGAPHY1_End 0x9ff -#define bCCKPHY0_End 0xaff -#define bOFDMPHY0_End 0xcff -#define bOFDMPHY1_End 0xdff - - -#define bPMACControl 0x0 -#define bWMACControl 0x1 -#define bWNICControl 0x2 - -#define PathA 0x0 -#define PathB 0x1 -#define PathC 0x2 -#define PathD 0x3 - -#define rRTL8256RxMixerPole 0xb -#define bZebraRxMixerPole 0x6 -#define rRTL8256TxBBOPBias 0x9 -#define bRTL8256TxBBOPBias 0x400 -#define rRTL8256TxBBBW 19 -#define bRTL8256TxBBBW 0x18 +#define bRxPesudoNoiseOn 0x20000000 +#define bRxPesudoNoise_A 0xff +#define bRxPesudoNoise_B 0xff00 +#define bRxPesudoNoise_C 0xff0000 +#define bRxPesudoNoise_D 0xff000000 +#define bPesudoNoiseState_A 0xffff +#define bPesudoNoiseState_B 0xffff0000 +#define bPesudoNoiseState_C 0xffff +#define bPesudoNoiseState_D 0xffff0000 + +#define bZebra1_HSSIEnable 0x8 +#define bZebra1_TRxControl 0xc00 +#define bZebra1_TRxGainSetting 0x07f +#define bZebra1_RxCorner 0xc00 +#define bZebra1_TxChargePump 0x38 +#define bZebra1_RxChargePump 0x7 +#define bZebra1_ChannelNum 0xf80 +#define bZebra1_TxLPFBW 0x400 +#define bZebra1_RxLPFBW 0x600 + +#define bRTL8256RegModeCtrl1 0x100 +#define bRTL8256RegModeCtrl0 0x40 +#define bRTL8256_TxLPFBW 0x18 +#define bRTL8256_RxLPFBW 0x600 + +#define bRTL8258_TxLPFBW 0xc +#define bRTL8258_RxLPFBW 0xc00 +#define bRTL8258_RSSILPFBW 0xc0 + +#define bByte0 0x1 +#define bByte1 0x2 +#define bByte2 0x4 +#define bByte3 0x8 +#define bWord0 0x3 +#define bWord1 0xc +#define bDWord 0xf + +#define bMaskByte0 0xff +#define bMaskByte1 0xff00 +#define bMaskByte2 0xff0000 +#define bMaskByte3 0xff000000 +#define bMaskHWord 0xffff0000 +#define bMaskLWord 0x0000ffff +#define bMaskDWord 0xffffffff + +#define bMask12Bits 0xfff + +#define bEnable 0x1 +#define bDisable 0x0 + +#define LeftAntenna 0x0 +#define RightAntenna 0x1 + +#define tCheckTxStatus 500 +#define tUpdateRxCounter 100 + +#define rateCCK 0 +#define rateOFDM 1 +#define rateHT 2 + +#define bPMAC_End 0x1ff +#define bFPGAPHY0_End 0x8ff +#define bFPGAPHY1_End 0x9ff +#define bCCKPHY0_End 0xaff +#define bOFDMPHY0_End 0xcff +#define bOFDMPHY1_End 0xdff + + +#define bPMACControl 0x0 +#define bWMACControl 0x1 +#define bWNICControl 0x2 + +#define PathA 0x0 +#define PathB 0x1 +#define PathC 0x2 +#define PathD 0x3 + +#define rRTL8256RxMixerPole 0xb +#define bZebraRxMixerPole 0x6 +#define rRTL8256TxBBOPBias 0x9 +#define bRTL8256TxBBOPBias 0x400 +#define rRTL8256TxBBBW 19 +#define bRTL8256TxBBBW 0x18#endif
Signature · 1 line
1.8.4.1
PATCH v2 2/21 staging: rtl8192e: Copy comments from r819XE_phyreg.h to r8192E_phyreg.h
In reply to Mateusz KulikowskiBoth files have the same contents (with the exception of comments). One of them will not survive future commits.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h | 92 ++++++++++++++++------- 1 file changed, 65 insertions(+), 27 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_phyreg.h +65 -27
@@ -53,10 +53,10 @@#define MCS_TXAGC 0x340#define CCK_TXAGC 0x348 -/*---------------------0x400~0x4ff----------------------*/ +/* Mac block on/off control register */ #define MacBlkCtrl 0x403 -#define rFPGA0_RFMOD 0x800 +#define rFPGA0_RFMOD 0x800/* RF mode & CCK TxSC */ #define rFPGA0_TxInfo 0x804#define rFPGA0_PSDFunction 0x808#define rFPGA0_TxGainStage 0x80c
@@ -98,6 +98,7 @@#define rFPGA0_XAB_RFInterfaceRB 0x8e0#define rFPGA0_XCD_RFInterfaceRB 0x8e4 +/* Page 9 - RF mode & OFDM TxSC */ #define rFPGA1_RFMOD 0x900#define rFPGA1_TxBlock 0x904#define rFPGA1_DebugSelect 0x908
@@ -106,14 +107,16 @@#define rCCK0_System 0xa00#define rCCK0_AFESetting 0xa04#define rCCK0_CCA 0xa08 +/* AGC default value, saturation level */ #define rCCK0_RxAGC1 0xa0c -#define rCCK0_RxAGC2 0xa10 +#define rCCK0_RxAGC2 0xa10/* AGC & DAGC */ #define rCCK0_RxHP 0xa14 +/* Timing recovery & channel estimation threshold */ #define rCCK0_DSPParameter1 0xa18 -#define rCCK0_DSPParameter2 0xa1c +#define rCCK0_DSPParameter2 0xa1c/* SQ threshold */ #define rCCK0_TxFilter1 0xa20#define rCCK0_TxFilter2 0xa24 -#define rCCK0_DebugPort 0xa28 +#define rCCK0_DebugPort 0xa28/* Debug port and TX filter 3 */ #define rCCK0_FalseAlarmReport 0xa2c#define rCCK0_TRSSIReport 0xa50#define rCCK0_RxReport 0xa54
@@ -124,22 +127,24 @@#define rOFDM0_TRxPathEnable 0xc04#define rOFDM0_TRMuxPar 0xc08#define rOFDM0_TRSWIsolation 0xc0c +/* RxIQ DC offset, Rx digital filter, DC notch filter */ #define rOFDM0_XARxAFE 0xc10 -#define rOFDM0_XARxIQImbalance 0xc14 +#define rOFDM0_XARxIQImbalance 0xc14/* RxIQ imbalance matrix */ #define rOFDM0_XBRxAFE 0xc18#define rOFDM0_XBRxIQImbalance 0xc1c#define rOFDM0_XCRxAFE 0xc20#define rOFDM0_XCRxIQImbalance 0xc24#define rOFDM0_XDRxAFE 0xc28#define rOFDM0_XDRxIQImbalance 0xc2c -#define rOFDM0_RxDetector1 0xc30 -#define rOFDM0_RxDetector2 0xc34 -#define rOFDM0_RxDetector3 0xc38 +#define rOFDM0_RxDetector1 0xc30/* PD, BW & SBD */ +#define rOFDM0_RxDetector2 0xc34/* SBD */ +#define rOFDM0_RxDetector3 0xc38/* Frame Sync */ +/* PD, SBD, Frame Sync & Short-GI */ #define rOFDM0_RxDetector4 0xc3c -#define rOFDM0_RxDSP 0xc40 -#define rOFDM0_CFOandDAGC 0xc44 +#define rOFDM0_RxDSP 0xc40/* Rx Sync Path */ +#define rOFDM0_CFOandDAGC 0xc44/* CFO & DAGC */ #define rOFDM0_CCADropThreshold 0xc48 -#define rOFDM0_ECCAThreshold 0xc4c +#define rOFDM0_ECCAThreshold 0xc4c/* Energy CCA */ #define rOFDM0_XAAGCCore1 0xc50#define rOFDM0_XAAGCCore2 0xc54#define rOFDM0_XBAGCCore1 0xc58
@@ -184,9 +189,9 @@#define rOFDM1_PseudoNoiseStateAB 0xd50#define rOFDM1_PseudoNoiseStateCD 0xd54#define rOFDM1_RxPseudoNoiseWgt 0xd58 -#define rOFDM_PHYCounter1 0xda0 -#define rOFDM_PHYCounter2 0xda4 -#define rOFDM_PHYCounter3 0xda8 +#define rOFDM_PHYCounter1 0xda0/* cca, parity fail */ +#define rOFDM_PHYCounter2 0xda4/* rate illegal, crc8 fail */ +#define rOFDM_PHYCounter3 0xda8/* MCS not supported */ #define rOFDM_ShortCFOAB 0xdac#define rOFDM_ShortCFOCD 0xdb0#define rOFDM_LongCFOAB 0xdb4
@@ -221,14 +226,17 @@#define rZebra1_RxLPF 0xb#define rZebra1_RxHPFCorner 0xc +/* Zebra 4 */ #define rGlobalCtrl 0#define rRTL8256_TxLPF 19#define rRTL8256_RxLPF 11 +/* RTL8258 */ #define rRTL8258_TxLPF 0x11#define rRTL8258_RxLPF 0x13#define rRTL8258_RSSILPF 0xa +/* Bit Mask - Page 1*/ #define bBBResetB 0x100#define bGlobalResetB 0x200#define bOFDMTxStart 0x4
@@ -273,7 +281,7 @@#define bCCKTxCRC16 0xffff#define bCCKTxStatus 0x1#define bOFDMTxStatus 0x2 - +/* Bit Mask - Page 8 */ #define bRFMOD 0x1#define bJapanMode 0x2#define bCCKTxSC 0x30
@@ -290,13 +298,16 @@#define bRFStart 0x0000f000#define bBBStart 0x000000f0#define bBBCCKStart 0x0000000f +/* Bit Mask - rFPGA0_RFTiming2 */ #define bPAEnd 0xf#define bTREnd 0x0f000000#define bRFEnd 0x000f0000 +/* T2R */ #define bCCAMask 0x000000f0#define bR2RCCAMask 0x00000f00#define bHSSI_R2TDelay 0xf8000000#define bHSSI_T2RDelay 0xf80000 +/* Channel gain at continue TX. */ #define bContTxHSSI 0x400#define bIGFromCCK 0x200#define bAGCAddress 0x3f
@@ -308,6 +319,7 @@#define b3WireDataLength 0x800#define b3WireAddressLength 0x400#define b3WireRFPowerDown 0x1 +/*#define bHWSISelect 0x8 */ #define b5GPAPEPolarity 0x40000000#define b2GPAPEPolarity 0x80000000#define bRFSW_TxDefaultAnt 0x3
@@ -318,6 +330,7 @@#define bRFSI_3WireClock 0x2#define bRFSI_3WireLoad 0x4#define bRFSI_3WireRW 0x8 +/* 3-wire total control */ #define bRFSI_3Wire 0xf#define bRFSI_RFENV 0x10#define bRFSI_TRSW 0x20
@@ -343,11 +356,11 @@#define bLSIG_Length 0x1fffe#define bLSIG_Parity 0x20#define bCCKRxPhase 0x4 -#define bLSSIReadAddress 0x3f000000 -#define bLSSIReadEdge 0x80000000 +#define bLSSIReadAddress 0x3f000000/* LSSI "read" address */ +#define bLSSIReadEdge 0x80000000/* LSSI "read" edge signal */ #define bLSSIReadBackData 0xfff#define bLSSIReadOKFlag 0x1000 -#define bCCKSampleRate 0x8 +#define bCCKSampleRate 0x8/* 0: 44 MHz, 1: 88MHz */ #define bRegulator0Standby 0x1#define bRegulatorPLLStandby 0x2
@@ -404,10 +417,13 @@#define bPSDSineToneScale 0x7f000000#define bPSDReport 0xffff +/* Page 8 */ #define bOFDMTxSC 0x30000000#define bCCKTxOn 0x1#define bOFDMTxOn 0x2 +/* Reset debug page and also HWord, LWord */ #define bDebugPage 0xfff +/* Reset debug page and LWord */ #define bDebugItem 0xff#define bAntL 0x10#define bAntNonHT 0x100
@@ -416,6 +432,7 @@#define bAntHT1S1 0x100000#define bAntNonHTS1 0x1000000 +/* Page a */ #define bCCKBBMode 0x3#define bCCKTxPowerSaving 0x80#define bCCKRxPowerSaving 0x40
@@ -436,7 +453,7 @@#define bCCKBistMode 0x80000000#define bCCKCCAMask 0x40000000#define bCCKTxDACPhase 0x4 -#define bCCKRxADCPhase 0x20000000 +#define bCCKRxADCPhase 0x20000000/* r_rx_clk */ #define bCCKr_cp_mode0 0x0100#define bCCKTxDCOffset 0xf0#define bCCKRxDCOffset 0xf
@@ -450,11 +467,14 @@#define bCCKRxIG 0x7f00#define bCCKLNAPolarity 0x800000#define bCCKRx1stGain 0x7f0000 +/* CCK Rx Initial gain polarity */ #define bCCKRFExtend 0x20000000#define bCCKRxAGCSatLevel 0x1f000000#define bCCKRxAGCSatCount 0xe0 +/* AGCSAmp_dly */ #define bCCKRxRFSettle 0x1f#define bCCKFixedRxAGC 0x8000 +/*#define bCCKRxAGCFormat 0x4000 remove to HSSI register 0x824 */ #define bCCKAntennaPolarity 0x2000#define bCCKTxFilterType 0x0c00#define bCCKRxAGCReportType 0x0300
@@ -495,6 +515,7 @@#define bCCKDefaultRxPath 0xc000000#define bCCKOptionRxPath 0x3000000 +/* Page c */ #define bNumOfSTF 0x3#define bShift_L 0xc0#define bGI_TH 0xc
@@ -596,7 +617,9 @@#define bRxHP_BBP1 0x7000#define bRxHP_BBP2 0x70000#define bRxHP_BBP3 0x700000 +/* The threshold for high power */ #define bRSSI_H 0x7f0000 +/* The threshold for ant diversity */ #define bRSSI_Gen 0x7f000000#define bRxSettle_TRSW 0x7#define bRxSettle_LNA 0x38
@@ -631,6 +654,7 @@#define bRxPD_Delay_TH1 0x38#define bRxPD_Delay_TH2 0x1c0#define bRxPD_DC_COUNT_MAX 0x600 +/*#define bRxMF_Hold 0x3800*/ #define bRxPD_Delay_TH 0x8000#define bRxProcess_Delay 0xf0000#define bRxSearchrange_GI2_Early 0x700000
@@ -656,6 +680,7 @@#define bExtLNAGain 0x7c00 +/* Page d */ #define bSTBCEn 0x4#define bAntennaMapping 0x10#define bNss 0x20
@@ -665,6 +690,13 @@#define bOFDMContinueTx 0x10000000#define bOFDMSingleCarrier 0x20000000#define bOFDMSingleTone 0x40000000 +/* #define bRxPath1 0x01 +* #define bRxPath2 0x02 +* #define bRxPath3 0x04 +* #define bRxPath4 0x08 +* #define bTxPath1 0x10 +* #define bTxPath2 0x20 +*/ #define bHTDetect 0x100#define bCFOEn 0x10000#define bCFOValue 0xfff00000
@@ -677,8 +709,8 @@#define bCounter_MCSNoSupport 0xffff#define bCounter_FastSync 0xffff#define bShortCFO 0xfff -#define bShortCFOTLength 12 -#define bShortCFOFLength 11 +#define bShortCFOTLength 12/* total */ +#define bShortCFOFLength 11/* fraction */ #define bLongCFO 0x7ff#define bLongCFOTLength 11#define bLongCFOFLength 11
@@ -755,6 +787,7 @@#define bUChCfg 0x7000000#define bUpdEqz 0x8000000 +/* Page e */ #define bTxAGCRate18_06 0x7f7f7f7f#define bTxAGCRate54_24 0x7f7f7f7f#define bTxAGCRateMCS32 0x7f
@@ -764,8 +797,7 @@#define bTxAGCRateMCS11_MCS8 0x7f7f7f7f#define bTxAGCRateMCS15_MCS12 0x7f7f7f7f - -#define bRxPesudoNoiseOn 0x20000000 +#define bRxPesudoNoiseOn 0x20000000/* Rx Pseduo noise */ #define bRxPesudoNoise_A 0xff#define bRxPesudoNoise_B 0xff00#define bRxPesudoNoise_C 0xff0000
@@ -775,6 +807,7 @@#define bPesudoNoiseState_C 0xffff#define bPesudoNoiseState_D 0xffff0000 +/* RF Zebra 1 */ #define bZebra1_HSSIEnable 0x8#define bZebra1_TRxControl 0xc00#define bZebra1_TRxGainSetting 0x07f
@@ -785,15 +818,18 @@#define bZebra1_TxLPFBW 0x400#define bZebra1_RxLPFBW 0x600 +/* Zebra4 */ #define bRTL8256RegModeCtrl1 0x100#define bRTL8256RegModeCtrl0 0x40#define bRTL8256_TxLPFBW 0x18#define bRTL8256_RxLPFBW 0x600 +/* RTL8258 */ #define bRTL8258_TxLPFBW 0xc#define bRTL8258_RxLPFBW 0xc00#define bRTL8258_RSSILPFBW 0xc0 +/* byte enable for sb_write */ #define bByte0 0x1#define bByte1 0x2#define bByte2 0x4
@@ -802,6 +838,7 @@#define bWord1 0xc#define bDWord 0xf +/* for PutRegsetting & GetRegSetting BitMask */ #define bMaskByte0 0xff#define bMaskByte1 0xff00#define bMaskByte2 0xff0000
@@ -810,6 +847,7 @@#define bMaskLWord 0x0000ffff#define bMaskDWord 0xffffffff +/* for PutRFRegsetting & GetRFRegSetting BitMask */ #define bMask12Bits 0xfff#define bEnable 0x1
@@ -818,14 +856,14 @@#define LeftAntenna 0x0#define RightAntenna 0x1 -#define tCheckTxStatus 500 -#define tUpdateRxCounter 100 +#define tCheckTxStatus 500/* 500 ms */ +#define tUpdateRxCounter 100/* 100 ms */ #define rateCCK 0#define rateOFDM 1#define rateHT 2 -#define bPMAC_End 0x1ff +#define bPMAC_End 0x1ff/* define Register-End */ #define bFPGAPHY0_End 0x8ff#define bFPGAPHY1_End 0x9ff#define bCCKPHY0_End 0xaff
Signature · 1 line
1.8.4.1
PATCH v2 3/21 staging: rtl8192e: remove r819xE_phyreg.h
In reply to Mateusz KulikowskiThis file is not used and its contents are duplicated in r8192E_phyreg.h.
--- drivers/staging/rtl8192e/rtl8192e/r819xE_phyreg.h | 908 ---------------------- 1 file changed, 908 deletions(-) delete mode 100644 drivers/staging/rtl8192e/rtl8192e/r819xE_phyreg.h
drivers/staging/rtl8192e/rtl8192e/r819xE_phyreg.h deleted +0 -908
@@ -1,908 +0,0 @@ -#ifndef _R819XU_PHYREG_H -#define _R819XU_PHYREG_H - - -#define RF_DATA 0x1d4 // FW will write RF data in the register. - -//Register //duplicate register due to connection: RF_Mode, TRxRN, NumOf L-STF -//page 1 -#define rPMAC_Reset 0x100 -#define rPMAC_TxStart 0x104 -#define rPMAC_TxLegacySIG 0x108 -#define rPMAC_TxHTSIG1 0x10c -#define rPMAC_TxHTSIG2 0x110 -#define rPMAC_PHYDebug 0x114 -#define rPMAC_TxPacketNum 0x118 -#define rPMAC_TxIdle 0x11c -#define rPMAC_TxMACHeader0 0x120 -#define rPMAC_TxMACHeader1 0x124 -#define rPMAC_TxMACHeader2 0x128 -#define rPMAC_TxMACHeader3 0x12c -#define rPMAC_TxMACHeader4 0x130 -#define rPMAC_TxMACHeader5 0x134 -#define rPMAC_TxDataType 0x138 -#define rPMAC_TxRandomSeed 0x13c -#define rPMAC_CCKPLCPPreamble 0x140 -#define rPMAC_CCKPLCPHeader 0x144 -#define rPMAC_CCKCRC16 0x148 -#define rPMAC_OFDMRxCRC32OK 0x170 -#define rPMAC_OFDMRxCRC32Er 0x174 -#define rPMAC_OFDMRxParityEr 0x178 -#define rPMAC_OFDMRxCRC8Er 0x17c -#define rPMAC_CCKCRxRC16Er 0x180 -#define rPMAC_CCKCRxRC32Er 0x184 -#define rPMAC_CCKCRxRC32OK 0x188 -#define rPMAC_TxStatus 0x18c - -//90P -#define MCS_TXAGC 0x340 // MCS AGC -#define CCK_TXAGC 0x348 // CCK AGC - -#define MacBlkCtrl 0x403 // Mac block on/off control register - -//page8 -#define rFPGA0_RFMOD 0x800 //RF mode & CCK TxSC -#define rFPGA0_TxInfo 0x804 -#define rFPGA0_PSDFunction 0x808 -#define rFPGA0_TxGainStage 0x80c -#define rFPGA0_RFTiming1 0x810 -#define rFPGA0_RFTiming2 0x814 -//#define rFPGA0_XC_RFTiming 0x818 -//#define rFPGA0_XD_RFTiming 0x81c -#define rFPGA0_XA_HSSIParameter1 0x820 -#define rFPGA0_XA_HSSIParameter2 0x824 -#define rFPGA0_XB_HSSIParameter1 0x828 -#define rFPGA0_XB_HSSIParameter2 0x82c -#define rFPGA0_XC_HSSIParameter1 0x830 -#define rFPGA0_XC_HSSIParameter2 0x834 -#define rFPGA0_XD_HSSIParameter1 0x838 -#define rFPGA0_XD_HSSIParameter2 0x83c -#define rFPGA0_XA_LSSIParameter 0x840 -#define rFPGA0_XB_LSSIParameter 0x844 -#define rFPGA0_XC_LSSIParameter 0x848 -#define rFPGA0_XD_LSSIParameter 0x84c -#define rFPGA0_RFWakeUpParameter 0x850 -#define rFPGA0_RFSleepUpParameter 0x854 -#define rFPGA0_XAB_SwitchControl 0x858 -#define rFPGA0_XCD_SwitchControl 0x85c -#define rFPGA0_XA_RFInterfaceOE 0x860 -#define rFPGA0_XB_RFInterfaceOE 0x864 -#define rFPGA0_XC_RFInterfaceOE 0x868 -#define rFPGA0_XD_RFInterfaceOE 0x86c -#define rFPGA0_XAB_RFInterfaceSW 0x870 -#define rFPGA0_XCD_RFInterfaceSW 0x874 -#define rFPGA0_XAB_RFParameter 0x878 -#define rFPGA0_XCD_RFParameter 0x87c -#define rFPGA0_AnalogParameter1 0x880 -#define rFPGA0_AnalogParameter2 0x884 -#define rFPGA0_AnalogParameter3 0x888 -#define rFPGA0_AnalogParameter4 0x88c -#define rFPGA0_XA_LSSIReadBack 0x8a0 -#define rFPGA0_XB_LSSIReadBack 0x8a4 -#define rFPGA0_XC_LSSIReadBack 0x8a8 -#define rFPGA0_XD_LSSIReadBack 0x8ac -#define rFPGA0_PSDReport 0x8b4 -#define rFPGA0_XAB_RFInterfaceRB 0x8e0 -#define rFPGA0_XCD_RFInterfaceRB 0x8e4 - -/* Page 9 - RF mode & OFDM TxSC */ -#define rFPGA1_RFMOD 0x900 -#define rFPGA1_TxBlock 0x904 -#define rFPGA1_DebugSelect 0x908 -#define rFPGA1_TxInfo 0x90c - -/* Page a */ -#define rCCK0_System 0xa00 -#define rCCK0_AFESetting 0xa04 -#define rCCK0_CCA 0xa08 -/* AGC default value, saturation level */ -#define rCCK0_RxAGC1 0xa0c -/* AGC & DAGC */ -#define rCCK0_RxAGC2 0xa10 -#define rCCK0_RxHP 0xa14 -/* Timing recovery & channel estimation threshold */ -#define rCCK0_DSPParameter1 0xa18 -/* SQ threshold */ -#define rCCK0_DSPParameter2 0xa1c -#define rCCK0_TxFilter1 0xa20 -#define rCCK0_TxFilter2 0xa24 -/* Debug port and TX filter 3 */ -#define rCCK0_DebugPort 0xa28 -#define rCCK0_FalseAlarmReport 0xa2c -#define rCCK0_TRSSIReport 0xa50 -#define rCCK0_RxReport 0xa54 -#define rCCK0_FACounterLower 0xa5c -#define rCCK0_FACounterUpper 0xa58 - -/* Page c */ -#define rOFDM0_LSTF 0xc00 -#define rOFDM0_TRxPathEnable 0xc04 -#define rOFDM0_TRMuxPar 0xc08 -#define rOFDM0_TRSWIsolation 0xc0c -/* RxIQ DC offset, Rx digital filter, DC notch filter */ -#define rOFDM0_XARxAFE 0xc10 -/* RxIQ imblance matrix */ -#define rOFDM0_XARxIQImbalance 0xc14 -#define rOFDM0_XBRxAFE 0xc18 -#define rOFDM0_XBRxIQImbalance 0xc1c -#define rOFDM0_XCRxAFE 0xc20 -#define rOFDM0_XCRxIQImbalance 0xc24 -#define rOFDM0_XDRxAFE 0xc28 -#define rOFDM0_XDRxIQImbalance 0xc2c -/* PD, BW & SBD */ -#define rOFDM0_RxDetector1 0xc30 -/* SBD */ -#define rOFDM0_RxDetector2 0xc34 -/* Frame Sync */ -#define rOFDM0_RxDetector3 0xc38 -/* PD, SBD, Frame Sync & Short-GI */ -#define rOFDM0_RxDetector4 0xc3c -/* Rx Sync Path */ -#define rOFDM0_RxDSP 0xc40 -/* CFO & DAGC */ -#define rOFDM0_CFOandDAGC 0xc44 -/* CCA Drop threshold */ -#define rOFDM0_CCADropThreshold 0xc48 -/* Energy CCA */ -#define rOFDM0_ECCAThreshold 0xc4c -#define rOFDM0_XAAGCCore1 0xc50 -#define rOFDM0_XAAGCCore2 0xc54 -#define rOFDM0_XBAGCCore1 0xc58 -#define rOFDM0_XBAGCCore2 0xc5c -#define rOFDM0_XCAGCCore1 0xc60 -#define rOFDM0_XCAGCCore2 0xc64 -#define rOFDM0_XDAGCCore1 0xc68 -#define rOFDM0_XDAGCCore2 0xc6c -#define rOFDM0_AGCParameter1 0xc70 -#define rOFDM0_AGCParameter2 0xc74 -#define rOFDM0_AGCRSSITable 0xc78 -#define rOFDM0_HTSTFAGC 0xc7c -#define rOFDM0_XATxIQImbalance 0xc80 -#define rOFDM0_XATxAFE 0xc84 -#define rOFDM0_XBTxIQImbalance 0xc88 -#define rOFDM0_XBTxAFE 0xc8c -#define rOFDM0_XCTxIQImbalance 0xc90 -#define rOFDM0_XCTxAFE 0xc94 -#define rOFDM0_XDTxIQImbalance 0xc98 -#define rOFDM0_XDTxAFE 0xc9c -#define rOFDM0_RxHPParameter 0xce0 -#define rOFDM0_TxPseudoNoiseWgt 0xce4 -#define rOFDM0_FrameSync 0xcf0 -#define rOFDM0_DFSReport 0xcf4 -#define rOFDM0_TxCoeff1 0xca4 -#define rOFDM0_TxCoeff2 0xca8 -#define rOFDM0_TxCoeff3 0xcac -#define rOFDM0_TxCoeff4 0xcb0 -#define rOFDM0_TxCoeff5 0xcb4 -#define rOFDM0_TxCoeff6 0xcb8 - - -/* Page d */ -#define rOFDM1_LSTF 0xd00 -#define rOFDM1_TRxPathEnable 0xd04 -#define rOFDM1_CFO 0xd08 -#define rOFDM1_CSI1 0xd10 -#define rOFDM1_SBD 0xd14 -#define rOFDM1_CSI2 0xd18 -#define rOFDM1_CFOTracking 0xd2c -#define rOFDM1_TRxMesaure1 0xd34 -#define rOFDM1_IntfDet 0xd3c -#define rOFDM1_PseudoNoiseStateAB 0xd50 -#define rOFDM1_PseudoNoiseStateCD 0xd54 -#define rOFDM1_RxPseudoNoiseWgt 0xd58 -/* cca, parity fail */ -#define rOFDM_PHYCounter1 0xda0 -/* rate illegal, crc8 fail */ -#define rOFDM_PHYCounter2 0xda4 -/* MCS not supported */ -#define rOFDM_PHYCounter3 0xda8 -#define rOFDM_ShortCFOAB 0xdac -#define rOFDM_ShortCFOCD 0xdb0 -#define rOFDM_LongCFOAB 0xdb4 -#define rOFDM_LongCFOCD 0xdb8 -#define rOFDM_TailCFOAB 0xdbc -#define rOFDM_TailCFOCD 0xdc0 -#define rOFDM_PWMeasure1 0xdc4 -#define rOFDM_PWMeasure2 0xdc8 -#define rOFDM_BWReport 0xdcc -#define rOFDM_AGCReport 0xdd0 -#define rOFDM_RxSNR 0xdd4 -#define rOFDM_RxEVMCSI 0xdd8 -#define rOFDM_SIGReport 0xddc - -/* Page e */ -#define rTxAGC_Rate18_06 0xe00 -#define rTxAGC_Rate54_24 0xe04 -#define rTxAGC_CCK_Mcs32 0xe08 -#define rTxAGC_Mcs03_Mcs00 0xe10 -#define rTxAGC_Mcs07_Mcs04 0xe14 -#define rTxAGC_Mcs11_Mcs08 0xe18 -#define rTxAGC_Mcs15_Mcs12 0xe1c - - -/* RF Zebra 1 */ -#define rZebra1_HSSIEnable 0x0 -#define rZebra1_TRxEnable1 0x1 -#define rZebra1_TRxEnable2 0x2 -#define rZebra1_AGC 0x4 -#define rZebra1_ChargePump 0x5 -#define rZebra1_Channel 0x7 -#define rZebra1_TxGain 0x8 -#define rZebra1_TxLPF 0x9 -#define rZebra1_RxLPF 0xb -#define rZebra1_RxHPFCorner 0xc - -/* Zebra 4 */ -#define rGlobalCtrl 0 -#define rRTL8256_TxLPF 19 -#define rRTL8256_RxLPF 11 - -/* RTL8258 */ -#define rRTL8258_TxLPF 0x11 -#define rRTL8258_RxLPF 0x13 -#define rRTL8258_RSSILPF 0xa - -/* Bit Mask */ -/* Page 1 */ -#define bBBResetB 0x100 -#define bGlobalResetB 0x200 -#define bOFDMTxStart 0x4 -#define bCCKTxStart 0x8 -#define bCRC32Debug 0x100 -#define bPMACLoopback 0x10 -#define bTxLSIG 0xffffff -#define bOFDMTxRate 0xf -#define bOFDMTxReserved 0x10 -#define bOFDMTxLength 0x1ffe0 -#define bOFDMTxParity 0x20000 -#define bTxHTSIG1 0xffffff -#define bTxHTMCSRate 0x7f -#define bTxHTBW 0x80 -#define bTxHTLength 0xffff00 -#define bTxHTSIG2 0xffffff -#define bTxHTSmoothing 0x1 -#define bTxHTSounding 0x2 -#define bTxHTReserved 0x4 -#define bTxHTAggreation 0x8 -#define bTxHTSTBC 0x30 -#define bTxHTAdvanceCoding 0x40 -#define bTxHTShortGI 0x80 -#define bTxHTNumberHT_LTF 0x300 -#define bTxHTCRC8 0x3fc00 -#define bCounterReset 0x10000 -#define bNumOfOFDMTx 0xffff -#define bNumOfCCKTx 0xffff0000 -#define bTxIdleInterval 0xffff -#define bOFDMService 0xffff0000 -#define bTxMACHeader 0xffffffff -#define bTxDataInit 0xff -#define bTxHTMode 0x100 -#define bTxDataType 0x30000 -#define bTxRandomSeed 0xffffffff -#define bCCKTxPreamble 0x1 -#define bCCKTxSFD 0xffff0000 -#define bCCKTxSIG 0xff -#define bCCKTxService 0xff00 -#define bCCKLengthExt 0x8000 -#define bCCKTxLength 0xffff0000 -#define bCCKTxCRC16 0xffff -#define bCCKTxStatus 0x1 -#define bOFDMTxStatus 0x2 - -/* Page 8 */ -#define bRFMOD 0x1 -#define bJapanMode 0x2 -#define bCCKTxSC 0x30 -#define bCCKEn 0x1000000 -#define bOFDMEn 0x2000000 -#define bOFDMRxADCPhase 0x10000 -#define bOFDMTxDACPhase 0x40000 -#define bXATxAGC 0x3f -#define bXBTxAGC 0xf00 -#define bXCTxAGC 0xf000 -#define bXDTxAGC 0xf0000 -#define bPAStart 0xf0000000 -#define bTRStart 0x00f00000 -#define bRFStart 0x0000f000 -#define bBBStart 0x000000f0 -#define bBBCCKStart 0x0000000f -/* Reg x814 */ -#define bPAEnd 0xf -#define bTREnd 0x0f000000 -#define bRFEnd 0x000f0000 -/* T2R */ -#define bCCAMask 0x000000f0 -#define bR2RCCAMask 0x00000f00 -#define bHSSI_R2TDelay 0xf8000000 -#define bHSSI_T2RDelay 0xf80000 -/* Channel gain at continue TX. */ -#define bContTxHSSI 0x400 -#define bIGFromCCK 0x200 -#define bAGCAddress 0x3f -#define bRxHPTx 0x7000 -#define bRxHPT2R 0x38000 -#define bRxHPCCKIni 0xc0000 -#define bAGCTxCode 0xc00000 -#define bAGCRxCode 0x300000 -#define b3WireDataLength 0x800 -#define b3WireAddressLength 0x400 -#define b3WireRFPowerDown 0x1 -/*#define bHWSISelect 0x8 */ -#define b5GPAPEPolarity 0x40000000 -#define b2GPAPEPolarity 0x80000000 -#define bRFSW_TxDefaultAnt 0x3 -#define bRFSW_TxOptionAnt 0x30 -#define bRFSW_RxDefaultAnt 0x300 -#define bRFSW_RxOptionAnt 0x3000 -#define bRFSI_3WireData 0x1 -#define bRFSI_3WireClock 0x2 -#define bRFSI_3WireLoad 0x4 -#define bRFSI_3WireRW 0x8 -/* 3-wire total control */ -#define bRFSI_3Wire 0xf -#define bRFSI_RFENV 0x10 -#define bRFSI_TRSW 0x20 -#define bRFSI_TRSWB 0x40 -#define bRFSI_ANTSW 0x100 -#define bRFSI_ANTSWB 0x200 -#define bRFSI_PAPE 0x400 -#define bRFSI_PAPE5G 0x800 -#define bBandSelect 0x1 -#define bHTSIG2_GI 0x80 -#define bHTSIG2_Smoothing 0x01 -#define bHTSIG2_Sounding 0x02 -#define bHTSIG2_Aggreaton 0x08 -#define bHTSIG2_STBC 0x30 -#define bHTSIG2_AdvCoding 0x40 -#define bHTSIG2_NumOfHTLTF 0x300 -#define bHTSIG2_CRC8 0x3fc -#define bHTSIG1_MCS 0x7f -#define bHTSIG1_BandWidth 0x80 -#define bHTSIG1_HTLength 0xffff -#define bLSIG_Rate 0xf -#define bLSIG_Reserved 0x10 -#define bLSIG_Length 0x1fffe -#define bLSIG_Parity 0x20 -#define bCCKRxPhase 0x4 -/* LSSI "read" address */ -#define bLSSIReadAddress 0x3f000000 -/* LSSI "read" edge signal */ -#define bLSSIReadEdge 0x80000000 -#define bLSSIReadBackData 0xfff -#define bLSSIReadOKFlag 0x1000 -/* 0: 44 MHz, 1: 88MHz */ -#define bCCKSampleRate 0x8 - -#define bRegulator0Standby 0x1 -#define bRegulatorPLLStandby 0x2 -#define bRegulator1Standby 0x4 -#define bPLLPowerUp 0x8 -#define bDPLLPowerUp 0x10 -#define bDA10PowerUp 0x20 -#define bAD7PowerUp 0x200 -#define bDA6PowerUp 0x2000 -#define bXtalPowerUp 0x4000 -#define b40MDClkPowerUP 0x8000 -#define bDA6DebugMode 0x20000 -#define bDA6Swing 0x380000 -#define bADClkPhase 0x4000000 -#define b80MClkDelay 0x18000000 -#define bAFEWatchDogEnable 0x20000000 -#define bXtalCap 0x0f000000 -#define bXtalCap01 0xc0000000 -#define bXtalCap23 0x3 -#define bXtalCap92x 0x0f000000 -#define bIntDifClkEnable 0x400 -#define bExtSigClkEnable 0x800 -#define bBandgapMbiasPowerUp 0x10000 -#define bAD11SHGain 0xc0000 -#define bAD11InputRange 0x700000 -#define bAD11OPCurrent 0x3800000 -#define bIPathLoopback 0x4000000 -#define bQPathLoopback 0x8000000 -#define bAFELoopback 0x10000000 -#define bDA10Swing 0x7e0 -#define bDA10Reverse 0x800 -#define bDAClkSource 0x1000 -#define bAD7InputRange 0x6000 -#define bAD7Gain 0x38000 -#define bAD7OutputCMMode 0x40000 -#define bAD7InputCMMode 0x380000 -#define bAD7Current 0xc00000 -#define bRegulatorAdjust 0x7000000 -#define bAD11PowerUpAtTx 0x1 -#define bDA10PSAtTx 0x10 -#define bAD11PowerUpAtRx 0x100 -#define bDA10PSAtRx 0x1000 - -#define bCCKRxAGCFormat 0x200 - -#define bPSDFFTSamplepPoint 0xc000 -#define bPSDAverageNum 0x3000 -#define bIQPathControl 0xc00 -#define bPSDFreq 0x3ff -#define bPSDAntennaPath 0x30 -#define bPSDIQSwitch 0x40 -#define bPSDRxTrigger 0x400000 -#define bPSDTxTrigger 0x80000000 -#define bPSDSineToneScale 0x7f000000 -#define bPSDReport 0xffff - -/* Page 8 */ -#define bOFDMTxSC 0x30000000 -#define bCCKTxOn 0x1 -#define bOFDMTxOn 0x2 -/* Reset debug page and also HWord, LWord */ -#define bDebugPage 0xfff -/* Reset debug page and LWord */ -#define bDebugItem 0xff -#define bAntL 0x10 -#define bAntNonHT 0x100 -#define bAntHT1 0x1000 -#define bAntHT2 0x10000 -#define bAntHT1S1 0x100000 -#define bAntNonHTS1 0x1000000 - -/* Page a */ -#define bCCKBBMode 0x3 -#define bCCKTxPowerSaving 0x80 -#define bCCKRxPowerSaving 0x40 -#define bCCKSideBand 0x10 -#define bCCKScramble 0x8 -#define bCCKAntDiversity 0x8000 -#define bCCKCarrierRecovery 0x4000 -#define bCCKTxRate 0x3000 -#define bCCKDCCancel 0x0800 -#define bCCKISICancel 0x0400 -#define bCCKMatchFilter 0x0200 -#define bCCKEqualizer 0x0100 -#define bCCKPreambleDetect 0x800000 -#define bCCKFastFalseCCA 0x400000 -#define bCCKChEstStart 0x300000 -#define bCCKCCACount 0x080000 -#define bCCKcs_lim 0x070000 -#define bCCKBistMode 0x80000000 -#define bCCKCCAMask 0x40000000 -#define bCCKTxDACPhase 0x4 -/* r_rx_clk */ -#define bCCKRxADCPhase 0x20000000 -#define bCCKr_cp_mode0 0x0100 -#define bCCKTxDCOffset 0xf0 -#define bCCKRxDCOffset 0xf -#define bCCKCCAMode 0xc000 -#define bCCKFalseCS_lim 0x3f00 -#define bCCKCS_ratio 0xc00000 -#define bCCKCorgBit_sel 0x300000 -#define bCCKPD_lim 0x0f0000 -#define bCCKNewCCA 0x80000000 -#define bCCKRxHPofIG 0x8000 -#define bCCKRxIG 0x7f00 -#define bCCKLNAPolarity 0x800000 -#define bCCKRx1stGain 0x7f0000 -/* CCK Rx Initial gain polarity */ -#define bCCKRFExtend 0x20000000 -#define bCCKRxAGCSatLevel 0x1f000000 -#define bCCKRxAGCSatCount 0xe0 -/* AGCSAmp_dly */ -#define bCCKRxRFSettle 0x1f -#define bCCKFixedRxAGC 0x8000 -/*#define bCCKRxAGCFormat 0x4000 remove to HSSI register 0x824 */ -#define bCCKAntennaPolarity 0x2000 -#define bCCKTxFilterType 0x0c00 -#define bCCKRxAGCReportType 0x0300 -#define bCCKRxDAGCEn 0x80000000 -#define bCCKRxDAGCPeriod 0x20000000 -#define bCCKRxDAGCSatLevel 0x1f000000 -#define bCCKTimingRecovery 0x800000 -#define bCCKTxC0 0x3f0000 -#define bCCKTxC1 0x3f000000 -#define bCCKTxC2 0x3f -#define bCCKTxC3 0x3f00 -#define bCCKTxC4 0x3f0000 -#define bCCKTxC5 0x3f000000 -#define bCCKTxC6 0x3f -#define bCCKTxC7 0x3f00 -#define bCCKDebugPort 0xff0000 -#define bCCKDACDebug 0x0f000000 -#define bCCKFalseAlarmEnable 0x8000 -#define bCCKFalseAlarmRead 0x4000 -#define bCCKTRSSI 0x7f -#define bCCKRxAGCReport 0xfe -#define bCCKRxReport_AntSel 0x80000000 -#define bCCKRxReport_MFOff 0x40000000 -#define bCCKRxRxReport_SQLoss 0x20000000 -#define bCCKRxReport_Pktloss 0x10000000 -#define bCCKRxReport_Lockedbit 0x08000000 -#define bCCKRxReport_RateError 0x04000000 -#define bCCKRxReport_RxRate 0x03000000 -#define bCCKRxFACounterLower 0xff -#define bCCKRxFACounterUpper 0xff000000 -#define bCCKRxHPAGCStart 0xe000 -#define bCCKRxHPAGCFinal 0x1c00 - -#define bCCKRxFalseAlarmEnable 0x8000 -#define bCCKFACounterFreeze 0x4000 - -#define bCCKTxPathSel 0x10000000 -#define bCCKDefaultRxPath 0xc000000 -#define bCCKOptionRxPath 0x3000000 - -/* Page c */ -#define bNumOfSTF 0x3 -#define bShift_L 0xc0 -#define bGI_TH 0xc -#define bRxPathA 0x1 -#define bRxPathB 0x2 -#define bRxPathC 0x4 -#define bRxPathD 0x8 -#define bTxPathA 0x1 -#define bTxPathB 0x2 -#define bTxPathC 0x4 -#define bTxPathD 0x8 -#define bTRSSIFreq 0x200 -#define bADCBackoff 0x3000 -#define bDFIRBackoff 0xc000 -#define bTRSSILatchPhase 0x10000 -#define bRxIDCOffset 0xff -#define bRxQDCOffset 0xff00 -#define bRxDFIRMode 0x1800000 -#define bRxDCNFType 0xe000000 -#define bRXIQImb_A 0x3ff -#define bRXIQImb_B 0xfc00 -#define bRXIQImb_C 0x3f0000 -#define bRXIQImb_D 0xffc00000 -#define bDC_dc_Notch 0x60000 -#define bRxNBINotch 0x1f000000 -#define bPD_TH 0xf -#define bPD_TH_Opt2 0xc000 -#define bPWED_TH 0x700 -#define bIfMF_Win_L 0x800 -#define bPD_Option 0x1000 -#define bMF_Win_L 0xe000 -#define bBW_Search_L 0x30000 -#define bwin_enh_L 0xc0000 -#define bBW_TH 0x700000 -#define bED_TH2 0x3800000 -#define bBW_option 0x4000000 -#define bRatio_TH 0x18000000 -#define bWindow_L 0xe0000000 -#define bSBD_Option 0x1 -#define bFrame_TH 0x1c -#define bFS_Option 0x60 -#define bDC_Slope_check 0x80 -#define bFGuard_Counter_DC_L 0xe00 -#define bFrame_Weight_Short 0x7000 -#define bSub_Tune 0xe00000 -#define bFrame_DC_Length 0xe000000 -#define bSBD_start_offset 0x30000000 -#define bFrame_TH_2 0x7 -#define bFrame_GI2_TH 0x38 -#define bGI2_Sync_en 0x40 -#define bSarch_Short_Early 0x300 -#define bSarch_Short_Late 0xc00 -#define bSarch_GI2_Late 0x70000 -#define bCFOAntSum 0x1 -#define bCFOAcc 0x2 -#define bCFOStartOffset 0xc -#define bCFOLookBack 0x70 -#define bCFOSumWeight 0x80 -#define bDAGCEnable 0x10000 -#define bTXIQImb_A 0x3ff -#define bTXIQImb_B 0xfc00 -#define bTXIQImb_C 0x3f0000 -#define bTXIQImb_D 0xffc00000 -#define bTxIDCOffset 0xff -#define bTxQDCOffset 0xff00 -#define bTxDFIRMode 0x10000 -#define bTxPesudoNoiseOn 0x4000000 -#define bTxPesudoNoise_A 0xff -#define bTxPesudoNoise_B 0xff00 -#define bTxPesudoNoise_C 0xff0000 -#define bTxPesudoNoise_D 0xff000000 -#define bCCADropOption 0x20000 -#define bCCADropThres 0xfff00000 -#define bEDCCA_H 0xf -#define bEDCCA_L 0xf0 -#define bLambda_ED 0x300 -#define bRxInitialGain 0x7f -#define bRxAntDivEn 0x80 -#define bRxAGCAddressForLNA 0x7f00 -#define bRxHighPowerFlow 0x8000 -#define bRxAGCFreezeThres 0xc0000 -#define bRxFreezeStep_AGC1 0x300000 -#define bRxFreezeStep_AGC2 0xc00000 -#define bRxFreezeStep_AGC3 0x3000000 -#define bRxFreezeStep_AGC0 0xc000000 -#define bRxRssi_Cmp_En 0x10000000 -#define bRxQuickAGCEn 0x20000000 -#define bRxAGCFreezeThresMode 0x40000000 -#define bRxOverFlowCheckType 0x80000000 -#define bRxAGCShift 0x7f -#define bTRSW_Tri_Only 0x80 -#define bPowerThres 0x300 -#define bRxAGCEn 0x1 -#define bRxAGCTogetherEn 0x2 -#define bRxAGCMin 0x4 -#define bRxHP_Ini 0x7 -#define bRxHP_TRLNA 0x70 -#define bRxHP_RSSI 0x700 -#define bRxHP_BBP1 0x7000 -#define bRxHP_BBP2 0x70000 -#define bRxHP_BBP3 0x700000 -/* The threshold for high power */ -#define bRSSI_H 0x7f0000 -/* The threshold for ant diversity */ -#define bRSSI_Gen 0x7f000000 -#define bRxSettle_TRSW 0x7 -#define bRxSettle_LNA 0x38 -#define bRxSettle_RSSI 0x1c0 -#define bRxSettle_BBP 0xe00 -#define bRxSettle_RxHP 0x7000 -#define bRxSettle_AntSW_RSSI 0x38000 -#define bRxSettle_AntSW 0xc0000 -#define bRxProcessTime_DAGC 0x300000 -#define bRxSettle_HSSI 0x400000 -#define bRxProcessTime_BBPPW 0x800000 -#define bRxAntennaPowerShift 0x3000000 -#define bRSSITableSelect 0xc000000 -#define bRxHP_Final 0x7000000 -#define bRxHTSettle_BBP 0x7 -#define bRxHTSettle_HSSI 0x8 -#define bRxHTSettle_RxHP 0x70 -#define bRxHTSettle_BBPPW 0x80 -#define bRxHTSettle_Idle 0x300 -#define bRxHTSettle_Reserved 0x1c00 -#define bRxHTRxHPEn 0x8000 -#define bRxHTAGCFreezeThres 0x30000 -#define bRxHTAGCTogetherEn 0x40000 -#define bRxHTAGCMin 0x80000 -#define bRxHTAGCEn 0x100000 -#define bRxHTDAGCEn 0x200000 -#define bRxHTRxHP_BBP 0x1c00000 -#define bRxHTRxHP_Final 0xe0000000 -#define bRxPWRatioTH 0x3 -#define bRxPWRatioEn 0x4 -#define bRxMFHold 0x3800 -#define bRxPD_Delay_TH1 0x38 -#define bRxPD_Delay_TH2 0x1c0 -#define bRxPD_DC_COUNT_MAX 0x600 -/*#define bRxMF_Hold 0x3800*/ -#define bRxPD_Delay_TH 0x8000 -#define bRxProcess_Delay 0xf0000 -#define bRxSearchrange_GI2_Early 0x700000 -#define bRxFrame_Guard_Counter_L 0x3800000 -#define bRxSGI_Guard_L 0xc000000 -#define bRxSGI_Search_L 0x30000000 -#define bRxSGI_TH 0xc0000000 -#define bDFSCnt0 0xff -#define bDFSCnt1 0xff00 -#define bDFSFlag 0xf0000 - -#define bMFWeightSum 0x300000 -#define bMinIdxTH 0x7f000000 - -#define bDAFormat 0x40000 - -#define bTxChEmuEnable 0x01000000 - -#define bTRSWIsolation_A 0x7f -#define bTRSWIsolation_B 0x7f00 -#define bTRSWIsolation_C 0x7f0000 -#define bTRSWIsolation_D 0x7f000000 - -#define bExtLNAGain 0x7c00 - -/* Page d */ -#define bSTBCEn 0x4 -#define bAntennaMapping 0x10 -#define bNss 0x20 -#define bCFOAntSumD 0x200 -#define bPHYCounterReset 0x8000000 -#define bCFOReportGet 0x4000000 -#define bOFDMContinueTx 0x10000000 -#define bOFDMSingleCarrier 0x20000000 -#define bOFDMSingleTone 0x40000000 -/*#define bRxPath1 0x01 -#define bRxPath2 0x02 -#define bRxPath3 0x04 -#define bRxPath4 0x08 -#define bTxPath1 0x10 -#define bTxPath2 0x20*/ -#define bHTDetect 0x100 -#define bCFOEn 0x10000 -#define bCFOValue 0xfff00000 -#define bSigTone_Re 0x3f -#define bSigTone_Im 0x7f00 -#define bCounter_CCA 0xffff -#define bCounter_ParityFail 0xffff0000 -#define bCounter_RateIllegal 0xffff -#define bCounter_CRC8Fail 0xffff0000 -#define bCounter_MCSNoSupport 0xffff -#define bCounter_FastSync 0xffff -#define bShortCFO 0xfff -/* total */ -#define bShortCFOTLength 12 -/* fraction */ -#define bShortCFOFLength 11 -#define bLongCFO 0x7ff -#define bLongCFOTLength 11 -#define bLongCFOFLength 11 -#define bTailCFO 0x1fff -#define bTailCFOTLength 13 -#define bTailCFOFLength 12 - -#define bmax_en_pwdB 0xffff -#define bCC_power_dB 0xffff0000 -#define bnoise_pwdB 0xffff -#define bPowerMeasTLength 10 -#define bPowerMeasFLength 3 -#define bRx_HT_BW 0x1 -#define bRxSC 0x6 -#define bRx_HT 0x8 - -#define bNB_intf_det_on 0x1 -#define bIntf_win_len_cfg 0x30 -#define bNB_Intf_TH_cfg 0x1c0 - -#define bRFGain 0x3f -#define bTableSel 0x40 -#define bTRSW 0x80 - -#define bRxSNR_A 0xff -#define bRxSNR_B 0xff00 -#define bRxSNR_C 0xff0000 -#define bRxSNR_D 0xff000000 -#define bSNREVMTLength 8 -#define bSNREVMFLength 1 - -#define bCSI1st 0xff -#define bCSI2nd 0xff00 -#define bRxEVM1st 0xff0000 -#define bRxEVM2nd 0xff000000 - -#define bSIGEVM 0xff -#define bPWDB 0xff00 -#define bSGIEN 0x10000 - -#define bSFactorQAM1 0xf -#define bSFactorQAM2 0xf0 -#define bSFactorQAM3 0xf00 -#define bSFactorQAM4 0xf000 -#define bSFactorQAM5 0xf0000 -#define bSFactorQAM6 0xf0000 -#define bSFactorQAM7 0xf00000 -#define bSFactorQAM8 0xf000000 -#define bSFactorQAM9 0xf0000000 -#define bCSIScheme 0x100000 - -#define bNoiseLvlTopSet 0x3 -#define bChSmooth 0x4 -#define bChSmoothCfg1 0x38 -#define bChSmoothCfg2 0x1c0 -#define bChSmoothCfg3 0xe00 -#define bChSmoothCfg4 0x7000 -#define bMRCMode 0x800000 -#define bTHEVMCfg 0x7000000 - -#define bLoopFitType 0x1 -#define bUpdCFO 0x40 -#define bUpdCFOOffData 0x80 -#define bAdvUpdCFO 0x100 -#define bAdvTimeCtrl 0x800 -#define bUpdClko 0x1000 -#define bFC 0x6000 -#define bTrackingMode 0x8000 -#define bPhCmpEnable 0x10000 -#define bUpdClkoLTF 0x20000 -#define bComChCFO 0x40000 -#define bCSIEstiMode 0x80000 -#define bAdvUpdEqz 0x100000 -#define bUChCfg 0x7000000 -#define bUpdEqz 0x8000000 - -/* Page e */ -#define bTxAGCRate18_06 0x7f7f7f7f -#define bTxAGCRate54_24 0x7f7f7f7f -#define bTxAGCRateMCS32 0x7f -#define bTxAGCRateCCK 0x7f00 -#define bTxAGCRateMCS3_MCS0 0x7f7f7f7f -#define bTxAGCRateMCS7_MCS4 0x7f7f7f7f -#define bTxAGCRateMCS11_MCS8 0x7f7f7f7f -#define bTxAGCRateMCS15_MCS12 0x7f7f7f7f - - -/* Rx Pseduo noise */ -#define bRxPesudoNoiseOn 0x20000000 -#define bRxPesudoNoise_A 0xff -#define bRxPesudoNoise_B 0xff00 -#define bRxPesudoNoise_C 0xff0000 -#define bRxPesudoNoise_D 0xff000000 -#define bPesudoNoiseState_A 0xffff -#define bPesudoNoiseState_B 0xffff0000 -#define bPesudoNoiseState_C 0xffff -#define bPesudoNoiseState_D 0xffff0000 - -/* RF Zebra 1 */ -#define bZebra1_HSSIEnable 0x8 -#define bZebra1_TRxControl 0xc00 -#define bZebra1_TRxGainSetting 0x07f -#define bZebra1_RxCorner 0xc00 -#define bZebra1_TxChargePump 0x38 -#define bZebra1_RxChargePump 0x7 -#define bZebra1_ChannelNum 0xf80 -#define bZebra1_TxLPFBW 0x400 -#define bZebra1_RxLPFBW 0x600 - -/* Zebra4 */ -#define bRTL8256RegModeCtrl1 0x100 -#define bRTL8256RegModeCtrl0 0x40 -#define bRTL8256_TxLPFBW 0x18 -#define bRTL8256_RxLPFBW 0x600 - -//RTL8258 -#define bRTL8258_TxLPFBW 0xc -#define bRTL8258_RxLPFBW 0xc00 -#define bRTL8258_RSSILPFBW 0xc0 - -/* byte enable for sb_write */ -#define bByte0 0x1 -#define bByte1 0x2 -#define bByte2 0x4 -#define bByte3 0x8 -#define bWord0 0x3 -#define bWord1 0xc -#define bDWord 0xf - -/* for PutRegsetting & GetRegSetting BitMask */ -#define bMaskByte0 0xff -#define bMaskByte1 0xff00 -#define bMaskByte2 0xff0000 -#define bMaskByte3 0xff000000 -#define bMaskHWord 0xffff0000 -#define bMaskLWord 0x0000ffff -#define bMaskDWord 0xffffffff - -/* for PutRFRegsetting & GetRFRegSetting BitMask */ -#define bMask12Bits 0xfff - -#define bEnable 0x1 -#define bDisable 0x0 - -#define LeftAntenna 0x0 -#define RightAntenna 0x1 - -/* 500 ms */ -#define tCheckTxStatus 500 -/* 100 ms */ -#define tUpdateRxCounter 100 - -#define rateCCK 0 -#define rateOFDM 1 -#define rateHT 2 - -/* define Register-End */ -#define bPMAC_End 0x1ff -#define bFPGAPHY0_End 0x8ff -#define bFPGAPHY1_End 0x9ff -#define bCCKPHY0_End 0xaff -#define bOFDMPHY0_End 0xcff -#define bOFDMPHY1_End 0xdff - -#define bPMACControl 0x0 -#define bWMACControl 0x1 -#define bWNICControl 0x2 - -#define PathA 0x0 -#define PathB 0x1 -#define PathC 0x2 -#define PathD 0x3 - -#define rRTL8256RxMixerPole 0xb -#define bZebraRxMixerPole 0x6 -#define rRTL8256TxBBOPBias 0x9 -#define bRTL8256TxBBOPBias 0x400 -#define rRTL8256TxBBBW 19 -#define bRTL8256TxBBBW 0x18 - - -#endif /* __INC_HAL8190PCIPHYREG_H */
Signature · 1 line
1.8.4.1
PATCH v2 4/21 staging: rtl8192e: Fix SPACING errors
In reply to Mateusz KulikowskiFix several SPACING errors to make checkpatch happy.
--- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 2 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 +++--- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 6 +++--- drivers/staging/rtl8192e/rtllib_debug.h | 3 +-- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +1 -1
@@ -1002,7 +1002,7 @@ void rtl8192_SwChnl_WorkItem(struct net_device *dev)RT_TRACE (COMP_TRACE ,"=====>--%s(), set chan:%d, priv:%p\n" , __func__, priv->chan, priv); -rtl8192_phy_FinishSwChnlNow (dev , priv->chan); +rtl8192_phy_FinishSwChnlNow (dev, priv->chan);RT_TRACE (COMP_TRACE ,"<== SwChnlCallback819xUsbWorkItem()\n" ); }
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -3
@@ -1533,7 +1533,7 @@ RESET_START:SEM_UP_IEEE_WX (&ieee->wx_sem); }else {netdev_info (dev,"ieee->state is NOT LINKED\n" ); -rtllib_softmac_stop_protocol (priv->rtllib,0 , true); +rtllib_softmac_stop_protocol (priv->rtllib,0 , true); }dm_backup_dynamic_mechanism_state (dev);
@@ -2102,7 +2102,7 @@ static short rtl8192_alloc_rx_desc_ring(struct net_device *dev) entry->OWN =1 ; } -if (entry) +if (entry) entry->EOR =1 ; }return 0 ;
@@ -2519,7 +2519,7 @@ void rtl8192_commit(struct net_device *dev)if (priv->up ==0 )return ; -rtllib_softmac_stop_protocol (priv->rtllib,0 , true); +rtllib_softmac_stop_protocol (priv->rtllib,0 , true);rtl8192_irq_disable (dev); priv->ops->stop_adapter (dev, true);_rtl8192_up (dev, false);
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +3 -3
@@ -84,7 +84,7 @@#define RTL_PCI_DEVICE (vend, dev, cfg) \ .vendor = (vend), .device = (dev), \ - .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID , \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \ .driver_data = (kernel_ulong_t)&(cfg)#define RTL_MAX_SCAN_SIZE 128
@@ -303,9 +303,9 @@ enum pci_bridge_vendor {PCI_BRIDGE_VENDOR_INTEL =0x0 ,PCI_BRIDGE_VENDOR_ATI ,PCI_BRIDGE_VENDOR_AMD , -PCI_BRIDGE_VENDOR_SIS , +PCI_BRIDGE_VENDOR_SIS ,PCI_BRIDGE_VENDOR_UNKNOWN , - PCI_BRIDGE_VENDOR_MAX , + PCI_BRIDGE_VENDOR_MAX, }; struct buffer {
drivers/staging/rtl8192e/rtllib_debug.h +1 -2
@@ -73,8 +73,7 @@ enum RTL_DEBUG { #define RT_TRACE(component, x, args...) \ do { \ if (rt_global_debug_component & component) \ - printk(KERN_DEBUG DRV_NAME ":" x "\n" , \ - ##args);\ + printk(KERN_DEBUG DRV_NAME ":" x "\n", ##args);\ } while (0)#define assert (expr) \
drivers/staging/rtl8192e/rtllib_rx.c +1 -1
@@ -469,7 +469,7 @@ static bool AddReorderEntry(struct rx_ts_record *pTS,void rtllib_indicate_packets (struct rtllib_device *ieee,struct rtllib_rxb **prxbIndicateArray,u8 index) {struct net_device_stats *stats = &ieee->stats; -u8 i =0 , j =0 ; +u8 i =0 , j =0 ;u16 ethertype;for (j =0 ; j < index; j++) {
Signature · 1 line
1.8.4.1
PATCH v2 5/21 staging: rtl8192e: Remove bb tx gains from r8192_priv
In reply to Mateusz Kulikowskir8192_priv structure had 2 big arrays with tx gain register values:
- cck_txbbgain_table
- cck_txbbgain_ch14_table
- txbbgain_table
This arrays were read-only - filled in driver init code and look like firmware/chip-specific.
This patch removes them from r8192_priv and puts them in (global) variables.
tx_bb_gain is also flattened - register values are stored in array; Amplification value can be calculated using dm_tx_bb_gain_idx_to_amplify().
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 5 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 14 - drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 674 +++++-------------------- drivers/staging/rtl8192e/rtl8192e/rtl_dm.h | 9 + 4 files changed, 151 insertions(+), 551 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +2 -3
@@ -918,8 +918,7 @@ start: tmpRegC =rtl8192_QueryBBReg (dev, rOFDM0_XCTxIQImbalance, bMaskDWord);for (i =0 ; i < TxBBGainTableLength; i++) { -if (tmpRegA == - priv->txbbgain_table[i].txbbgain_value) { +if (tmpRegA == dm_tx_bb_gain[i]) { priv->rfa_txpowertrackingindex = (u8 )i; priv->rfa_txpowertrackingindex_real = (u8 )i;
@@ -933,7 +932,7 @@ start: rCCK0_TxFilter1, bMaskByte2);for (i =0 ; i < CCKTxBBGainTableLength; i++) { -if (TempCCk == priv->cck_txbbgain_table[i].ccktxbb_valuearray[0 ]) { +if (TempCCk == dm_cck_tx_bb_gain[i][0 ]) { priv->CCKPresentAttentuation_20Mdefault = (u8 )i;break ; }
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -14
@@ -451,15 +451,6 @@ enum two_port_status {TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE }; -struct txbbgain_struct { -long txbb_iq_amplifygain; -u32 txbbgain_value; -}; - -struct ccktxbbgain { -u8 ccktxbb_valuearray[8 ]; -}; -struct init_gain {u8 xaagccore1;u8 xbagccore1;
@@ -567,11 +558,6 @@ struct r8192_priv {struct bb_reg_definition PHYRegDef[4 ];struct rate_adaptive rate_adaptive; -struct ccktxbbgain cck_txbbgain_table[CCKTxBBGainTableLength]; -struct ccktxbbgain cck_txbbgain_ch14_table[CCKTxBBGainTableLength]; - -struct txbbgain_struct txbbgain_table[TxBBGainTableLength]; -enum acm_method AcmMethod;struct rt_firmware *pFirmware;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +140 -534
773 lines not on this page · raw message
drivers/staging/rtl8192e/rtl8192e/rtl_dm.h +9 -0
@@ -252,11 +252,20 @@ extern u8 dm_shadow[16][256];extern struct drx_path_sel DM_RxPathSelTable;extern u8 test_flag; + +/* Pre-calculated gain tables */ +extern const u32 dm_tx_bb_gain[TxBBGainTableLength]; +extern const u8 dm_cck_tx_bb_gain[CCKTxBBGainTableLength][8 ]; +extern const u8 dm_cck_tx_bb_gain_ch14[CCKTxBBGainTableLength][8 ]; +/* Maps table index to iq amplify gain (dB, 12 to -24dB) */ +#define dm_tx_bb_gain_idx_to_amplify (idx) (-idx + 12) +/*------------------------Export global variable----------------------------*/ /*--------------------------Exported Function prototype---------------------*/ /*--------------------------Exported Function prototype---------------------*/ +extern void init_hal_dm (struct net_device *dev);extern void deinit_hal_dm (struct net_device *dev);
Signature · 1 line
1.8.4.1
PATCH v2 6/21 staging: rtl8192e: Fix LINE_SPACING warning
In reply to Mateusz KulikowskiTrivial fix - add newline in dm_InitializeTXPowerTracking_TSSI()
--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +1 -0
@@ -941,6 +941,7 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev) {struct r8192_priv *priv =rtllib_priv (dev); + priv->btxpower_tracking = true; priv->txpower_count =0 ; priv->btxpower_trackingInit = false;
Signature · 1 line
1.8.4.1
PATCH v2 7/21 staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtllib_parse_info_param()
In reply to Mateusz Kulikowski- Replace ?: with min_t
- Remove condition that is always true
--- drivers/staging/rtl8192e/rtllib_rx.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-)
drivers/staging/rtl8192e/rtllib_rx.c +8 -13
@@ -1924,13 +1924,12 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, info_element->data[2] == 0x4c && info_element->data[3] == 0x033) { - tmp_htcap_len =min_t (u8, info_element->len,MAX_IE_LEN ); -if (tmp_htcap_len !=0 ) { - network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; - network->bssht.bdHTCapLen = tmp_htcap_len >sizeof (network->bssht.bdHTCapBuf) ? -sizeof (network->bssht.bdHTCapBuf) : tmp_htcap_len; -memcpy (network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen); - } + tmp_htcap_len =min_t (u8, info_element->len,MAX_IE_LEN ); +if (tmp_htcap_len !=0 ) { + network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; + network->bssht.bdHTCapLen =min_t (u16, tmp_htcap_len,sizeof (network->bssht.bdHTCapBuf)); +memcpy (network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen); + } }if (tmp_htcap_len !=0 ) { network->bssht.bdSupportHT = true;
@@ -1951,12 +1950,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee, tmp_htinfo_len =min_t (u8, info_element->len,MAX_IE_LEN );if (tmp_htinfo_len !=0 ) { network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; -if (tmp_htinfo_len) { - network->bssht.bdHTInfoLen = tmp_htinfo_len >sizeof (network->bssht.bdHTInfoBuf) ? -sizeof (network->bssht.bdHTInfoBuf) : tmp_htinfo_len; -memcpy (network->bssht.bdHTInfoBuf, info_element->data, network->bssht.bdHTInfoLen); - } - + network->bssht.bdHTInfoLen =min_t (u16, tmp_htinfo_len,sizeof (network->bssht.bdHTInfoBuf)); +memcpy (network->bssht.bdHTInfoBuf, info_element->data, network->bssht.bdHTInfoLen); } }
Signature · 1 line
1.8.4.1
PATCH v2 8/21 staging: rtl8192e: Fix DEEP_INDENTATION warnings in rtl_dm.c
In reply to Mateusz KulikowskiSeparate parts of dm_TXPowerTrackingCallback_TSSI() into two new functions:
- dm_tx_update_tssi_weak_signal()
- dm_tx_update_tssi_strong_signal()
--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 180 +++++++++++++++-------------- 1 file changed, 95 insertions(+), 85 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +95 -85
@@ -542,6 +542,97 @@ static u8 CCKSwingTable_Ch14[CCK_Table_length][8] = {#define Tssi_Report_Value2 0x13e#define FW_Busy_Flag 0x13f +static void dm_tx_update_tssi_weak_signal (struct net_device *dev,u8 RF_Type) +{ +struct r8192_priv *p =rtllib_priv (dev); + +if (RF_Type ==RF_2T4R ) { +if ((p->rfa_txpowertrackingindex >0 ) && + (p->rfc_txpowertrackingindex >0 )) { + p->rfa_txpowertrackingindex--; +if (p->rfa_txpowertrackingindex_real >4 ) { + p->rfa_txpowertrackingindex_real--; +rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[p->rfa_txpowertrackingindex_real]); + } + + p->rfc_txpowertrackingindex--; +if (p->rfc_txpowertrackingindex_real >4 ) { + p->rfc_txpowertrackingindex_real--; +rtl8192_setBBreg (dev, + rOFDM0_XCTxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[p->rfc_txpowertrackingindex_real]); + } + }else { +rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[4 ]); +rtl8192_setBBreg (dev, + rOFDM0_XCTxIQImbalance, + bMaskDWord, dm_tx_bb_gain[4 ]); + } + }else { +if (p->rfa_txpowertrackingindex >0 ) { + p->rfa_txpowertrackingindex--; +if (p->rfa_txpowertrackingindex_real >4 ) { + p->rfa_txpowertrackingindex_real--; +rtl8192_setBBreg (dev, + rOFDM0_XATxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[p->rfa_txpowertrackingindex_real]); + } + }else { +rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, + bMaskDWord, dm_tx_bb_gain[4 ]); + } + } +} + +static void dm_tx_update_tssi_strong_signal (struct net_device *dev,u8 RF_Type) +{ +struct r8192_priv *p =rtllib_priv (dev); + +if (RF_Type ==RF_2T4R ) { +if ((p->rfa_txpowertrackingindex < TxBBGainTableLength -1 ) && + (p->rfc_txpowertrackingindex < TxBBGainTableLength -1 )) { + p->rfa_txpowertrackingindex++; + p->rfa_txpowertrackingindex_real++; +rtl8192_setBBreg (dev, + rOFDM0_XATxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[p->rfa_txpowertrackingindex_real]); + p->rfc_txpowertrackingindex++; + p->rfc_txpowertrackingindex_real++; +rtl8192_setBBreg (dev, + rOFDM0_XCTxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[p->rfc_txpowertrackingindex_real]); + }else { +rtl8192_setBBreg (dev, + rOFDM0_XATxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[TxBBGainTableLength -1 ]); +rtl8192_setBBreg (dev, rOFDM0_XCTxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[TxBBGainTableLength -1 ]); + } + }else { +if (p->rfa_txpowertrackingindex < (TxBBGainTableLength -1 )) { + p->rfa_txpowertrackingindex++; + p->rfa_txpowertrackingindex_real++; +rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[p->rfa_txpowertrackingindex_real]); + }else { +rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, + bMaskDWord, + dm_tx_bb_gain[TxBBGainTableLength -1 ]); + } + } +} +static void dm_TXPowerTrackingCallback_TSSI (struct net_device *dev) {struct r8192_priv *priv =rtllib_priv (dev);
@@ -672,92 +763,11 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) priv->CCKPresentAttentuation);return ; } -if (Avg_TSSI_Meas_from_driver < TSSI_13dBm -E_FOR_TX_POWER_TRACK ) { -if (RF_Type ==RF_2T4R ) { - -if ((priv->rfa_txpowertrackingindex >0 ) && - (priv->rfc_txpowertrackingindex >0 )) { - priv->rfa_txpowertrackingindex--; -if (priv->rfa_txpowertrackingindex_real >4 ) { - priv->rfa_txpowertrackingindex_real--; -rtl8192_setBBreg (dev, - rOFDM0_XATxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[priv->rfa_txpowertrackingindex_real]); - } - - priv->rfc_txpowertrackingindex--; -if (priv->rfc_txpowertrackingindex_real >4 ) { - priv->rfc_txpowertrackingindex_real--; -rtl8192_setBBreg (dev, - rOFDM0_XCTxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[priv->rfc_txpowertrackingindex_real]); - } - }else { -rtl8192_setBBreg (dev, - rOFDM0_XATxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[4 ]); -rtl8192_setBBreg (dev, - rOFDM0_XCTxIQImbalance, - bMaskDWord, dm_tx_bb_gain[4 ]); - } - }else { -if (priv->rfa_txpowertrackingindex >0 ) { - priv->rfa_txpowertrackingindex--; -if (priv->rfa_txpowertrackingindex_real >4 ) { - priv->rfa_txpowertrackingindex_real--; -rtl8192_setBBreg (dev, - rOFDM0_XATxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[priv->rfa_txpowertrackingindex_real]); - } - }else -rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, - bMaskDWord, dm_tx_bb_gain[4 ]); +if (Avg_TSSI_Meas_from_driver < TSSI_13dBm -E_FOR_TX_POWER_TRACK ) +dm_tx_update_tssi_weak_signal (dev, RF_Type); +else +dm_tx_update_tssi_strong_signal (dev, RF_Type); - } - }else { -if (RF_Type ==RF_2T4R ) { -if ((priv->rfa_txpowertrackingindex < - TxBBGainTableLength -1 ) && - (priv->rfc_txpowertrackingindex < - TxBBGainTableLength -1 )) { - priv->rfa_txpowertrackingindex++; - priv->rfa_txpowertrackingindex_real++; -rtl8192_setBBreg (dev, - rOFDM0_XATxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[priv->rfa_txpowertrackingindex_real]); - priv->rfc_txpowertrackingindex++; - priv->rfc_txpowertrackingindex_real++; -rtl8192_setBBreg (dev, - rOFDM0_XCTxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[priv->rfc_txpowertrackingindex_real]); - }else { -rtl8192_setBBreg (dev, - rOFDM0_XATxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[TxBBGainTableLength -1 ]); -rtl8192_setBBreg (dev, - rOFDM0_XCTxIQImbalance, - bMaskDWord, dm_tx_bb_gain[TxBBGainTableLength -1 ]); - } - }else { -if (priv->rfa_txpowertrackingindex < (TxBBGainTableLength -1 )) { - priv->rfa_txpowertrackingindex++; - priv->rfa_txpowertrackingindex_real++; -rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[priv->rfa_txpowertrackingindex_real]); - }else -rtl8192_setBBreg (dev, rOFDM0_XATxIQImbalance, - bMaskDWord, - dm_tx_bb_gain[TxBBGainTableLength -1 ]); - } - }if (RF_Type ==RF_2T4R ) { priv->CCKPresentAttentuation_difference = priv->rfa_txpowertrackingindex - priv->rfa_txpowertracking_default;
Signature · 1 line
1.8.4.1
PATCH v2 9/21 staging: rtl8192e: Fix DeviceID in rtl8192_pci_findadapter()
In reply to Mateusz Kulikowskirtl8192_pci_findadapter() was looking for invalid DeviceID (0x8172), instead of proper for rtl8192e/se devices (0x8192)
--- drivers/staging/rtl8192e/rtl8192e/rtl_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/rtl_pci.c +1 -1
@@ -62,7 +62,7 @@ bool rtl8192_pci_findadapter(struct pci_dev *pdev, struct net_device *dev) priv->card_8192 = priv->ops->nic_type; -if (DeviceID ==0x8172 ) { +if (DeviceID ==0x8192 ) {switch (RevisionID) {case HAL_HW_PCI_REVISION_ID_8192PCIE : dev_info(&pdev->dev,
Signature · 1 line
1.8.4.1
PATCH v2 10/21 staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned()
In reply to Mateusz Kulikowskirtl8192e driver uses memcpy() to copy hw addresses in several places. checkpatch.pl suggests to use ether_addr_copy(), but most of addresses in driver may be unaligned.
This patch replaces all memcpy occurences with single macro therby silencing checkpatch.pl (single complaints in macro remains).
--- drivers/staging/rtl8192e/rtl819x_BAProc.c | 12 ++--- drivers/staging/rtl8192e/rtllib.h | 3 ++ drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 18 +++---- drivers/staging/rtl8192e/rtllib_rx.c | 74 +++++++++++++++++----------- drivers/staging/rtl8192e/rtllib_softmac.c | 67 +++++++++++++------------ drivers/staging/rtl8192e/rtllib_softmac_wx.c | 5 +- drivers/staging/rtl8192e/rtllib_tx.c | 24 ++++----- 7 files changed, 113 insertions(+), 90 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +6 -6
@@ -103,10 +103,10 @@ static struct sk_buff *rtllib_ADDBA(struct rtllib_device *ieee, u8 *Dst, BAReq = (struct rtllib_hdr_3addr *)skb_put (skb,sizeof (struct rtllib_hdr_3addr )); -memcpy (BAReq->addr1, Dst,ETH_ALEN ); -memcpy (BAReq->addr2, ieee->dev->dev_addr,ETH_ALEN ); +ether_addr_copy_unaligned (BAReq->addr1, Dst); +ether_addr_copy_unaligned (BAReq->addr2, ieee->dev->dev_addr); -memcpy (BAReq->addr3, ieee->current_network.bssid,ETH_ALEN ); +ether_addr_copy_unaligned (BAReq->addr3, ieee->current_network.bssid); BAReq->frame_ctl =cpu_to_le16 (RTLLIB_STYPE_MANAGE_ACT ); tag = (u8 *)skb_put (skb,9 );
@@ -167,9 +167,9 @@ static struct sk_buff *rtllib_DELBA(struct rtllib_device *ieee, u8 *dst, Delba = (struct rtllib_hdr_3addr *)skb_put (skb,sizeof (struct rtllib_hdr_3addr )); -memcpy (Delba->addr1, dst,ETH_ALEN ); -memcpy (Delba->addr2, ieee->dev->dev_addr,ETH_ALEN ); -memcpy (Delba->addr3, ieee->current_network.bssid,ETH_ALEN ); +ether_addr_copy_unaligned (Delba->addr1, dst); +ether_addr_copy_unaligned (Delba->addr2, ieee->dev->dev_addr); +ether_addr_copy_unaligned (Delba->addr3, ieee->current_network.bssid); Delba->frame_ctl =cpu_to_le16 (RTLLIB_STYPE_MANAGE_ACT ); tag = (u8 *)skb_put (skb,6 );
drivers/staging/rtl8192e/rtllib.h +3 -0
@@ -2972,4 +2972,7 @@ extern void rtllib_TURBO_Info(struct rtllib_device *ieee, u8 **tag_p);#define MUTEX_UNLOCK_PRIV (pmutex) mutex_unlock(pmutex)#endif +/* TODO: replace with aligned calls where possible */ +#define ether_addr_copy_unaligned (dst, src) memcpy(dst, src, ETH_ALEN) +#endif /* RTLLIB_H */
drivers/staging/rtl8192e/rtllib_crypt_tkip.c +9 -9
@@ -532,20 +532,20 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr)switch (le16_to_cpu (hdr11->frame_ctl) & (RTLLIB_FCTL_FROMDS |RTLLIB_FCTL_TODS )) {case RTLLIB_FCTL_TODS : -memcpy (hdr, hdr11->addr3,ETH_ALEN );/* DA */ -memcpy (hdr +ETH_ALEN , hdr11->addr2,ETH_ALEN );/* SA */ +ether_addr_copy_unaligned (hdr, hdr11->addr3);/* DA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr2);/* SA */ break ;case RTLLIB_FCTL_FROMDS : -memcpy (hdr, hdr11->addr1,ETH_ALEN );/* DA */ -memcpy (hdr +ETH_ALEN , hdr11->addr3,ETH_ALEN );/* SA */ +ether_addr_copy_unaligned (hdr, hdr11->addr1);/* DA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr3);/* SA */ break ;case RTLLIB_FCTL_FROMDS |RTLLIB_FCTL_TODS : -memcpy (hdr, hdr11->addr3,ETH_ALEN );/* DA */ -memcpy (hdr +ETH_ALEN , hdr11->addr4,ETH_ALEN );/* SA */ +ether_addr_copy_unaligned (hdr, hdr11->addr3);/* DA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr4);/* SA */ break ;case 0 : -memcpy (hdr, hdr11->addr1,ETH_ALEN );/* DA */ -memcpy (hdr +ETH_ALEN , hdr11->addr2,ETH_ALEN );/* SA */ +ether_addr_copy_unaligned (hdr, hdr11->addr1);/* DA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr2);/* SA */ break ; }
@@ -598,7 +598,7 @@ static void rtllib_michael_mic_failure(struct net_device *dev,else ev.flags |=IW_MICFAILURE_PAIRWISE ; ev.src_addr.sa_family =ARPHRD_ETHER ; -memcpy (ev.src_addr.sa_data, hdr->addr2,ETH_ALEN ); +ether_addr_copy_unaligned (ev.src_addr.sa_data, hdr->addr2);memset (&wrqu,0 ,sizeof (wrqu)); wrqu.data.length =sizeof (ev);wireless_send_event (dev,IWEVMICHAELMICFAILURE , &wrqu, (char *) &ev);
drivers/staging/rtl8192e/rtllib_rx.c +45 -29
143 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_softmac.c +35 -32
152 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_softmac_wx.c +3 -2
@@ -160,7 +160,8 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,if (is_zero_ether_addr (temp->sa_data)) {spin_lock_irqsave (&ieee->lock, flags); -memcpy (ieee->current_network.bssid, temp->sa_data,ETH_ALEN ); +ether_addr_copy_unaligned (ieee->current_network.bssid, + temp->sa_data); ieee->wap_set =0 ;spin_unlock_irqrestore (&ieee->lock, flags); ret =-1 ;
@@ -177,7 +178,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,spin_lock_irqsave (&ieee->lock, flags); ieee->cannot_notify = false; -memcpy (ieee->current_network.bssid, temp->sa_data,ETH_ALEN ); +ether_addr_copy_unaligned (ieee->current_network.bssid, temp->sa_data); ieee->wap_set = !is_zero_ether_addr (temp->sa_data);spin_unlock_irqrestore (&ieee->lock, flags);
drivers/staging/rtl8192e/rtllib_tx.c +12 -12
@@ -608,8 +608,8 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) goto success; }/* Save source and destination addresses */ -memcpy (dest, skb->data,ETH_ALEN ); -memcpy (src, skb->data+ETH_ALEN ,ETH_ALEN ); +ether_addr_copy_unaligned (dest, skb->data); +ether_addr_copy_unaligned (src, skb->data+ETH_ALEN );memset (skb->cb,0 ,sizeof (skb->cb)); ether_type =ntohs (((struct ethhdr *)skb->data)->h_proto);
@@ -694,22 +694,22 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)/* To DS: Addr1 = BSSID, Addr2 = SA, * Addr3 = DA */ -memcpy (&header.addr1, ieee->current_network.bssid, -ETH_ALEN ); -memcpy (&header.addr2, &src,ETH_ALEN ); +ether_addr_copy_unaligned (&header.addr1, + ieee->current_network.bssid); +ether_addr_copy_unaligned (&header.addr2, &src);if (IsAmsdu) -memcpy (&header.addr3, - ieee->current_network.bssid,ETH_ALEN ); +ether_addr_copy_unaligned (&header.addr3, + ieee->current_network.bssid);else -memcpy (&header.addr3, &dest,ETH_ALEN ); +ether_addr_copy_unaligned (&header.addr3, &dest); }else if (ieee->iw_mode ==IW_MODE_ADHOC ) {/* not From/To DS: Addr1 = DA, Addr2 = SA, * Addr3 = BSSID */ -memcpy (&header.addr1, dest,ETH_ALEN ); -memcpy (&header.addr2, src,ETH_ALEN ); -memcpy (&header.addr3, ieee->current_network.bssid, -ETH_ALEN ); +ether_addr_copy_unaligned (&header.addr1, dest); +ether_addr_copy_unaligned (&header.addr2, src); +ether_addr_copy_unaligned (&header.addr3, + ieee->current_network.bssid); } bIsMulticast =is_multicast_ether_addr (header.addr1);
Signature · 1 line
1.8.4.1
Re: [PATCH v2 10/21] staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned()
Quoted 3 lines · Mateusz Kulikowski
rtl8192e driver uses
memcpy()to copy hw addresses in several places. checkpatch.pl suggests to useether_addr_copy(), but most of addresses in driver may be unaligned.
The pointer to the struct is normally aligned (or you are in trouble anyway and can't use it like a normal pointer). Then you can calculate the alignment of the struct member by looking at the struct.
BAReq->addr1 is part of struct rtllib_hdr_2addr. It's 4 bytes into the struct so it's fine.
I sort of like the ether_addr_copy_unaligned() macro because it would let us silence some checkpatch false positives because otherwise people will eventually introduce bugs like a dripping roof leak will eventually destroy a building. But it should be in the main kernel header with a name like that. And also this is misleading that we are using it for data which is aligned.
regards,
dan carpenter
Re: [PATCH v2 10/21] staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned()
Quoted 2 lines · Dan Carpenter
BAReq->addr1is part of structrtllib_hdr_2addr. It's 4 bytes into the struct so it's fine.
You're right - should I explicitly add __aligned() in such places or just leave comment in that case (for future commiters)?
Quoted 6 lines
I sort of like the
ether_addr_copy_unaligned()macro because it would let us silence some checkpatch false positives because otherwise people will eventually introduce bugs like a dripping roof leak will eventually destroy a building. But it should be in the main kernel header with a name like that. And also this is misleading that we are using it for data which is aligned.
Is it ok if I do following steps for v3:
- Align eth addresses that can be aligned (at least one structure - rtllib_rxb can't be aligned)
- Apply eth_addr_copy where possible
- Discuss and try to submit ether_addr_copy_unaligned on netdev list
- If they reject the change - rename macro to something less confusing (rtllib_something)
Regards and thanks for reviews,
Mateusz
Re: [PATCH v2 10/21] staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned()
Quoted 1 line · Mateusz Kulikowski
- Discuss and try to submit
ether_addr_copy_unalignedon netdev list
I've no issue with a patch that does that.
Greg KH
maintainerRe: [PATCH v2 10/21] staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned()
In reply to Mateusz KulikowskiQuoted 7 lines · Mateusz Kulikowski
rtl8192e driver uses
memcpy()to copy hw addresses in several places. checkpatch.pl suggests to useether_addr_copy(), but most of addresses in driver may be unaligned.
This patch replaces all memcpy occurences with single macro therby silencing checkpatch.pl (single complaints in macro remains).Signed-off-by Mateusz Kulikowski <[email protected]>
Quoted 9 lines
--- drivers/staging/rtl8192e/rtl819x_BAProc.c | 12 ++--- drivers/staging/rtl8192e/rtllib.h | 3 ++ drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 18 +++---- drivers/staging/rtl8192e/rtllib_rx.c | 74 +++++++++++++++++----------- drivers/staging/rtl8192e/rtllib_softmac.c | 67 +++++++++++++------------ drivers/staging/rtl8192e/rtllib_softmac_wx.c | 5 +- drivers/staging/rtl8192e/rtllib_tx.c | 24 ++++----- 7 files changed, 113 insertions(+), 90 deletions(-)
I've stopped applying here, no need to resend the first 9 of these patches for your next round.
thanks,
greg k-h
Re: [PATCH v2 10/21] staging: rtl8192e: replace memcpy() -> ether_addr_copy_unaligned()
Hi,
Quoted 18 lines · Greg KH
Quoted 7 lines · Mateusz Kulikowski
rtl8192e driver uses
memcpy()to copy hw addresses in several places. checkpatch.pl suggests to useether_addr_copy(), but most of addresses in driver may be unaligned.
This patch replaces all memcpy occurences with single macro therby silencing checkpatch.pl (single complaints in macro remains).Signed-off-by Mateusz Kulikowski <[email protected]>Quoted 9 lines
--- drivers/staging/rtl8192e/rtl819x_BAProc.c | 12 ++--- drivers/staging/rtl8192e/rtllib.h | 3 ++ drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 18 +++---- drivers/staging/rtl8192e/rtllib_rx.c | 74 +++++++++++++++++----------- drivers/staging/rtl8192e/rtllib_softmac.c | 67 +++++++++++++------------ drivers/staging/rtl8192e/rtllib_softmac_wx.c | 5 +- drivers/staging/rtl8192e/rtllib_tx.c | 24 ++++----- 7 files changed, 113 insertions(+), 90 deletions(-)
Quoted 2 lines
I've stopped applying here, no need to resend the first 9 of these patches for your next round.
Thanks,
I was afraid you applied whole changeset by accident.
I'm working on v3 (a bit slowly due to holidays/work) - hopefully will post it this/next week.
Regards,
Mateusz
PATCH v2 11/21 staging: rtl8192e: Fix DEEP_INDENTATION warning in rtllib_parse_info_param()
In reply to Mateusz KulikowskiMove MFIE_TYPE_GENERIC handler to rtllib_parse_mife_generic() function. Code was not altered significantly, therefore in some places it generates LONG_LINE checkpatch.pl warnings.
--- drivers/staging/rtl8192e/rtllib_rx.c | 365 +++++++++++++++++------------------ 1 file changed, 178 insertions(+), 187 deletions(-)
drivers/staging/rtl8192e/rtllib_rx.c +178 -187
@@ -1747,6 +1747,181 @@ static inline void rtllib_extract_country_ie( } +static void rtllib_parse_mife_generic (struct rtllib_device *ieee, +struct rtllib_info_element *info_element, +struct rtllib_network *network, +u16 *tmp_htcap_len, +u16 *tmp_htinfo_len) +{ +u16 ht_realtek_agg_len =0 ; +u8 ht_realtek_agg_buf[MAX_IE_LEN ]; + +if (!rtllib_parse_qos_info_param_IE (info_element, network)) +return ; + +if (info_element->len >=4 && + info_element->data[0 ] ==0x00 && info_element->data[1 ] ==0x50 && + info_element->data[2 ] ==0xf2 && info_element->data[3 ] ==0x01 ) { + network->wpa_ie_len =min (info_element->len +2 , +MAX_WPA_IE_LEN ); +memcpy (network->wpa_ie, info_element, network->wpa_ie_len); +return ; + } + +if (info_element->len ==7 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0xe0 && info_element->data[2 ] ==0x4c && + info_element->data[3 ] ==0x01 && info_element->data[4 ] ==0x02 ) + network->Turbo_Enable =1 ; + +if (*tmp_htcap_len ==0 ) { +if (info_element->len >=4 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x90 && + info_element->data[2 ] ==0x4c && + info_element->data[3 ] ==0x033 ) { + *tmp_htcap_len =min_t (u8, info_element->len,MAX_IE_LEN ); +if (*tmp_htcap_len !=0 ) { + network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; + network->bssht.bdHTCapLen =min_t (u16, *tmp_htcap_len,sizeof (network->bssht.bdHTCapBuf)); +memcpy (network->bssht.bdHTCapBuf, + info_element->data, + network->bssht.bdHTCapLen); + } + } +if (*tmp_htcap_len !=0 ) { + network->bssht.bdSupportHT = true; + network->bssht.bdHT1R = ((((struct ht_capab_ele *)(network->bssht.bdHTCapBuf))->MCS[1 ]) ==0 ); + }else { + network->bssht.bdSupportHT = false; + network->bssht.bdHT1R = false; + } + } + + +if (*tmp_htinfo_len ==0 ) { +if (info_element->len >=4 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x90 && + info_element->data[2 ] ==0x4c && + info_element->data[3 ] ==0x034 ) { + *tmp_htinfo_len =min_t (u8, info_element->len, +MAX_IE_LEN ); +if (*tmp_htinfo_len !=0 ) { + network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; + network->bssht.bdHTInfoLen =min_t (u16, *tmp_htinfo_len,sizeof (network->bssht.bdHTInfoBuf)); +memcpy (network->bssht.bdHTInfoBuf, + info_element->data, + network->bssht.bdHTInfoLen); + } + + } + } + +if (ieee->aggregation) { +if (network->bssht.bdSupportHT) { +if (info_element->len >=4 && + info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0xe0 && + info_element->data[2 ] ==0x4c && + info_element->data[3 ] ==0x02 ) { + ht_realtek_agg_len =min_t (u8, + info_element->len, +MAX_IE_LEN ); +memcpy (ht_realtek_agg_buf, info_element->data, + info_element->len); + } +if (ht_realtek_agg_len >=5 ) { + network->realtek_cap_exit = true; + network->bssht.bdRT2RTAggregation = true; + +if ((ht_realtek_agg_buf[4 ] ==1 ) && + (ht_realtek_agg_buf[5 ] &0x02 )) + network->bssht.bdRT2RTLongSlotTime = true; + +if ((ht_realtek_agg_buf[4 ] ==1 ) && + (ht_realtek_agg_buf[5 ] &RT_HT_CAP_USE_92SE )) + network->bssht.RT2RT_HT_Mode |=RT_HT_CAP_USE_92SE ; + } + } +if (ht_realtek_agg_len >=5 ) { +if ((ht_realtek_agg_buf[5 ] &RT_HT_CAP_USE_SOFTAP )) + network->bssht.RT2RT_HT_Mode |=RT_HT_CAP_USE_SOFTAP ; + } + } + +if ((info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x05 && info_element->data[2 ] ==0xb5 ) || + (info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x0a && info_element->data[2 ] ==0xf7 ) || + (info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x10 && info_element->data[2 ] ==0x18 )) { + network->broadcom_cap_exist = true; + } + +if (info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x0c && info_element->data[2 ] ==0x43 ) + network->ralink_cap_exist = true; + +if ((info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x03 && info_element->data[2 ] ==0x7f ) || + (info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x13 && info_element->data[2 ] ==0x74 )) + network->atheros_cap_exist = true; + +if ((info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x50 && info_element->data[2 ] ==0x43 )) + network->marvell_cap_exist = true; + +if (info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x40 && info_element->data[2 ] ==0x96 ) + network->cisco_cap_exist = true; + +if (info_element->len >=3 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x0a && info_element->data[2 ] ==0xf5 ) + network->airgo_cap_exist = true; + +if (info_element->len >4 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x40 && info_element->data[2 ] ==0x96 && + info_element->data[3 ] ==0x01 ) { +if (info_element->len ==6 ) { +memcpy (network->CcxRmState, &info_element[4 ],2 ); +if (network->CcxRmState[0 ] !=0 ) + network->bCcxRmEnable = true; +else + network->bCcxRmEnable = false; + network->MBssidMask = network->CcxRmState[1 ] &0x07 ; +if (network->MBssidMask !=0 ) { + network->bMBssidValid = true; + network->MBssidMask =0xff << (network->MBssidMask); +ether_addr_copy_unaligned (network->MBssid, + network->bssid); + network->MBssid[5 ] &= network->MBssidMask; + }else { + network->bMBssidValid = false; + } + }else { + network->bCcxRmEnable = false; + } + } +if (info_element->len >4 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x40 && info_element->data[2 ] ==0x96 && + info_element->data[3 ] ==0x03 ) { +if (info_element->len ==5 ) { + network->bWithCcxVerNum = true; + network->BssCcxVerNumber = info_element->data[4 ]; + }else { + network->bWithCcxVerNum = false; + network->BssCcxVerNumber =0 ; + } + } +if (info_element->len >4 && info_element->data[0 ] ==0x00 && + info_element->data[1 ] ==0x50 && info_element->data[2 ] ==0xf2 && + info_element->data[3 ] ==0x04 ) { +RTLLIB_DEBUG_MGMT ("MFIE_TYPE_WZC: %d bytes\n" , + info_element->len); + network->wzc_ie_len =min (info_element->len+2 ,MAX_WZC_IE_LEN ); +memcpy (network->wzc_ie, info_element, network->wzc_ie_len); + } +} + int rtllib_parse_info_param(struct rtllib_device *ieee, struct rtllib_info_element *info_element, u16 length,
@@ -1757,8 +1932,6 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,short offset;u16 tmp_htcap_len =0 ;u16 tmp_htinfo_len =0 ; -u16 ht_realtek_agg_len =0 ; -u8 ht_realtek_agg_buf[MAX_IE_LEN ];char rates_str[64 ];char *p;
@@ -1911,191 +2084,9 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,case MFIE_TYPE_GENERIC :RTLLIB_DEBUG_MGMT ("MFIE_TYPE_GENERIC: %d bytes\n" , info_element->len); -if (!rtllib_parse_qos_info_param_IE (info_element, - network)) -break ; -if (info_element->len >=4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x50 && - info_element->data[2 ] ==0xf2 && - info_element->data[3 ] ==0x01 ) { - network->wpa_ie_len =min (info_element->len +2 , -MAX_WPA_IE_LEN ); -memcpy (network->wpa_ie, info_element, - network->wpa_ie_len); -break ; - } -if (info_element->len ==7 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0xe0 && - info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x01 && - info_element->data[4 ] ==0x02 ) - network->Turbo_Enable =1 ; - -if (tmp_htcap_len ==0 ) { -if (info_element->len >=4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x90 && - info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x033 ) { - - tmp_htcap_len =min_t (u8, info_element->len,MAX_IE_LEN ); -if (tmp_htcap_len !=0 ) { - network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; - network->bssht.bdHTCapLen =min_t (u16, tmp_htcap_len,sizeof (network->bssht.bdHTCapBuf)); -memcpy (network->bssht.bdHTCapBuf, info_element->data, network->bssht.bdHTCapLen); - } - } -if (tmp_htcap_len !=0 ) { - network->bssht.bdSupportHT = true; - network->bssht.bdHT1R = ((((struct ht_capab_ele *)(network->bssht.bdHTCapBuf))->MCS[1 ]) ==0 ); - }else { - network->bssht.bdSupportHT = false; - network->bssht.bdHT1R = false; - } - } - - -if (tmp_htinfo_len ==0 ) { -if (info_element->len >=4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x90 && - info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x034 ) { - tmp_htinfo_len =min_t (u8, info_element->len,MAX_IE_LEN ); -if (tmp_htinfo_len !=0 ) { - network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; - network->bssht.bdHTInfoLen =min_t (u16, tmp_htinfo_len,sizeof (network->bssht.bdHTInfoBuf)); -memcpy (network->bssht.bdHTInfoBuf, info_element->data, network->bssht.bdHTInfoLen); - } - - } - } - -if (ieee->aggregation) { -if (network->bssht.bdSupportHT) { -if (info_element->len >=4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0xe0 && - info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x02 ) { - ht_realtek_agg_len =min_t (u8, info_element->len,MAX_IE_LEN ); -memcpy (ht_realtek_agg_buf, info_element->data, info_element->len); - } -if (ht_realtek_agg_len >=5 ) { - network->realtek_cap_exit = true; - network->bssht.bdRT2RTAggregation = true; - -if ((ht_realtek_agg_buf[4 ] ==1 ) && (ht_realtek_agg_buf[5 ] &0x02 )) - network->bssht.bdRT2RTLongSlotTime = true; - -if ((ht_realtek_agg_buf[4 ] ==1 ) && (ht_realtek_agg_buf[5 ] &RT_HT_CAP_USE_92SE )) - network->bssht.RT2RT_HT_Mode |=RT_HT_CAP_USE_92SE ; - } - } -if (ht_realtek_agg_len >=5 ) { -if ((ht_realtek_agg_buf[5 ] &RT_HT_CAP_USE_SOFTAP )) - network->bssht.RT2RT_HT_Mode |=RT_HT_CAP_USE_SOFTAP ; - } - } - -if ((info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x05 && - info_element->data[2 ] ==0xb5 ) || - (info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x0a && - info_element->data[2 ] ==0xf7 ) || - (info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x10 && - info_element->data[2 ] ==0x18 )) { - network->broadcom_cap_exist = true; - } -if (info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x0c && - info_element->data[2 ] ==0x43 ) - network->ralink_cap_exist = true; -if ((info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x03 && - info_element->data[2 ] ==0x7f ) || - (info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x13 && - info_element->data[2 ] ==0x74 )) - network->atheros_cap_exist = true; - -if ((info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x50 && - info_element->data[2 ] ==0x43 )) - network->marvell_cap_exist = true; -if (info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x40 && - info_element->data[2 ] ==0x96 ) - network->cisco_cap_exist = true; - - -if (info_element->len >=3 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x0a && - info_element->data[2 ] ==0xf5 ) - network->airgo_cap_exist = true; - -if (info_element->len >4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x40 && - info_element->data[2 ] ==0x96 && - info_element->data[3 ] ==0x01 ) { -if (info_element->len ==6 ) { -memcpy (network->CcxRmState, &info_element[4 ],2 ); -if (network->CcxRmState[0 ] !=0 ) - network->bCcxRmEnable = true; -else - network->bCcxRmEnable = false; - network->MBssidMask = network->CcxRmState[1 ] &0x07 ; -if (network->MBssidMask !=0 ) { - network->bMBssidValid = true; - network->MBssidMask =0xff << (network->MBssidMask); -ether_addr_copy_unaligned (network->MBssid, network->bssid); - network->MBssid[5 ] &= network->MBssidMask; - }else { - network->bMBssidValid = false; - } - }else { - network->bCcxRmEnable = false; - } - } -if (info_element->len >4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x40 && - info_element->data[2 ] ==0x96 && - info_element->data[3 ] ==0x03 ) { -if (info_element->len ==5 ) { - network->bWithCcxVerNum = true; - network->BssCcxVerNumber = info_element->data[4 ]; - }else { - network->bWithCcxVerNum = false; - network->BssCcxVerNumber =0 ; - } - } -if (info_element->len >4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x50 && - info_element->data[2 ] ==0xf2 && - info_element->data[3 ] ==0x04 ) { -RTLLIB_DEBUG_MGMT ("MFIE_TYPE_WZC: %d bytes\n" , - info_element->len); - network->wzc_ie_len =min (info_element->len+2 , -MAX_WZC_IE_LEN ); -memcpy (network->wzc_ie, info_element, - network->wzc_ie_len); - } +rtllib_parse_mife_generic (ieee, info_element, network, + &tmp_htcap_len, + &tmp_htinfo_len);break ;case MFIE_TYPE_RSN :
Signature · 1 line
1.8.4.1
PATCH v2 12/21 staging: rtl8192e: replace memcmp() with ether_addr_equal_unaligned()
In reply to Mateusz KulikowskiUse dedicated macro to compare ethernet addresses in probe_rq_parse().
--- drivers/staging/rtl8192e/rtllib_softmac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/rtl8192e/rtllib_softmac.c +2 -1
@@ -1853,7 +1853,8 @@ static short probe_rq_parse(struct rtllib_device *ieee, struct sk_buff *skb,return -1 ;/* corrupted */ bssid_match = - (memcmp (header->addr3, ieee->current_network.bssid,ETH_ALEN ) !=0 ) && + (!ether_addr_equal_unaligned (header->addr3, + ieee->current_network.bssid)) && (!is_broadcast_ether_addr (header->addr3));if (bssid_match)return -1 ;
Signature · 1 line
1.8.4.1
PATCH v2 13/21 staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
In reply to Mateusz KulikowskiFix most of remaining PREFER_PR_LEVEL warnings in rtllib. Replace printk() with pr_* where possible.
--- drivers/staging/rtl8192e/rtllib.h | 4 +- drivers/staging/rtl8192e/rtllib_crypt.c | 17 ++++---- drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 59 +++++++++++----------------- drivers/staging/rtl8192e/rtllib_rx.c | 4 +- 4 files changed, 34 insertions(+), 50 deletions(-)
drivers/staging/rtl8192e/rtllib.h +2 -2
@@ -685,13 +685,13 @@ extern u32 rtllib_debug_level; #define RTLLIB_DEBUG(level, fmt, args...) \ do { \ if (rtllib_debug_level & (level)) \ - printk(KERN_DEBUG "rtllib: " fmt, ## args); \ + pr_debug("rtllib: " fmt, ## args); \ } while (0)#define RTLLIB_DEBUG_DATA (level, data, datalen) \ do { \ if ((rtllib_debug_level & (level)) == (level)) { \ - printk(KERN_DEBUG "rtllib: %s()\n", __func__); \ + pr_debug("rtllib: %s()\n", __func__); \ print_hex_dump_bytes(KERN_DEBUG, DUMP_PREFIX_NONE, \ data, datalen); \ } \
drivers/staging/rtl8192e/rtllib_crypt.c +7 -10
@@ -62,9 +62,8 @@ void rtllib_crypt_deinit_handler(unsigned long data)spin_lock_irqsave (info->lock, flags);rtllib_crypt_deinit_entries (info,0 );if (!list_empty (&info->crypt_deinit_list)) { -printk (KERN_DEBUG -"%s: entries remaining in delayed crypt deletion list\n" , - info->name); +pr_debug ("%s: entries remaining in delayed crypt deletion list\n" , + info->name); info->crypt_deinit_timer.expires = jiffies +HZ ;add_timer (&info->crypt_deinit_timer); }
@@ -118,8 +117,7 @@ int rtllib_register_crypto_ops(struct lib80211_crypto_ops *ops)list_add (&alg->list, &hcrypt->algs);spin_unlock_irqrestore (&hcrypt->lock, flags); -printk (KERN_DEBUG "rtllib_crypt: registered algorithm '%s'\n" , - ops->name); +pr_debug ("rtllib_crypt: registered algorithm '%s'\n" , ops->name);return 0 ; }
@@ -147,8 +145,8 @@ int rtllib_unregister_crypto_ops(struct lib80211_crypto_ops *ops)spin_unlock_irqrestore (&hcrypt->lock, flags);if (del_alg) { -printk (KERN_DEBUG "rtllib_crypt: unregistered algorithm '%s'\n" , - ops->name); +pr_debug ("rtllib_crypt: unregistered algorithm '%s'\n" , + ops->name);kfree (del_alg); }
@@ -239,9 +237,8 @@ void __exit rtllib_crypto_deinit(void)struct rtllib_crypto_alg *alg = (struct rtllib_crypto_alg *) ptr;list_del (ptr); -printk (KERN_DEBUG -"rtllib_crypt: unregistered algorithm '%s' (deinit)\n" , - alg->ops->name); +pr_debug ("rtllib_crypt: unregistered algorithm '%s' (deinit)\n" , + alg->ops->name);kfree (alg); }
drivers/staging/rtl8192e/rtllib_crypt_tkip.c +23 -36
128 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_rx.c +2 -2
@@ -344,8 +344,8 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb, res = crypt->ops->decrypt_msdu (skb, keyidx, hdrlen, crypt->priv);atomic_dec (&crypt->refcnt);if (res <0 ) { -printk (KERN_DEBUG "%s: MSDU decryption/MIC verification failed (SA= %pM keyidx=%d)\n" , - ieee->dev->name, hdr->addr2, keyidx); +pr_debug ("%s: MSDU decryption/MIC verification failed (SA= %pM keyidx=%d)\n" , + ieee->dev->name, hdr->addr2, keyidx);return -1 ; }
Signature · 1 line
1.8.4.1
Re: [PATCH v2 13/21] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
Quoted 21 lines · Mateusz Kulikowski
Fix most of remaining
PREFER_PR_LEVELwarnings in rtllib. Replaceprintk()with pr_* where possible.Signed-off-by Mateusz Kulikowski <[email protected]>--- drivers/staging/rtl8192e/rtllib.h | 4 +- drivers/staging/rtl8192e/rtllib_crypt.c | 17 ++++---- drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 59 +++++++++++----------------- drivers/staging/rtl8192e/rtllib_rx.c | 4 +- 4 files changed, 34 insertions(+), 50 deletions(-)drivers/staging/rtl8192e/rtllib.h +1
-1@@ -685,13 +685,13 @@ extern u32 rtllib_debug_level; #define RTLLIB_DEBUG(level, fmt, args...) \ do { \ if (rtllib_debug_level & (level)) \ - printk(KERN_DEBUG "rtllib: " fmt, ## args); \ + pr_debug("rtllib: " fmt, ## args); \
drivers/staging/rtl8192e/rtllib.h extern u32 rtllib_debug_level; · line 697
Quoted 10 lines
drivers/staging/rtl8192e/rtllib.h +1
-1} while (0)#define RTLLIB_DEBUG_DATA (level, data, datalen) \ do { \ if ((rtllib_debug_level & (level)) == (level)) { \ - printk(KERN_DEBUG "rtllib: %s()\n", __func__); \ + pr_debug("rtllib: %s()\n", __func__); \ print_hex_dump_bytes(KERN_DEBUG, DUMP_PREFIX_NONE, \ data, datalen); \ } \
We've made it slightly more tricky to turn on these debug statements.
I don't think that's a big problem. I don't think anyone cares about them. They are just noise is my guess.
regards,
dan carpenter
Re: [PATCH v2 13/21] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
Quoted 3 lines · Dan Carpenter
Quoted 2 lines · Mateusz Kulikowski
Fix most of remaining
PREFER_PR_LEVELwarnings in rtllib. Replaceprintk()with pr_* where possible.
(...)
Quoted 11 lines
drivers/staging/rtl8192e/rtllib.h extern u32 rtllib_debug_level; · line 697
Quoted 8 lines
#define
RTLLIB_DEBUG_DATA(level, data, datalen)\drivers/staging/rtl8192e/rtllib.h +1
-1do { \ if ((rtllib_debug_level & (level)) == (level)) { \ - printk(KERN_DEBUG "rtllib: %s()\n", __func__); \ + pr_debug("rtllib: %s()\n", __func__); \ print_hex_dump_bytes(KERN_DEBUG, DUMP_PREFIX_NONE, \ data, datalen); \ } \We've made it slightly more tricky to turn on these debug statements.
Quoted 2 lines
I don't think that's a big problem. I don't think anyone cares about them. They are just noise is my guess.
I agree that lot of the debug messages in that driver are garbage;
Proposal for v3:
- throw away all garbage messages (like "==========>__func__\n"),
- use proper print functions (and loglevels) for remaining RTLLIB_ debug messages (possibly reword them)
- throw away RTLLIB_DEBUG and RTLLIB_DEBUG_DATA macros (i.e. whole RTL 'logging' mechanism)
Most of the messages will stay on DEBUG loglevel, so will not bother "normal" users.
Does it sound good?
Regards,
Mateusz
Re: [PATCH v2 13/21] staging: rtl8192e: Fix PREFER_PR_LEVEL warnings
In reply to Mateusz KulikowskiAlso these should be netdev_dbg or some crap.
regards,
dan carpenter
PATCH v2 14/21 staging: rtl8192e: Fix LONG_LINE warnings
In reply to Mateusz KulikowskiFix most of simple LONG_LINE warnings. None of the changes should affect behaviour of code, so several modifications are included in this patch:
- Code is reindented where needed
- Local variable names are compacted (priv -> p)
- Unnecessary casts are removed
- Nested ifs are replaced with logical and
- a = b = c = d expressions are split
- Replace if/then series with clamp_t()
- Removed unneeded scopes
--- drivers/staging/rtl8192e/dot11d.h | 4 +- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 22 +- .../staging/rtl8192e/rtl8192e/r8192E_firmware.c | 29 ++- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 4 +- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 3 +- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 191 +++++++++++------- drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 3 +- drivers/staging/rtl8192e/rtl819x_HTProc.c | 3 +- drivers/staging/rtl8192e/rtl819x_TSProc.c | 21 +- drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 12 +- drivers/staging/rtl8192e/rtllib_rx.c | 222 +++++++++++++-------- drivers/staging/rtl8192e/rtllib_softmac.c | 39 ++-- drivers/staging/rtl8192e/rtllib_tx.c | 41 ++-- drivers/staging/rtl8192e/rtllib_wx.c | 4 +- 14 files changed, 356 insertions(+), 242 deletions(-)
drivers/staging/rtl8192e/dot11d.h +2 -2
@@ -74,8 +74,8 @@ static inline void cpMacAddr(unsigned char *des, unsigned char *src) (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)#define IS_EQUAL_CIE_SRC (__pIeeeDev, __pTa) \ - ether_addr_equal_unaligned(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, \ - __pTa) + ether_addr_equal_unaligned( \ + GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)#define UPDATE_CIE_SRC (__pIeeeDev, __pTa) \ cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +11 -11
@@ -30,7 +30,8 @@#include "rtl_dm.h" #include "rtl_wx.h" -static int WDCAPARA_ADD [] = {EDCAPARA_BE ,EDCAPARA_BK ,EDCAPARA_VI ,EDCAPARA_VO }; +static int WDCAPARA_ADD [] = {EDCAPARA_BE ,EDCAPARA_BK ,EDCAPARA_VI , +EDCAPARA_VO };void rtl8192e_start_beacon (struct net_device *dev) {
@@ -187,22 +188,21 @@ void rtl8192e_SetHwReg(struct net_device *dev, u8 variable, u8 *val)u8 u1bAIFS;u32 u4bAcParam;u8 mode = priv->rtllib->mode; -struct rtllib_qos_parameters *qos_parameters = +struct rtllib_qos_parameters *qop = &priv->rtllib->current_network.qos_data.parameters; - u1bAIFS = qos_parameters->aifs[pAcParam] * + u1bAIFS = qop->aifs[pAcParam] * ((mode&(IEEE_G |IEEE_N_24G )) ?9 :20 ) + aSifsTime;dm_init_edca_turbo (dev); - u4bAcParam = (((le16_to_cpu ( - qos_parameters->tx_op_limit[pAcParam])) << -AC_PARAM_TXOP_LIMIT_OFFSET ) | - ((le16_to_cpu (qos_parameters->cw_max[pAcParam])) << -AC_PARAM_ECW_MAX_OFFSET ) | - ((le16_to_cpu (qos_parameters->cw_min[pAcParam])) << -AC_PARAM_ECW_MIN_OFFSET ) | - (((u32 )u1bAIFS) <<AC_PARAM_AIFS_OFFSET )); + u4bAcParam = (le16_to_cpu (qop->tx_op_limit[pAcParam]) << +AC_PARAM_TXOP_LIMIT_OFFSET ) | + ((le16_to_cpu (qop->cw_max[pAcParam])) << +AC_PARAM_ECW_MAX_OFFSET ) | + ((le16_to_cpu (qop->cw_min[pAcParam])) << +AC_PARAM_ECW_MIN_OFFSET ) | + (((u32 )u1bAIFS) <<AC_PARAM_AIFS_OFFSET );RT_TRACE (COMP_DBG ,"%s():HW_VAR_AC_PARAM eACI:%x:%x\n" , __func__, eACI, u4bAcParam);
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +14 -15
@@ -230,7 +230,7 @@ bool init_firmware(struct net_device *dev)u32 file_length =0 ;u8 *mapped_file =NULL ; -u8 init_step =0 ; +u8 i =0 ;enum opt_rst_type rst_opt =OPT_SYSTEM_RESET ;enum firmware_init_step starting_state =FW_INIT_STEP0_BOOT ;
@@ -250,10 +250,9 @@ bool init_firmware(struct net_device *dev) "PlatformInitFirmware: undefined firmware state\n"); } -for (init_step = starting_state; init_step <=FW_INIT_STEP2_DATA ; - init_step++) { +for (i = starting_state; i <=FW_INIT_STEP2_DATA ; i++) {if (rst_opt ==OPT_SYSTEM_RESET ) { -if (pfirmware->firmware_buf_size[init_step] ==0 ) { +if (pfirmware->firmware_buf_size[i] ==0 ) {const char *fw_name[3 ] = {RTL8192E_BOOT_IMG_FW , RTL8192E_MAIN_IMG_FW,
@@ -263,7 +262,7 @@ bool init_firmware(struct net_device *dev)int rc; rc =request_firmware (&fw_entry, - fw_name[init_step], + fw_name[i], &priv->pdev->dev);if (rc <0 ) { RT_TRACE(COMP_FIRMWARE,
@@ -271,24 +270,24 @@ bool init_firmware(struct net_device *dev) goto download_firmware_fail; }if (fw_entry->size > -sizeof (pfirmware->firmware_buf[init_step])) { +sizeof (pfirmware->firmware_buf[i])) {RT_TRACE (COMP_FIRMWARE ,"img file size exceed the container struct buffer fail!\n" ); goto download_firmware_fail; } -if (init_step !=FW_INIT_STEP1_MAIN ) { -memcpy (pfirmware->firmware_buf[init_step], +if (i !=FW_INIT_STEP1_MAIN ) { +memcpy (pfirmware->firmware_buf[i], fw_entry->data, fw_entry->size); - pfirmware->firmware_buf_size[init_step] = + pfirmware->firmware_buf_size[i] = fw_entry->size; }else { -memset (pfirmware->firmware_buf[init_step], +memset (pfirmware->firmware_buf[i],0 ,128 ); -memcpy (&pfirmware->firmware_buf[init_step][128 ], +memcpy (&pfirmware->firmware_buf[i][128 ], fw_entry->data, fw_entry->size); - pfirmware->firmware_buf_size[init_step] = + pfirmware->firmware_buf_size[i] = fw_entry->size +128 ; }
@@ -297,14 +296,14 @@ bool init_firmware(struct net_device *dev) } } - mapped_file = pfirmware->firmware_buf[init_step]; - file_length = pfirmware->firmware_buf_size[init_step]; + mapped_file = pfirmware->firmware_buf[i]; + file_length = pfirmware->firmware_buf_size[i]; rt_status =fw_download_code (dev, mapped_file, file_length);if (!rt_status) goto download_firmware_fail; -if (!firmware_check_ready (dev, init_step)) +if (!firmware_check_ready (dev, i)) goto download_firmware_fail; }
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +2 -2
@@ -628,8 +628,8 @@ void rtl8192_phy_getTxPower(struct net_device *dev) priv->DefaultInitialGain[3 ] =read_nic_byte (dev, rOFDM0_XDAGCCore1);RT_TRACE (COMP_INIT ,"Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x)\n" , - priv->DefaultInitialGain[0 ], priv->DefaultInitialGain[1 ], - priv->DefaultInitialGain[2 ], priv->DefaultInitialGain[3 ]); + priv->DefaultInitialGain[0 ], priv->DefaultInitialGain[1 ], + priv->DefaultInitialGain[2 ], priv->DefaultInitialGain[3 ]); priv->framesync =read_nic_byte (dev, rOFDM0_RxDetector3); priv->framesyncC34 =read_nic_dword (dev, rOFDM0_RxDetector2);
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +1 -2
@@ -2066,8 +2066,7 @@ static short rtl8192_alloc_rx_desc_ring(struct net_device *dev)int i, rx_queue_idx;for (rx_queue_idx =0 ; rx_queue_idx <MAX_RX_QUEUE ; rx_queue_idx++) { - priv->rx_ring[rx_queue_idx] = -pci_zalloc_consistent (priv->pdev, + priv->rx_ring[rx_queue_idx] =pci_zalloc_consistent (priv->pdev,sizeof (*priv->rx_ring[rx_queue_idx]) * priv->rxringcount, &priv->rx_ring_dma[rx_queue_idx]); if (!priv->rx_ring[rx_queue_idx] ||
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +116 -75
377 lines not on this page · raw message
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +2 -1
@@ -613,7 +613,8 @@ static int r8192_wx_set_nick(struct net_device *dev,if (wrqu->data.length >IW_ESSID_MAX_SIZE )return -E2BIG ;down (&priv->wx_sem); - wrqu->data.length =min_t (size_t, wrqu->data.length,sizeof (priv->nick)); + wrqu->data.length =min_t (size_t, wrqu->data.length, +sizeof (priv->nick));memset (priv->nick,0 ,sizeof (priv->nick));memcpy (priv->nick, extra, wrqu->data.length);up (&priv->wx_sem);
drivers/staging/rtl8192e/rtl819x_HTProc.c +2 -1
@@ -237,7 +237,8 @@ static bool HTIOTActIsDisableMCSTwoSpatialStream(struct rtllib_device *ieee)return false; } -static u8 HTIOTActIsDisableEDCATurbo (struct rtllib_device *ieee,u8 *PeerMacAddr) +static u8 HTIOTActIsDisableEDCATurbo (struct rtllib_device *ieee, +u8 *PeerMacAddr) {return false; }
drivers/staging/rtl8192e/rtl819x_TSProc.c +12 -9
@@ -49,8 +49,10 @@ static void RxPktPendingTimeout(unsigned long data)if (index ==0 ) pRxTs->RxIndicateSeq = pReorderEntry->SeqNum; -if (SN_LESS (pReorderEntry->SeqNum, pRxTs->RxIndicateSeq) || -SN_EQUAL (pReorderEntry->SeqNum, pRxTs->RxIndicateSeq)) { +if (SN_LESS (pReorderEntry->SeqNum, + pRxTs->RxIndicateSeq) || +SN_EQUAL (pReorderEntry->SeqNum, + pRxTs->RxIndicateSeq)) {list_del_init (&pReorderEntry->List); if (SN_EQUAL(pReorderEntry->SeqNum,
@@ -91,7 +93,8 @@ static void RxPktPendingTimeout(unsigned long data)if (bPktInBuf && (pRxTs->RxTimeoutIndicateSeq ==0xffff )) { pRxTs->RxTimeoutIndicateSeq = pRxTs->RxIndicateSeq;mod_timer (&pRxTs->RxPktPendingTimer, jiffies + -msecs_to_jiffies (ieee->pHTInfo->RxReorderPendingTime)); +msecs_to_jiffies (ieee->pHTInfo->RxReorderPendingTime) + ); }spin_unlock_irqrestore (&(ieee->reorder_spinlock), flags); }
@@ -269,10 +272,10 @@ static struct ts_common_info *SearchAdmitTRStream(struct rtllib_device *ieee,if (!search_dir[dir])continue ;list_for_each_entry (pRet, psearch_list, List) { -if (memcmp (pRet->Addr, Addr,6 ) ==0 ) -if (pRet->TSpec.f.TSInfo.field.ucTSID ==TID ) -if (pRet->TSpec.f.TSInfo.field.ucDirection == dir) -break ; +if (memcmp (pRet->Addr, Addr,6 ) ==0 && + pRet->TSpec.f.TSInfo.field.ucTSID ==TID && + pRet->TSpec.f.TSInfo.field.ucDirection == dir) +break ; }if (&pRet->List != psearch_list)
@@ -419,8 +422,8 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,return false; } -static void RemoveTsEntry (struct rtllib_device *ieee,struct ts_common_info *pTs, -enum tr_select TxRxSelect) +static void RemoveTsEntry (struct rtllib_device *ieee, +struct ts_common_info *pTs,enum tr_select TxRxSelect) {del_timer_sync (&pTs->SetupTimer);del_timer_sync (&pTs->InactTimer);
drivers/staging/rtl8192e/rtllib_crypt_tkip.c +6 -6
@@ -425,8 +425,8 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) tkey->initialized) {if (net_ratelimit ()) {pr_debug ("TKIP: replay detected: STA= %pM previous TSC %08x%04x received TSC %08x%04x\n" , - hdr->addr2, tkey->rx_iv32, tkey->rx_iv16, - iv32, iv16); + hdr->addr2, tkey->rx_iv32, + tkey->rx_iv16, iv32, iv16); } tkey->dot11RSNAStatsTKIPReplays++;return -4 ;
@@ -523,19 +523,19 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) (RTLLIB_FCTL_FROMDS | RTLLIB_FCTL_TODS)) {case RTLLIB_FCTL_TODS :ether_addr_copy_unaligned (hdr, hdr11->addr3);/* DA */ -ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr2);/* SA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr2);/*SA*/ break ;case RTLLIB_FCTL_FROMDS :ether_addr_copy_unaligned (hdr, hdr11->addr1);/* DA */ -ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr3);/* SA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr3);/*SA*/ break ;case RTLLIB_FCTL_FROMDS |RTLLIB_FCTL_TODS :ether_addr_copy_unaligned (hdr, hdr11->addr3);/* DA */ -ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr4);/* SA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr4);/*SA*/ break ;case 0 :ether_addr_copy_unaligned (hdr, hdr11->addr1);/* DA */ -ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr2);/* SA */ +ether_addr_copy_unaligned (hdr +ETH_ALEN , hdr11->addr2);/*SA*/ break ; }
drivers/staging/rtl8192e/rtllib_rx.c +141 -81
524 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_softmac.c +24 -15
@@ -271,9 +271,10 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct rtllib_device *ieee) ieee->seq_ctrl[0 ]++;/* check whether the managed packet queued greater than 5 */ -if (!ieee->check_nic_enough_desc (ieee->dev, tcb_desc->queue_index) || - (skb_queue_len (&ieee->skb_waitQ[tcb_desc->queue_index]) !=0 ) || - (ieee->queue_stop)) { +if (!ieee->check_nic_enough_desc (ieee->dev, + tcb_desc->queue_index) || +skb_queue_len (&ieee->skb_waitQ[tcb_desc->queue_index]) || + ieee->queue_stop) {/* insert the skb packet to the management queue * * as for the completion function, it does not need
@@ -1483,7 +1484,8 @@ static void rtllib_associate_step1(struct rtllib_device *ieee, u8 *daddr) } } -static void rtllib_auth_challenge (struct rtllib_device *ieee,u8 *challenge,int chlen) +static void rtllib_auth_challenge (struct rtllib_device *ieee,u8 *challenge, +int chlen) {u8 *c;struct sk_buff *skb;
@@ -1502,7 +1504,8 @@ static void rtllib_auth_challenge(struct rtllib_device *ieee, u8 *challenge, int *(c++) = chlen;memcpy (c, challenge, chlen); -RTLLIB_DEBUG_MGMT ("Sending authentication challenge response\n" ); +RTLLIB_DEBUG_MGMT ("Sending authentication challenge response\n" + );rtllib_encrypt_fragment (ieee, skb,sizeof (struct rtllib_hdr_3addr ));
@@ -1739,7 +1742,7 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee,/* Join the network for the first time */ ieee->AsocRetryCount =0 ;if ((ieee->current_network.qos_data.supported ==1 ) && - ieee->current_network.bssht.bdSupportHT) + ieee->current_network.bssht.bdSupportHT)HTResetSelfAndSavePeerSetting (ieee, &(ieee->current_network));else
@@ -1754,14 +1757,19 @@ inline void rtllib_softmac_new_net(struct rtllib_device *ieee, &ieee->associate_procedure_wq, 0); }else {if (rtllib_is_54g (&ieee->current_network) && - (ieee->modulation &RTLLIB_OFDM_MODULATION )) { + (ieee->modulation & +RTLLIB_OFDM_MODULATION )) { ieee->rate =108 ; - ieee->SetWirelessMode (ieee->dev,IEEE_G ); -netdev_info (ieee->dev,"Using G rates\n" ); + ieee->SetWirelessMode (ieee->dev, +IEEE_G ); +netdev_info (ieee->dev, +"Using G rates\n" ); }else { ieee->rate =22 ; - ieee->SetWirelessMode (ieee->dev,IEEE_B ); -netdev_info (ieee->dev,"Using B rates\n" ); + ieee->SetWirelessMode (ieee->dev, +IEEE_B ); +netdev_info (ieee->dev, +"Using B rates\n" ); }memset (ieee->dot11HTOperationalRateSet,0 ,16 ); ieee->state =RTLLIB_LINKED ;
@@ -2023,7 +2031,7 @@ static short rtllib_sta_ps_sleep(struct rtllib_device *ieee, u64 *time)if (ieee->bAwakePktSent) { pPSC->LPSAwakeIntvl =1 ; }else { -u8 MaxPeriod =1 ; +u8 MaxPeriod =1 ;if (pPSC->LPSAwakeIntvl ==0 ) pPSC->LPSAwakeIntvl =1 ;
@@ -2194,7 +2202,8 @@ void rtllib_ps_tx_ack(struct rtllib_device *ieee, short success) }EXPORT_SYMBOL (rtllib_ps_tx_ack); -static void rtllib_process_action (struct rtllib_device *ieee,struct sk_buff *skb) +static void rtllib_process_action (struct rtllib_device *ieee, +struct sk_buff *skb) {struct rtllib_hdr_3addr *header = (struct rtllib_hdr_3addr *) skb->data;u8 *act =rtllib_get_payload ((struct rtllib_hdr *)header);
@@ -3680,8 +3689,8 @@ static void rtllib_MgntDisconnectIBSS(struct rtllib_device *rtllib) } -static void rtllib_MlmeDisassociateRequest (struct rtllib_device *rtllib,u8 *asSta, -u8 asRsn) +static void rtllib_MlmeDisassociateRequest (struct rtllib_device *rtllib, +u8 *asSta,u8 asRsn) {u8 i;u8 OpMode;
drivers/staging/rtl8192e/rtllib_tx.c +21 -20
54 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_wx.c +2 -2
@@ -282,8 +282,8 @@ int rtllib_wx_get_scan(struct rtllib_device *ieee, info); else RTLLIB_DEBUG_SCAN("Not showing network '%s ( %pM)' due to age (%lums).\n", -escape_essid (network->ssid, - network->ssid_len), +escape_essid (network->ssid, + network->ssid_len), network->bssid, (jiffies - network->last_scanned) / (HZ / 100)); }
Signature · 1 line
1.8.4.1
PATCH v2 15/21 staging: rtl8192e: Fix LONG_LINE warnings - modify variables
In reply to Mateusz KulikowskiFurther reduction of checkpatch.pl LONG_LINE warnings:
- Local variables are compacted where it's needed
- Helper (local) variables are used (to avoid expressions like a.b.c.d.e)
Both changes should be optimized out by compilers.dd
--- .../staging/rtl8192e/rtl8192e/r8192E_firmware.c | 13 +- drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 45 +-- drivers/staging/rtl8192e/rtl8192e/rtl_cam.c | 53 ++- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 397 +++++++++++---------- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- drivers/staging/rtl8192e/rtllib_softmac.c | 123 +++---- drivers/staging/rtl8192e/rtllib_tx.c | 28 +- 7 files changed, 344 insertions(+), 317 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_firmware.c +7 -6
@@ -36,6 +36,7 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u32 buffer_len) {struct r8192_priv *priv =rtllib_priv (dev); +struct rtllib_device *rt = priv->rtllib;u16 frag_threshold;u16 frag_length, frag_offset =0 ;int i;
@@ -80,15 +81,15 @@ static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, tcb_desc->txbuf_size = (u16 )i;skb_put (skb, i); -if (!priv->rtllib->check_nic_enough_desc (dev, tcb_desc->queue_index) || - (!skb_queue_empty (&priv->rtllib->skb_waitQ[tcb_desc->queue_index])) || - (priv->rtllib->queue_stop)) { +if (!rt->check_nic_enough_desc (dev, tcb_desc->queue_index) || + !skb_queue_empty (&rt->skb_waitQ[tcb_desc->queue_index]) || + rt->queue_stop) {RT_TRACE (COMP_FIRMWARE ,"===================> tx full!\n" ); -skb_queue_tail (&priv->rtllib->skb_waitQ - [tcb_desc->queue_index], skb); +skb_queue_tail (&rt->skb_waitQ[tcb_desc->queue_index], + skb); }else { - priv->rtllib->softmac_hard_start_xmit (skb, dev); + rt->softmac_hard_start_xmit (skb, dev); } code_virtual_address += frag_length;
drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c +23 -22
65 lines not on this page · raw message
drivers/staging/rtl8192e/rtl8192e/rtl_cam.c +21 -32
104 lines not on this page · raw message
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +218 -179
663 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_rx.c +1 -1
@@ -1721,7 +1721,7 @@ static int rtllib_parse_qos_info_param_IE(struct rtllib_info_elementstruct rtllib_qos_parameter_info param_element; rc =rtllib_read_qos_param_element (¶m_element, - info_element); + info_element);if (rc ==0 ) {rtllib_qos_convert_ac_to_parameters (¶m_element, &(network->qos_data));
drivers/staging/rtl8192e/rtllib_softmac.c +59 -64
226 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_tx.c +15 -13
@@ -326,8 +326,12 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee, } goto FORCED_AGG_SETTING; }else if (pTxTs->bUsingBa == false) { -if (SN_LESS (pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum, - (pTxTs->TxCurSeq+1 )%4096 )) +union sequence_control *seq_ctl; + + seq_ctl = &pTxTs->TxAdmittedBARecord.BaStartSeqCtrl; + +if (SN_LESS (seq_ctl->field.SeqNum, + (pTxTs->TxCurSeq+1 ) %4096 )) pTxTs->bUsingBa = true;else goto FORCED_AGG_SETTING;
@@ -567,6 +571,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) {struct rtllib_device *ieee = (struct rtllib_device *)netdev_priv_rsl (dev); +struct rtllib_network *curr_net = &ieee->current_network;struct rtllib_txb *txb =NULL ;struct rtllib_hdr_3addrqos *frag_hdr;int i, bytes_per_frag, nr_frags, bytes_last_frag, frag_size;
@@ -581,7 +586,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) .qos_ctl = 0 };u8 dest[ETH_ALEN ], src[ETH_ALEN ]; -int qos_actived = ieee->current_network.qos_data.active; +int qos_actived = curr_net->qos_data.active;struct lib80211_crypt_data *crypt =NULL ;struct cb_desc *tcb_desc;u8 bIsMulticast = false;
@@ -652,8 +657,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)netdev_info (ieee->dev,"=================>DHCP Protocol start tx ARP pkt!!\n" ); bdhcp = true; - ieee->LPSDelayCnt = - ieee->current_network.tim.tim_count; + ieee->LPSDelayCnt = curr_net->tim.tim_count; } }
@@ -696,11 +700,11 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)* Addr3 = DA */ ether_addr_copy_unaligned (&header.addr1, - ieee->current_network.bssid); + curr_net->bssid);ether_addr_copy_unaligned (&header.addr2, &src);if (IsAmsdu)ether_addr_copy_unaligned (&header.addr3, - ieee->current_network.bssid); + curr_net->bssid);else ether_addr_copy_unaligned (&header.addr3, &dest); }else if (ieee->iw_mode ==IW_MODE_ADHOC ) {
@@ -710,7 +714,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)ether_addr_copy_unaligned (&header.addr1, dest);ether_addr_copy_unaligned (&header.addr2, src);ether_addr_copy_unaligned (&header.addr3, - ieee->current_network.bssid); + curr_net->bssid); } bIsMulticast =is_multicast_ether_addr (header.addr1);
@@ -833,11 +837,9 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev) bytes = bytes_last_frag; }if ((qos_actived) && (!bIsMulticast)) { - frag_hdr->seq_ctl = -cpu_to_le16 (rtllib_query_seqnum (ieee, skb_frag, - header.addr1)); - frag_hdr->seq_ctl = -cpu_to_le16 (le16_to_cpu (frag_hdr->seq_ctl)<<4 | i); +u16 t =rtllib_query_seqnum (ieee, skb_frag, + header.addr1); + frag_hdr->seq_ctl =cpu_to_le16 (t <<4 | i); }else { frag_hdr->seq_ctl =cpu_to_le16 (ieee->seq_ctrl[0 ]<<4 | i);
Signature · 1 line
1.8.4.1
Re: [PATCH v2 15/21] staging: rtl8192e: Fix LONG_LINE warnings - modify variables
Quoted 9 lines · Mateusz Kulikowski
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +4
-0@@ -557,43 +559,43 @@ static u8 CCKSwingTable_Ch14[CCK_Table_length][8] = {static void dm_tx_update_tssi_weak_signal (struct net_device *dev,u8 RF_Type) {struct r8192_priv *p =rtllib_priv (dev); +u8 *rfa_pti = &p->rfa_txpowertrackingindex; +u8 *rfc_pti = &p->rfc_txpowertrackingindex; +u8 *rfa_pti_r = &p->rfa_txpowertrackingindex_real; +u8 *rfc_pti_r = &p->rfc_txpowertrackingindex_real;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c static u8 CCKSwingTable_Ch14[CCK_Table_length][8] = { · line 571
Quoted 10 lines
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +4
-5if (RF_Type ==RF_2T4R ) { -if ((p->rfa_txpowertrackingindex >0 ) && - (p->rfc_txpowertrackingindex >0 )) { - p->rfa_txpowertrackingindex--; -if (p->rfa_txpowertrackingindex_real >4 ) { - p->rfa_txpowertrackingindex_real--; +if ((*rfa_pti >0 ) && (*rfc_pti >0 )) { + (*rfa_pti)--; +if (*rfa_pti_r >4 ) { + (*rfa_pti_r)--;
Honestly, I thought that patch 14 was too hard to review and did too many things, but this one is kind of ridiculous.
- p->rfa_txpowertrackingindex--;
+ (*rfa_pti)--;
The new version is fewer characters but it's way more complicated to think about. Just rename rfa_txpowertrackingindex to something reasonable. It's a stupid name, because it_hasninegazillionwordsinit and it's too long.
"rfa_pti_r" is a terrible name as well. it_also_hngwit_for_realz.
I'm not going to review the rest of this patch.
regards,
dan carpenter
Re: [PATCH v2 15/21] staging: rtl8192e: Fix LONG_LINE warnings - modify variables
Quoted 11 lines · Dan Carpenter
Review
Quoted 2 lines · Mateusz Kulikowski
(quoted diff) +2
-0+ if (*rfa_pti_r > 4) { + (*rfa_pti_r)--;Honestly, I thought that patch 14 was too hard to review and did too many things, but this one is kind of ridiculous.
(quoted diff) +1
-1- p->rfa_txpowertrackingindex--; + (*rfa_pti)--;
Quoted 6 lines
The new version is fewer characters but it's way more complicated to think about. Just rename
rfa_txpowertrackingindexto something reasonable. It's a stupid name, becauseit_hasninegazillionwordsinitand it's too long."
rfa_pti_r" is a terrible name as well.it_also_hngwit_for_realz.
True, but it's also used as local variable in one-screen function; Nevertheless - I got the point.
Quoted 1 line
I'm not going to review the rest of this patch.
Thanks for the patience, I will try to split such commits more in future.
As for v3 I assume patches 15, 19, 20 should be reworked; I will:
- Try to find better names for structure members where possible (this mostly applies to r8192_priv members),
- Do exactly one type of cleanup 'operation' in each commit (this means fixing one LONG_LINE warning may take more than one commit)
- Avoid playing with pointers like above
- Standardize local variable names in all functions (i.e. if I use igain as init_gain pointer, I'll do it like that everywhere)
Is it enough or did I missed something?
Regards,
Mateusz
PATCH v2 16/21 staging: rtl8192e: Fix LONG_LING in rtllib_parse_info_param()
In reply to Mateusz KulikowskiTake out MIFE_TYPE_HT_CAP processing into separate function - rtllib_parse_mfie_ht_cap()
--- drivers/staging/rtl8192e/rtllib_rx.c | 50 +++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 21 deletions(-)
drivers/staging/rtl8192e/rtllib_rx.c +29 -21
@@ -1980,6 +1980,33 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, } } +static void rtllib_parse_mfie_ht_cap (struct rtllib_info_element *info_element, +struct rtllib_network *network, +u16 *tmp_htcap_len) +{ +struct bss_ht *ht = &network->bssht; + + *tmp_htcap_len =min_t (u8, info_element->len,MAX_IE_LEN ); +if (*tmp_htcap_len !=0 ) { + ht->bdHTSpecVer =HT_SPEC_VER_EWC ; + ht->bdHTCapLen =min_t (u16, *tmp_htcap_len, +sizeof (ht->bdHTCapBuf)); +memcpy (ht->bdHTCapBuf, info_element->data, ht->bdHTCapLen); + + ht->bdSupportHT = true; + ht->bdHT1R = ((((struct ht_capab_ele *) + ht->bdHTCapBuf))->MCS[1 ]) ==0 ; + + ht->bdBandWidth = (enum ht_channel_width ) + (((struct ht_capab_ele *) + (ht->bdHTCapBuf))->ChlWidth); + }else { + ht->bdSupportHT = false; + ht->bdHT1R = false; + ht->bdBandWidth =HT_CHANNEL_WIDTH_20 ; + } +} + int rtllib_parse_info_param(struct rtllib_device *ieee, struct rtllib_info_element *info_element, u16 length,
@@ -2160,27 +2187,8 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,case MFIE_TYPE_HT_CAP :RTLLIB_DEBUG_SCAN ("MFIE_TYPE_HT_CAP: %d bytes\n" , info_element->len); - tmp_htcap_len =min_t (u8, info_element->len,MAX_IE_LEN ); -if (tmp_htcap_len !=0 ) { - network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; - network->bssht.bdHTCapLen = tmp_htcap_len >sizeof (network->bssht.bdHTCapBuf) ? -sizeof (network->bssht.bdHTCapBuf) : tmp_htcap_len; -memcpy (network->bssht.bdHTCapBuf, - info_element->data, - network->bssht.bdHTCapLen); - - network->bssht.bdSupportHT = true; - network->bssht.bdHT1R = ((((struct ht_capab_ele *) - network->bssht.bdHTCapBuf))->MCS[1 ]) ==0 ; - - network->bssht.bdBandWidth = (enum ht_channel_width ) - (((struct ht_capab_ele *) - (network->bssht.bdHTCapBuf))->ChlWidth); - }else { - network->bssht.bdSupportHT = false; - network->bssht.bdHT1R = false; - network->bssht.bdBandWidth =HT_CHANNEL_WIDTH_20 ; - } +rtllib_parse_mfie_ht_cap (info_element, network, + &tmp_htcap_len);break ;
Signature · 1 line
1.8.4.1
PATCH v2 17/21 staging: rtl8192e: Fix LONG_LINE warnings (conditions)
In reply to Mateusz KulikowskiRework some conditions to bail out of functions faster therby decreasing overall indent. This patch should not cause any negative side effect (except for different execution time).
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 8 +- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 197 +++++++++++++------------ drivers/staging/rtl8192e/rtllib_rx.c | 99 +++++++------ drivers/staging/rtl8192e/rtllib_softmac.c | 128 ++++++++-------- 4 files changed, 216 insertions(+), 216 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +4 -4
@@ -932,10 +932,10 @@ start: rCCK0_TxFilter1, bMaskByte2);for (i =0 ; i < CCKTxBBGainTableLength; i++) { -if (TempCCk == dm_cck_tx_bb_gain[i][0 ]) { - priv->CCKPresentAttentuation_20Mdefault = (u8 )i; -break ; - } +if (TempCCk != dm_cck_tx_bb_gain[i][0 ]) +continue ; + priv->CCKPresentAttentuation_20Mdefault = (u8 )i; +break ; } priv->CCKPresentAttentuation_40Mdefault =0 ; priv->CCKPresentAttentuation_difference =0 ;
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +99 -98
227 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_rx.c +50 -49
114 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib_softmac.c +63 -65
142 lines not on this page · raw message
Signature · 1 line
1.8.4.1
PATCH v2 18/21 staging: rtl8192e: fix LONG_LINE warnings - replace ?: expressions
In reply to Mateusz KulikowskiReplace temporary conditional (?:) with ordinary condition or max_t.
--- drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 30 +++++++++++++++++++++--------- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- 2 files changed, 22 insertions(+), 10 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +21 -9
@@ -403,17 +403,29 @@ static void dm_check_rate_adaptive(struct net_device *dev) ((bshort_gi_enabled) ?BIT31 :0 );if (pra->ratr_state ==DM_RATR_STA_HIGH ) { - HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 ) ? - (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); + HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; +if (priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 ) + LowRSSIThreshForRA = + pra->low_rssi_thresh_for_ra40M; +else + LowRSSIThreshForRA = + pra->low_rssi_thresh_for_ra20M; }else if (pra->ratr_state ==DM_RATR_STA_LOW ) { - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 ) ? - (pra->low2high_rssi_thresh_for_ra40M) : (pra->low2high_rssi_thresh_for_ra20M); + HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; +if (priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 ) + LowRSSIThreshForRA = + pra->low2high_rssi_thresh_for_ra40M; +else + LowRSSIThreshForRA = + pra->low2high_rssi_thresh_for_ra20M; }else { - HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; - LowRSSIThreshForRA = (priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 ) ? - (pra->low_rssi_thresh_for_ra40M) : (pra->low_rssi_thresh_for_ra20M); + HighRSSIThreshForRA = pra->high_rssi_thresh_for_ra; +if (priv->CurrentChannelBW !=HT_CHANNEL_WIDTH_20 ) + LowRSSIThreshForRA = + pra->low_rssi_thresh_for_ra40M; +else + LowRSSIThreshForRA = + pra->low_rssi_thresh_for_ra20M; } if (priv->undecorated_smoothed_pwdb >=
drivers/staging/rtl8192e/rtllib_rx.c +1 -1
@@ -1687,7 +1687,7 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info qos_param->aifs[aci] = (ac_params->aci_aifsn) &0x0f ;/* WMM spec P.11: The minimum value for AIFSN shall be 2 */ - qos_param->aifs[aci] = (qos_param->aifs[aci] <2 ) ?2 : qos_param->aifs[aci]; + qos_param->aifs[aci] =max_t (u8, qos_param->aifs[aci],2 ); qos_param->cw_min[aci] =cpu_to_le16 (ac_params->ecw_min_max &0x0F );
Signature · 1 line
1.8.4.1
PATCH v2 19/21 staging: rtl8192e: Fix LONG_LINE in rtllib_parse_mife_generic()
In reply to Mateusz KulikowskiSimplify function to make checkpatch.pl happy. Changes:
- Helper variables used
- Local variable names compacted
- Conditions were rephrased to return quickly (and decrease indent).
--- drivers/staging/rtl8192e/rtllib_rx.c | 170 +++++++++++++++++------------------ 1 file changed, 85 insertions(+), 85 deletions(-)
drivers/staging/rtl8192e/rtllib_rx.c +85 -85
@@ -1806,141 +1806,141 @@ static inline void rtllib_extract_country_ie( }static void rtllib_parse_mife_generic (struct rtllib_device *ieee, -struct rtllib_info_element *info_element, +struct rtllib_info_element *info,struct rtllib_network *network,u16 *tmp_htcap_len,u16 *tmp_htinfo_len) {u16 ht_realtek_agg_len =0 ;u8 ht_realtek_agg_buf[MAX_IE_LEN ]; +struct bss_ht *bssht = &network->bssht; -if (!rtllib_parse_qos_info_param_IE (info_element, network)) +if (!rtllib_parse_qos_info_param_IE (info, network))return ; -if (info_element->len >=4 && - info_element->data[0 ] ==0x00 && info_element->data[1 ] ==0x50 && - info_element->data[2 ] ==0xf2 && info_element->data[3 ] ==0x01 ) { - network->wpa_ie_len =min (info_element->len +2 , -MAX_WPA_IE_LEN ); -memcpy (network->wpa_ie, info_element, network->wpa_ie_len); +if (info->len >=4 && + info->data[0 ] ==0x00 && info->data[1 ] ==0x50 && + info->data[2 ] ==0xf2 && info->data[3 ] ==0x01 ) { + network->wpa_ie_len =min (info->len +2 ,MAX_WPA_IE_LEN ); +memcpy (network->wpa_ie, info, network->wpa_ie_len);return ; } -if (info_element->len ==7 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0xe0 && info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x01 && info_element->data[4 ] ==0x02 ) +if (info->len ==7 && + info->data[0 ] ==0x00 && info->data[1 ] ==0xe0 && + info->data[2 ] ==0x4c && info->data[3 ] ==0x01 && + info->data[4 ] ==0x02 ) network->Turbo_Enable =1 ;if (*tmp_htcap_len ==0 ) { -if (info_element->len >=4 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x90 && - info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x033 ) { - *tmp_htcap_len =min_t (u8, info_element->len,MAX_IE_LEN ); +if (info->len >=4 && + info->data[0 ] ==0x00 && info->data[1 ] ==0x90 && + info->data[2 ] ==0x4c && info->data[3 ] ==0x33 ) { + *tmp_htcap_len =min_t (u8, info->len,MAX_IE_LEN );if (*tmp_htcap_len !=0 ) { - network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; - network->bssht.bdHTCapLen =min_t (u16, *tmp_htcap_len,sizeof (network->bssht.bdHTCapBuf)); -memcpy (network->bssht.bdHTCapBuf, - info_element->data, - network->bssht.bdHTCapLen); + bssht->bdHTSpecVer =HT_SPEC_VER_EWC ; + bssht->bdHTCapLen =min_t (u16, *tmp_htcap_len, +sizeof (bssht->bdHTCapBuf)); +memcpy (bssht->bdHTCapBuf, info->data, + bssht->bdHTCapLen); } }if (*tmp_htcap_len !=0 ) { - network->bssht.bdSupportHT = true; - network->bssht.bdHT1R = ((((struct ht_capab_ele *)(network->bssht.bdHTCapBuf))->MCS[1 ]) ==0 ); + bssht->bdSupportHT = true; + bssht->bdHT1R = ((((struct ht_capab_ele *) + (bssht->bdHTCapBuf))->MCS[1 ]) ==0 ); }else { - network->bssht.bdSupportHT = false; - network->bssht.bdHT1R = false; + bssht->bdSupportHT = false; + bssht->bdHT1R = false; } }if (*tmp_htinfo_len ==0 ) { -if (info_element->len >=4 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x90 && - info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x034 ) { - *tmp_htinfo_len =min_t (u8, info_element->len, -MAX_IE_LEN ); +if (info->len >=4 && info->data[0 ] ==0x00 && + info->data[1 ] ==0x90 && + info->data[2 ] ==0x4c && + info->data[3 ] ==0x034 ) { + *tmp_htinfo_len =min_t (u8, info->len,MAX_IE_LEN );if (*tmp_htinfo_len !=0 ) { - network->bssht.bdHTSpecVer =HT_SPEC_VER_EWC ; - network->bssht.bdHTInfoLen =min_t (u16, *tmp_htinfo_len,sizeof (network->bssht.bdHTInfoBuf)); -memcpy (network->bssht.bdHTInfoBuf, - info_element->data, - network->bssht.bdHTInfoLen); + bssht->bdHTSpecVer =HT_SPEC_VER_EWC ; + bssht->bdHTInfoLen =min_t (u16, *tmp_htinfo_len, +sizeof (bssht->bdHTInfoBuf)); +memcpy (bssht->bdHTInfoBuf, info->data, + bssht->bdHTInfoLen); } } }if (ieee->aggregation) { -if (network->bssht.bdSupportHT) { -if (info_element->len >=4 && - info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0xe0 && - info_element->data[2 ] ==0x4c && - info_element->data[3 ] ==0x02 ) { - ht_realtek_agg_len =min_t (u8, - info_element->len, +if (bssht->bdSupportHT) { +if (info->len >=4 && + info->data[0 ] ==0x00 && info->data[1 ] ==0xe0 && + info->data[2 ] ==0x4c && info->data[3 ] ==0x02 ) { + ht_realtek_agg_len =min_t (u8, info->len,MAX_IE_LEN ); -memcpy (ht_realtek_agg_buf, info_element->data, - info_element->len); +memcpy (ht_realtek_agg_buf, info->data, + info->len); }if (ht_realtek_agg_len >=5 ) { network->realtek_cap_exit = true; - network->bssht.bdRT2RTAggregation = true; + bssht->bdRT2RTAggregation = true;if ((ht_realtek_agg_buf[4 ] ==1 ) && (ht_realtek_agg_buf[5 ] &0x02 )) - network->bssht.bdRT2RTLongSlotTime = true; + bssht->bdRT2RTLongSlotTime = true;if ((ht_realtek_agg_buf[4 ] ==1 ) && - (ht_realtek_agg_buf[5 ] &RT_HT_CAP_USE_92SE )) - network->bssht.RT2RT_HT_Mode |=RT_HT_CAP_USE_92SE ; + (ht_realtek_agg_buf[5 ] & +RT_HT_CAP_USE_92SE )) + bssht->RT2RT_HT_Mode |= +RT_HT_CAP_USE_92SE ; } }if (ht_realtek_agg_len >=5 ) {if ((ht_realtek_agg_buf[5 ] &RT_HT_CAP_USE_SOFTAP )) - network->bssht.RT2RT_HT_Mode |=RT_HT_CAP_USE_SOFTAP ; + bssht->RT2RT_HT_Mode |=RT_HT_CAP_USE_SOFTAP ; } } -if ((info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x05 && info_element->data[2 ] ==0xb5 ) || - (info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x0a && info_element->data[2 ] ==0xf7 ) || - (info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x10 && info_element->data[2 ] ==0x18 )) { +/* For all capabilities below: +* - We need at least 3 bytes of info data +* - First byte must be 0 +*/ +if (info->len <3 || info->data[0 ] !=0x00 ) +return ; + +if ((info->data[1 ] ==0x05 && info->data[2 ] ==0xb5 ) || + (info->data[1 ] ==0x0a && info->data[2 ] ==0xf7 ) || + (info->data[1 ] ==0x10 && info->data[2 ] ==0x18 )) { network->broadcom_cap_exist = true; } -if (info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x0c && info_element->data[2 ] ==0x43 ) +if (info->data[1 ] ==0x0c && info->data[2 ] ==0x43 ) network->ralink_cap_exist = true; -if ((info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x03 && info_element->data[2 ] ==0x7f ) || - (info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x13 && info_element->data[2 ] ==0x74 )) +if ((info->data[1 ] ==0x03 && info->data[2 ] ==0x7f ) || + (info->data[1 ] ==0x13 && info->data[2 ] ==0x74 )) network->atheros_cap_exist = true; -if ((info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x50 && info_element->data[2 ] ==0x43 )) +if (info->data[1 ] ==0x50 && info->data[2 ] ==0x43 ) network->marvell_cap_exist = true; -if (info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x40 && info_element->data[2 ] ==0x96 ) +if (info->data[1 ] ==0x40 && info->data[2 ] ==0x96 ) network->cisco_cap_exist = true; -if (info_element->len >=3 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x0a && info_element->data[2 ] ==0xf5 ) +if (info->data[1 ] ==0x0a && info->data[2 ] ==0xf5 ) network->airgo_cap_exist = true; -if (info_element->len >4 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x40 && info_element->data[2 ] ==0x96 && - info_element->data[3 ] ==0x01 ) { -if (info_element->len ==6 ) { -memcpy (network->CcxRmState, &info_element[4 ],2 ); +/* For all capabilities below we need at least 4 bytes of data */ +if (info->len <4 ) +return ; + +if (info->data[1 ] ==0x40 && info->data[2 ] ==0x96 && + info->data[3 ] ==0x01 ) { +if (info->len ==6 ) { +memcpy (network->CcxRmState, &info[4 ],2 );if (network->CcxRmState[0 ] !=0 ) network->bCcxRmEnable = true;else
@@ -1960,24 +1960,24 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee, network->bCcxRmEnable = false; } } -if (info_element->len >4 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x40 && info_element->data[2 ] ==0x96 && - info_element->data[3 ] ==0x03 ) { -if (info_element->len ==5 ) { + +if (info->data[1 ] ==0x40 && info->data[2 ] ==0x96 && + info->data[3 ] ==0x03 ) { +if (info->len ==5 ) { network->bWithCcxVerNum = true; - network->BssCcxVerNumber = info_element->data[4 ]; + network->BssCcxVerNumber = info->data[4 ]; }else { network->bWithCcxVerNum = false; network->BssCcxVerNumber =0 ; } } -if (info_element->len >4 && info_element->data[0 ] ==0x00 && - info_element->data[1 ] ==0x50 && info_element->data[2 ] ==0xf2 && - info_element->data[3 ] ==0x04 ) { + +if (info->data[1 ] ==0x50 && info->data[2 ] ==0xf2 && + info->data[3 ] ==0x04 ) {RTLLIB_DEBUG_MGMT ("MFIE_TYPE_WZC: %d bytes\n" , - info_element->len); - network->wzc_ie_len =min (info_element->len+2 ,MAX_WZC_IE_LEN ); -memcpy (network->wzc_ie, info_element, network->wzc_ie_len); + info->len); + network->wzc_ie_len =min (info->len+2 ,MAX_WZC_IE_LEN ); +memcpy (network->wzc_ie, info, network->wzc_ie_len); } }
Signature · 1 line
1.8.4.1
PATCH v2 20/21 staging: rtl8192e: Fix LONG_LINE in simplify rtl8192_process_phyinfo()
In reply to Mateusz KulikowskiSimplify function to make checkpatch.pl happy. Changes:
- Helper variables used
- Conditions were rephrased to return quickly (and decrease indent).
--- drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c | 111 ++++++++++++------------- 1 file changed, 53 insertions(+), 58 deletions(-)
drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c +53 -58
@@ -1701,6 +1701,7 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,struct rtllib_hdr_3addr *hdr;u16 sc;unsigned int frag, seq; +struct rt_stats *stats = &priv->stats; hdr = (struct rtllib_hdr_3addr *)buffer; sc =le16_to_cpu (hdr->seq_ctl);
@@ -1712,20 +1713,20 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,if (slide_rssi_statistics++ >=PHY_RSSI_SLID_WIN_MAX ) { slide_rssi_statistics =PHY_RSSI_SLID_WIN_MAX ; - last_rssi = priv->stats.slide_signal_strength[slide_rssi_index]; - priv->stats.slide_rssi_total -= last_rssi; + last_rssi = stats->slide_signal_strength[slide_rssi_index]; + stats->slide_rssi_total -= last_rssi; } - priv->stats.slide_rssi_total += prev_st->SignalStrength; + stats->slide_rssi_total += prev_st->SignalStrength; - priv->stats.slide_signal_strength[slide_rssi_index++] = - prev_st->SignalStrength; + stats->slide_signal_strength[slide_rssi_index++] = + prev_st->SignalStrength;if (slide_rssi_index >=PHY_RSSI_SLID_WIN_MAX ) slide_rssi_index =0 ; - tmp_val = priv->stats.slide_rssi_total/slide_rssi_statistics; - priv->stats.signal_strength =rtl819x_translate_todbm (priv, + tmp_val = stats->slide_rssi_total/slide_rssi_statistics; + stats->signal_strength =rtl819x_translate_todbm (priv, (u8 )tmp_val); - curr_st->rssi = priv->stats.signal_strength; + curr_st->rssi = stats->signal_strength;if (!prev_st->bPacketMatchBSSID) {if (!prev_st->bToSelfBA)return ;
@@ -1736,7 +1737,7 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,rtl819x_process_cck_rxpathsel (priv, prev_st); - priv->stats.num_process_phyinfo++; + stats->num_process_phyinfo++; if (!prev_st->bIsCCK && prev_st->bPacketToSelf) { for (rfpath = RF90_PATH_A; rfpath < RF90_PATH_C; rfpath++) { if (!rtl8192_phy_CheckIsLegalRFPath(priv->rtllib->dev,
@@ -1745,30 +1746,30 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,RT_TRACE (COMP_DBG ,"Jacken -> pPreviousstats->RxMIMOSignalStrength[rfpath] = %d\n" , prev_st->RxMIMOSignalStrength[rfpath]); -if (priv->stats.rx_rssi_percentage[rfpath] ==0 ) { - priv->stats.rx_rssi_percentage[rfpath] = +if (stats->rx_rssi_percentage[rfpath] ==0 ) { + stats->rx_rssi_percentage[rfpath] = prev_st->RxMIMOSignalStrength[rfpath]; }if (prev_st->RxMIMOSignalStrength[rfpath] > - priv->stats.rx_rssi_percentage[rfpath]) { - priv->stats.rx_rssi_percentage[rfpath] = - ((priv->stats.rx_rssi_percentage[rfpath] + stats->rx_rssi_percentage[rfpath]) { + stats->rx_rssi_percentage[rfpath] = + ((stats->rx_rssi_percentage[rfpath] * (RX_SMOOTH -1 )) + (prev_st->RxMIMOSignalStrength [rfpath])) / (RX_SMOOTH ); - priv->stats.rx_rssi_percentage[rfpath] = - priv->stats.rx_rssi_percentage[rfpath] + stats->rx_rssi_percentage[rfpath] = + stats->rx_rssi_percentage[rfpath] +1 ; }else { - priv->stats.rx_rssi_percentage[rfpath] = - ((priv->stats.rx_rssi_percentage[rfpath] * + stats->rx_rssi_percentage[rfpath] = + ((stats->rx_rssi_percentage[rfpath] * (RX_SMOOTH -1 )) + (prev_st->RxMIMOSignalStrength[rfpath])) / (RX_SMOOTH ); }RT_TRACE (COMP_DBG ,"Jacken -> priv->RxStats.RxRSSIPercentage[rfPath] = %d\n" , - priv->stats.rx_rssi_percentage[rfpath]); + stats->rx_rssi_percentage[rfpath]); } }
@@ -1778,17 +1779,17 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer, PHY_Beacon_RSSI_SLID_WIN_MAX) { slide_beacon_adc_pwdb_statistics = PHY_Beacon_RSSI_SLID_WIN_MAX; - last_beacon_adc_pwdb = priv->stats.Slide_Beacon_pwdb + last_beacon_adc_pwdb = stats->Slide_Beacon_pwdb [slide_beacon_adc_pwdb_index]; - priv->stats.Slide_Beacon_Total -= last_beacon_adc_pwdb; + stats->Slide_Beacon_Total -= last_beacon_adc_pwdb; } - priv->stats.Slide_Beacon_Total += prev_st->RxPWDBAll; - priv->stats.Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = + stats->Slide_Beacon_Total += prev_st->RxPWDBAll; + stats->Slide_Beacon_pwdb[slide_beacon_adc_pwdb_index] = prev_st->RxPWDBAll; slide_beacon_adc_pwdb_index++;if (slide_beacon_adc_pwdb_index >= PHY_Beacon_RSSI_SLID_WIN_MAX) slide_beacon_adc_pwdb_index =0 ; - prev_st->RxPWDBAll = priv->stats.Slide_Beacon_Total / + prev_st->RxPWDBAll = stats->Slide_Beacon_Total / slide_beacon_adc_pwdb_statistics;if (prev_st->RxPWDBAll >=3 ) prev_st->RxPWDBAll -=3 ;
@@ -1818,46 +1819,40 @@ static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,rtl819x_update_rxsignalstatistics8190pci (priv, prev_st); } -if (prev_st->SignalQuality !=0 ) { -if (prev_st->bPacketToSelf || prev_st->bPacketBeacon || - prev_st->bToSelfBA) { -if (slide_evm_statistics++ >=PHY_RSSI_SLID_WIN_MAX ) { - slide_evm_statistics =PHY_RSSI_SLID_WIN_MAX ; - last_evm = - priv->stats.slide_evm[slide_evm_index]; - priv->stats.slide_evm_total -= last_evm; - } +if (prev_st->SignalQuality ==0 ) +return ; - priv->stats.slide_evm_total += prev_st->SignalQuality; +if (!(prev_st->bPacketToSelf || prev_st->bPacketBeacon || + prev_st->bToSelfBA)) +return ; - priv->stats.slide_evm[slide_evm_index++] = - prev_st->SignalQuality; -if (slide_evm_index >=PHY_RSSI_SLID_WIN_MAX ) - slide_evm_index =0 ; +if (slide_evm_statistics++ >=PHY_RSSI_SLID_WIN_MAX ) { + slide_evm_statistics =PHY_RSSI_SLID_WIN_MAX ; + last_evm = stats->slide_evm[slide_evm_index]; + stats->slide_evm_total -= last_evm; + } - tmp_val = priv->stats.slide_evm_total / - slide_evm_statistics; - priv->stats.signal_quality = tmp_val; - priv->stats.last_signal_strength_inpercent = tmp_val; - } + stats->slide_evm_total += prev_st->SignalQuality; -if (prev_st->bPacketToSelf || - prev_st->bPacketBeacon || - prev_st->bToSelfBA) { -for (ij =0 ; ij <2 ; ij++) { -if (prev_st->RxMIMOSignalQuality[ij] !=-1 ) { -if (priv->stats.rx_evm_percentage[ij] ==0 ) - priv->stats.rx_evm_percentage[ij] = - prev_st->RxMIMOSignalQuality[ij]; - priv->stats.rx_evm_percentage[ij] = - ((priv->stats.rx_evm_percentage[ij] * - (RX_SMOOTH -1 )) + - (prev_st->RxMIMOSignalQuality[ij])) / - (RX_SMOOTH ); - } - } + stats->slide_evm[slide_evm_index++] = prev_st->SignalQuality; +if (slide_evm_index >=PHY_RSSI_SLID_WIN_MAX ) + slide_evm_index =0 ; + + tmp_val = stats->slide_evm_total / slide_evm_statistics; + stats->signal_quality = tmp_val; + stats->last_signal_strength_inpercent = tmp_val; +for (ij =0 ; ij <2 ; ij++) { +u8 *evm = stats->rx_evm_percentage; + +if (prev_st->RxMIMOSignalQuality[ij] !=-1 ) { +if (evm[ij] ==0 ) + evm[ij] = prev_st->RxMIMOSignalQuality[ij]; + evm[ij] = ((evm[ij] * (RX_SMOOTH -1 )) + + (prev_st->RxMIMOSignalQuality[ij])) / + (RX_SMOOTH ); } } + } static void rtl8192_TranslateRxSignalStuff(struct net_device *dev,
Signature · 1 line
1.8.4.1
PATCH v2 21/21 staging: rtl8192e: Remove unimplemented iwpriv handlers
In reply to Mateusz KulikowskiRemove the following private variables:
- force_mic_error - changes force_mic_error that is not used
- radio - changes sw_radio_on that is not used
- adhoc_peer_list - unimplemented
- firm_ver - unimplemented
--- drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_core.h | 1 - drivers/staging/rtl8192e/rtl8192e/rtl_wx.c | 86 ++-------------------------- drivers/staging/rtl8192e/rtllib.h | 1 - 4 files changed, 4 insertions(+), 85 deletions(-)
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +0 -1
@@ -1117,7 +1117,6 @@ static void rtl8192_init_priv_variable(struct net_device *dev) priv->bDriverIsGoingToUnload = false; priv->being_init_adapter = false; priv->initialized_at_probe = false; - priv->sw_radio_on = true; priv->bdisable_nic = false; priv->bfirst_init = false; priv->txringcount =64 ;
drivers/staging/rtl8192e/rtl8192e/rtl_core.h +0 -1
@@ -626,7 +626,6 @@ struct r8192_priv {u8 RegCWinMin;u8 keepAliveLevel; -bool sw_radio_on;bool bHwRadioOff;bool pwrdown;bool blinked_ingpio;
drivers/staging/rtl8192e/rtl8192e/rtl_wx.c +4 -82
125 lines not on this page · raw message
drivers/staging/rtl8192e/rtllib.h +0 -1
@@ -2018,7 +2018,6 @@ struct rtllib_device {u8 hwsec_active;bool is_silent_reset; -bool force_mic_error;bool is_roaming;bool ieee_up;bool cannot_notify;
Signature · 1 line
1.8.4.1
I don't know why you are doing a v2. I went back to the original thread and I see that no one complained about it.
Since no one replied to v1 thread, then probably Greg is going to apply that one first because it is first in his inbox. Greg's inbox has millions and millions of emails so he won't even get to this v2 series until a few days after he applied the v1 series.
Instead of sending a v2, just assume that Greg is going to apply the first set and send the additional cleanups as a separate set.
regards,
dan carpenter
Quoted 8 lines · Dan Carpenter
I don't know why you are doing a v2. I went back to the original thread and I see that no one complained about it.
Since no one replied to v1 thread, then probably Greg is going to apply that one first because it is first in his inbox. Greg's inbox has millions and millions of emails so he won't even get to this v2 series until a few days after he applied the v1 series.
Quoted 7 lines
Instead of sending a v2, just assume that Greg is going to apply the first set and send the additional cleanups as a separate set.
regards,
dan carpenter
Sorry for confusion.
I made checkpatch regressions in v1 (that I missed at a time)
I will mark (reply-all) v1 as "do-not-apply" - Will that be enough?
Regards,
Mateusz
Quoted 1 line · Mateusz Kulikowski
I made checkpatch regressions in v1 (that I missed at a time)
As near as I can tell the only difference is that you left some curly braces in on patch 8 of first set and removed them on the second set. It's not worth resending the whole series for trivial stuff like that which can be fixed later. But fine.
Quoted 2 lines
I will mark (reply-all) v1 as "do-not-apply" - Will that be enough?
Yes.
regards,
dan carpenter
Quoted 7 lines · Dan Carpenter
Quoted 1 line · Mateusz Kulikowski
I made checkpatch regressions in v1 (that I missed at a time)
As near as I can tell the only difference is that you left some curly braces in on patch 8 of first set and removed them on the second set. It's not worth resending the whole series for trivial stuff like that which can be fixed later. But fine.
Will keep that mind in future - thanks for the tip.
Quoted 3 lines
Quoted 1 line
I will mark (reply-all) v1 as "do-not-apply" - Will that be enough?
Yes.
Done
Regards,
Mateusz