diff options
author | Fabio Aiuto <fabioaiuto83@gmail.com> | 2021-08-07 11:47:54 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-10 12:12:18 +0200 |
commit | 7942bdd45549770e4b223cb95c055fad0a9796cf (patch) | |
tree | ffabd9e507073863a949f58789248563e959c496 /drivers/staging/rtl8723bs | |
parent | 0d6dc43772a6a5101ae43548a2716e5b5b249543 (diff) | |
download | linux-7942bdd45549770e4b223cb95c055fad0a9796cf.tar.bz2 |
staging: rtl8723bs: remove unneeded loop
remove unneeded loop over multiple spatial streams
as phy only works on 1 spatial stream.
Removed commented code, removed condition
always satisfied, beautified comments.
Signed-off-by: Fabio Aiuto <fabioaiuto83@gmail.com>
Link: https://lore.kernel.org/r/45f2ed02b8e5bb25057da6e7dc3e7c8713a1a2c0.1628329348.git.fabioaiuto83@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rtl8723bs')
-rw-r--r-- | drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c index 17a5850183ad..af4d5ab1b382 100644 --- a/drivers/staging/rtl8723bs/hal/odm_HWConfig.c +++ b/drivers/staging/rtl8723bs/hal/odm_HWConfig.c @@ -78,7 +78,7 @@ static void odm_RxPhyStatus92CSeries_Parsing( struct odm_packet_info *pPktinfo ) { - u8 i, Max_spatial_stream; + u8 i; s8 rx_pwr[4], rx_pwr_all = 0; u8 EVM, PWDB_ALL = 0, PWDB_ALL_BT; u8 RSSI, total_rssi = 0; @@ -182,30 +182,27 @@ static void odm_RxPhyStatus92CSeries_Parsing( pPhyInfo->rx_power = rx_pwr_all; pPhyInfo->recv_signal_power = rx_pwr_all; - {/* pMgntInfo->CustomerID != RT_CID_819x_Lenovo */ - /* */ - /* (3)EVM of HT rate */ - /* */ - Max_spatial_stream = 1; /* only spatial stream 1 makes sense */ - - for (i = 0; i < Max_spatial_stream; i++) { - /* Do not use shift operation like "rx_evmX >>= 1" because the compilor of free build environment */ - /* fill most significant bit to "zero" when doing shifting operation which may change a negative */ - /* value to positive one, then the dbm value (which is supposed to be negative) is not correct anymore. */ - EVM = odm_EVMdbToPercentage((pPhyStaRpt->stream_rxevm[i])); /* dbm */ - - /* if (pPktinfo->bPacketMatchBSSID) */ - { - if (i == ODM_RF_PATH_A) /* Fill value in RFD, Get the first spatial stream only */ - pPhyInfo->signal_quality = (u8)(EVM & 0xff); - - pPhyInfo->rx_mimo_signal_quality[i] = (u8)(EVM & 0xff); - } - } - } + /* + * (3)EVM of HT rate + * + * Only spatial stream 1 makes sense + * + * Do not use shift operation like "rx_evmX >>= 1" + * because the compiler of free build environment + * fill most significant bit to "zero" when doing + * shifting operation which may change a negative + * value to positive one, then the dbm value (which + * is supposed to be negative) is not correct + * anymore. + */ + EVM = odm_EVMdbToPercentage(pPhyStaRpt->stream_rxevm[0]); /* dbm */ + + /* Fill value in RFD, Get the first spatial stream only */ + pPhyInfo->signal_quality = (u8)(EVM & 0xff); + + pPhyInfo->rx_mimo_signal_quality[ODM_RF_PATH_A] = (u8)(EVM & 0xff); ODM_ParsingCFO(pDM_Odm, pPktinfo, pPhyStaRpt->path_cfotail); - } /* UI BSS List signal strength(in percentage), make it good looking, from 0~100. */ |