staging: rtl8723bs: clean up phy status structs and casts
v5 cover staging: rtl8723bs: clean up phy status structs and casts
Hey Now,
This patch series splits the v3 patch into a 2-part series as requested, separating the struct renaming from the cast mess unwinding.
Changes in v5:
- Rebased against the latest staging/staging-testing branch.
- Resolved minor merge conflicts in odm_HWConfig.c.
Changes in v4:
- Split monolithic patch into 2-part series.
- Removed dead struct phy_stat and unused prototype rtl8723b_query_rx_phy_status().
Changes in v3:
- Included patch version changelog (missed in v2, sorry).
Changes in v2:
- Propagated the real struct type through
the call chain to remove u8 * casting.
Regarding your question about the existence of struct phy_stat, I discovered it was dead code; no function actually used it. Furthermore, the rtl8723b_query_rx_phy_status() function prototype referencing it was also unused, and was removed.
Patch 1 renames struct phy_status_rpt_8192cd_t
to rtl8723bs_phy_status_rpt.
Patch 2 unwinds the cast mess and propagates the real struct type all the way through
the call chain, and removes the unused phy_stat struct and ghost function prototype.
Timo Joannin (2):
staging: rtl8723bs: rename struct phy_status_rpt_8192cd_t to
rtl8723bs_phy_status_rpt.
staging: rtl8723bs: unwind cast mess and remove phy_stat struct
drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 215 +++++++++++------- .../staging/rtl8723bs/include/rtl8192c_recv.h | 18 -- .../staging/rtl8723bs/include/rtl8723b_recv.h | 1 - 3 files changed, 134 insertions(+), 100 deletions(-)
Signature · 1 line
2.56.0
PATCH v5 1/2 staging: rtl8723bs: rename struct phy_status_rpt_8192cd_t to rtl8723bs_phy_status_rpt.
The struct identifier references the 8192CD chip while being in a rtl8723bs codebase. Additionally, the identifier uses the _t suffix, while being generally reserved for typedef identifiers.
Rename the struct to rtl8723bs_phy_status_rpt
across the rtl8723bs codebase to accurately
reflect the driver and clean up the naming.
--- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 210 ++++++++++++------- 1 file changed, 129 insertions(+), 81 deletions(-)
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +129 -81
@@ -10,23 +10,22 @@static u8 odm_query_rx_pwr_percentage (s8 ant_power) {if ((ant_power <=-100 ) || (ant_power >=20 )) -return 0 ; +return 0 ;else if (ant_power >=0 ) -return 100 ; +return 100 ;else return 100 + ant_power; - }s32 odm_signal_scale_mapping (struct dm_odm_t *dm_odm,s32 curr_sig) {s32 ret_sig =0 ; -if (dm_odm->SupportInterface ==ODM_ITRF_SDIO ) { +if (dm_odm->SupportInterface ==ODM_ITRF_SDIO ) {if (curr_sig >=51 && curr_sig <=100 ) ret_sig =100 ;else if (curr_sig >=41 && curr_sig <=50 ) - ret_sig =80 + ((curr_sig -40 )*2 ); + ret_sig =80 + ((curr_sig -40 ) *2 );else if (curr_sig >=31 && curr_sig <=40 ) ret_sig =66 + (curr_sig -30 );else if (curr_sig >=21 && curr_sig <=30 )
@@ -71,8 +70,8 @@ static s8 odm_cck_rssi(u8 lna_idx, u8 vga_idx)s8 rx_pwr_all =0x00 ;switch (lna_idx) { -/* 46 53 73 95 201301231630 */ -/* 46 53 77 99 201301241630 */ +/* 46 53 73 95 201301231630 */ +/* 46 53 77 99 201301241630 */ case 6 : rx_pwr_all =-34 - (2 * vga_idx);
@@ -93,10 +92,11 @@ static s8 odm_cck_rssi(u8 lna_idx, u8 vga_idx)return rx_pwr_all; } -static void odm_rx_phy_status_parsing (struct dm_odm_t *dm_odm, -struct odm_phy_info *phy_info, -struct rtl8723bs_phy_status_rpt *phy_sta_rpt, -struct odm_packet_info *pkt_info) +static void +odm_rx_phy_status_parsing (struct dm_odm_t *dm_odm, +struct odm_phy_info *phy_info, +struct rtl8723bs_phy_status_rpt *phy_sta_rpt, +struct odm_packet_info *pkt_info) {u8 i;s8 rx_pwr[4 ], rx_pwr_all =0 ;
@@ -127,7 +127,7 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,* 2011.11.28 LukeLee: 88E use different LNA & VGA gain table * The RSSI formula should be modified according to the gain table */ - lna_idx = ((cck_agc_rpt &0xE0 )>>5 ); + lna_idx = ((cck_agc_rpt &0xE0 ) >>5 ); vga_idx = (cck_agc_rpt &0x1F ); rx_pwr_all =odm_cck_rssi (lna_idx, vga_idx); pwdb_all =odm_query_rx_pwr_percentage (rx_pwr_all);
@@ -147,15 +147,15 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,if (phy_info->rx_pwd_ba11 >40 && !dm_odm->bInHctTest) sq =100 ;else { - sq_rpt = phy_sta_rpt->cck_sig_qual_ofdm_pwdb_all; + sq_rpt = + phy_sta_rpt->cck_sig_qual_ofdm_pwdb_all;if (sq_rpt >64 ) sq =0 ;else if (sq_rpt <20 ) sq =100 ;else - sq = ((64 -sq_rpt) *100 ) /44 ; - + sq = ((64 - sq_rpt) *100 ) /44 ; } phy_info->signal_quality = sq;
@@ -174,9 +174,11 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,if (dm_odm->RFPathRxEnable &BIT (i)) rf_rx_num++;/* else */ -/* continue; */ +/* continue; */ - rx_pwr[i] = ((phy_sta_rpt->path_agc[i].gain &0x3F ) *2 ) -110 ; + rx_pwr[i] = + ((phy_sta_rpt->path_agc[i].gain &0x3F ) *2 ) - +110 ; phy_info->rx_pwr[i] = rx_pwr[i];
@@ -187,15 +189,19 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm, phy_info->rx_mimo_signal_strength[i] = (u8 )rssi;/* Get Rx snr value in DB */ - phy_info->rx_snr[i] = dm_odm->PhyDbgInfo.RxSNRdB[i] = (s32)(phy_sta_rpt->path_rxsnr[i]/2 ); + phy_info->rx_snr[i] = dm_odm->PhyDbgInfo.RxSNRdB[i] = + (s32)(phy_sta_rpt->path_rxsnr[i] /2 ); }/* * (2)PWDB, Average PWDB calculated by hardware (for rate adaptive) */ - rx_pwr_all = ((phy_sta_rpt->cck_sig_qual_ofdm_pwdb_all >>1 ) &0x7f ) -110 ; + rx_pwr_all = ((phy_sta_rpt->cck_sig_qual_ofdm_pwdb_all >>1 ) & +0x7f ) - +110 ; - pwdb_all_bt = pwdb_all =odm_query_rx_pwr_percentage (rx_pwr_all); + pwdb_all_bt = pwdb_all = +odm_query_rx_pwr_percentage (rx_pwr_all); phy_info->rx_pwd_ba11 = pwdb_all; phy_info->bt_rx_rssi_percentage = pwdb_all_bt;
@@ -215,7 +221,8 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,* is supposed to be negative) is not correct * anymore. */ - evm =odm_evm_db_to_percentage (phy_sta_rpt->stream_rxevm[0 ]);/* dbm */ + evm =odm_evm_db_to_percentage ( + phy_sta_rpt->stream_rxevm[0 ]);/* dbm */ /* Fill value in RFD, Get the first spatial stream only */ phy_info->signal_quality = (u8)(evm &0xff );
@@ -231,19 +238,22 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,* It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp(). */ if (is_cck_rate) { - phy_info->signal_strength = (u8)(odm_signal_scale_mapping (dm_odm, pwdb_all)); + phy_info->signal_strength = + (u8)(odm_signal_scale_mapping (dm_odm, pwdb_all)); }else {if (rf_rx_num !=0 ) - phy_info->signal_strength = (u8)(odm_signal_scale_mapping (dm_odm, total_rssi /= rf_rx_num)); + phy_info->signal_strength = + (u8)(odm_signal_scale_mapping ( + dm_odm, total_rssi /= rf_rx_num)); } } -static void odm_Process_RSSIForDM ( -struct dm_odm_t *pDM_Odm,struct odm_phy_info *pPhyInfo,struct odm_packet_info *pPktinfo -) +static void odm_Process_RSSIForDM (struct dm_odm_t *pDM_Odm, +struct odm_phy_info *pPhyInfo, +struct odm_packet_info *pPktinfo) { - -s32 UndecoratedSmoothedPWDB, UndecoratedSmoothedCCK, UndecoratedSmoothedOFDM, RSSI_Ave; +s32 UndecoratedSmoothedPWDB, UndecoratedSmoothedCCK, + UndecoratedSmoothedOFDM, RSSI_Ave;u8 isCCKrate =0 ;u8 RSSI_max, RSSI_min, i;u32 OFDM_pkt =0 ;
@@ -269,7 +279,6 @@ static void odm_Process_RSSIForDM(/* Statistic for antenna/path diversity------------------ */ if (pDM_Odm->SupportAbility &ODM_BB_ANT_DIV ) { - }/* Smart Antenna Debug Message------------------ */
@@ -279,76 +288,102 @@ static void odm_Process_RSSIForDM( UndecoratedSmoothedPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB;if (pPktinfo->to_self || pPktinfo->is_beacon) { -if (!isCCKrate) {/* ofdm rate */ if (pPhyInfo->rx_mimo_signal_strength[RF_PATH_B ] ==0 ) { - RSSI_Ave = pPhyInfo->rx_mimo_signal_strength[RF_PATH_A ]; - pDM_Odm->RSSI_A = pPhyInfo->rx_mimo_signal_strength[RF_PATH_A ]; + RSSI_Ave = pPhyInfo->rx_mimo_signal_strength + [RF_PATH_A ]; + pDM_Odm->RSSI_A = + pPhyInfo->rx_mimo_signal_strength + [RF_PATH_A ]; pDM_Odm->RSSI_B =0 ; }else { - pDM_Odm->RSSI_A = pPhyInfo->rx_mimo_signal_strength[RF_PATH_A ]; - pDM_Odm->RSSI_B = pPhyInfo->rx_mimo_signal_strength[RF_PATH_B ]; - -if ( - pPhyInfo->rx_mimo_signal_strength[RF_PATH_A ] > - pPhyInfo->rx_mimo_signal_strength[RF_PATH_B ] - ) { - RSSI_max = pPhyInfo->rx_mimo_signal_strength[RF_PATH_A ]; - RSSI_min = pPhyInfo->rx_mimo_signal_strength[RF_PATH_B ]; + pDM_Odm->RSSI_A = + pPhyInfo->rx_mimo_signal_strength + [RF_PATH_A ]; + pDM_Odm->RSSI_B = + pPhyInfo->rx_mimo_signal_strength + [RF_PATH_B ]; + +if (pPhyInfo->rx_mimo_signal_strength[RF_PATH_A ] > + pPhyInfo->rx_mimo_signal_strength[RF_PATH_B ]) { + RSSI_max = + pPhyInfo->rx_mimo_signal_strength + [RF_PATH_A ]; + RSSI_min = + pPhyInfo->rx_mimo_signal_strength + [RF_PATH_B ]; }else { - RSSI_max = pPhyInfo->rx_mimo_signal_strength[RF_PATH_B ]; - RSSI_min = pPhyInfo->rx_mimo_signal_strength[RF_PATH_A ]; + RSSI_max = + pPhyInfo->rx_mimo_signal_strength + [RF_PATH_B ]; + RSSI_min = + pPhyInfo->rx_mimo_signal_strength + [RF_PATH_A ]; } -if ((RSSI_max-RSSI_min) <3 ) +if ((RSSI_max - RSSI_min) <3 ) RSSI_Ave = RSSI_max; -else if ((RSSI_max-RSSI_min) <6 ) +else if ((RSSI_max - RSSI_min) <6 ) RSSI_Ave = RSSI_max -1 ; -else if ((RSSI_max-RSSI_min) <10 ) +else if ((RSSI_max - RSSI_min) <10 ) RSSI_Ave = RSSI_max -2 ;else RSSI_Ave = RSSI_max -3 ; }/* 1 Process OFDM RSSI */ -if (UndecoratedSmoothedOFDM <=0 )/* initialize */ +if (UndecoratedSmoothedOFDM <=0 )/* initialize */ UndecoratedSmoothedOFDM = pPhyInfo->rx_pwd_ba11;else { -if (pPhyInfo->rx_pwd_ba11 > (u32 )UndecoratedSmoothedOFDM) { +if (pPhyInfo->rx_pwd_ba11 > + (u32 )UndecoratedSmoothedOFDM) { + UndecoratedSmoothedOFDM = + ((UndecoratedSmoothedOFDM * + (Rx_Smooth_Factor -1 )) + + RSSI_Ave) / + Rx_Smooth_Factor; UndecoratedSmoothedOFDM = - ((UndecoratedSmoothedOFDM*(Rx_Smooth_Factor-1 )) + - RSSI_Ave)/Rx_Smooth_Factor; - UndecoratedSmoothedOFDM = UndecoratedSmoothedOFDM +1 ; + UndecoratedSmoothedOFDM +1 ; }else { UndecoratedSmoothedOFDM = - ((UndecoratedSmoothedOFDM*(Rx_Smooth_Factor-1 )) + - RSSI_Ave)/Rx_Smooth_Factor; + ((UndecoratedSmoothedOFDM * + (Rx_Smooth_Factor -1 )) + + RSSI_Ave) / + Rx_Smooth_Factor; } } - pEntry->rssi_stat.PacketMap = (pEntry->rssi_stat.PacketMap<<1 ) |BIT (0 ); + pEntry->rssi_stat.PacketMap = + (pEntry->rssi_stat.PacketMap <<1 ) |BIT (0 ); }else { RSSI_Ave = pPhyInfo->rx_pwd_ba11; - pDM_Odm->RSSI_A = (u8 ) pPhyInfo->rx_pwd_ba11; + pDM_Odm->RSSI_A = (u8 )pPhyInfo->rx_pwd_ba11; pDM_Odm->RSSI_B =0 ;/* 1 Process CCK RSSI */ -if (UndecoratedSmoothedCCK <=0 )/* initialize */ +if (UndecoratedSmoothedCCK <=0 )/* initialize */ UndecoratedSmoothedCCK = pPhyInfo->rx_pwd_ba11;else { -if (pPhyInfo->rx_pwd_ba11 > (u32 )UndecoratedSmoothedCCK) { +if (pPhyInfo->rx_pwd_ba11 > + (u32 )UndecoratedSmoothedCCK) { + UndecoratedSmoothedCCK = + ((UndecoratedSmoothedCCK * + (Rx_Smooth_Factor -1 )) + + pPhyInfo->rx_pwd_ba11) / + Rx_Smooth_Factor; UndecoratedSmoothedCCK = - ((UndecoratedSmoothedCCK*(Rx_Smooth_Factor-1 )) + - pPhyInfo->rx_pwd_ba11)/Rx_Smooth_Factor; - UndecoratedSmoothedCCK = UndecoratedSmoothedCCK +1 ; + UndecoratedSmoothedCCK +1 ; }else { UndecoratedSmoothedCCK = - ((UndecoratedSmoothedCCK*(Rx_Smooth_Factor-1 )) + - pPhyInfo->rx_pwd_ba11)/Rx_Smooth_Factor; + ((UndecoratedSmoothedCCK * + (Rx_Smooth_Factor -1 )) + + pPhyInfo->rx_pwd_ba11) / + Rx_Smooth_Factor; } } - pEntry->rssi_stat.PacketMap = pEntry->rssi_stat.PacketMap<<1 ; + pEntry->rssi_stat.PacketMap = + pEntry->rssi_stat.PacketMap <<1 ; }/* if (pEntry) */
@@ -360,32 +395,48 @@ static void odm_Process_RSSIForDM( pEntry->rssi_stat.ValidBit++;for (i =0 ; i < pEntry->rssi_stat.ValidBit; i++) - OFDM_pkt += (u8)(pEntry->rssi_stat.PacketMap>>i)&BIT (0 ); + OFDM_pkt += + (u8)(pEntry->rssi_stat.PacketMap >> i) & +BIT (0 );if (pEntry->rssi_stat.ValidBit ==64 ) { - Weighting = ((OFDM_pkt<<4 ) >64 )?64 :(OFDM_pkt<<4 ); - UndecoratedSmoothedPWDB = (Weighting*UndecoratedSmoothedOFDM+(64 -Weighting)*UndecoratedSmoothedCCK)>>6 ; + Weighting = ((OFDM_pkt <<4 ) >64 ) ? +64 : + (OFDM_pkt <<4 ); + UndecoratedSmoothedPWDB = + (Weighting * UndecoratedSmoothedOFDM + + (64 - Weighting) * + UndecoratedSmoothedCCK) >> +6 ; }else {if (pEntry->rssi_stat.ValidBit !=0 ) - UndecoratedSmoothedPWDB = (OFDM_pkt*UndecoratedSmoothedOFDM+(pEntry->rssi_stat.ValidBit-OFDM_pkt)*UndecoratedSmoothedCCK)/pEntry->rssi_stat.ValidBit; + UndecoratedSmoothedPWDB = + (OFDM_pkt * + UndecoratedSmoothedOFDM + + (pEntry->rssi_stat.ValidBit - + OFDM_pkt) * + UndecoratedSmoothedCCK) / + pEntry->rssi_stat.ValidBit;else UndecoratedSmoothedPWDB =0 ; } - pEntry->rssi_stat.UndecoratedSmoothedCCK = UndecoratedSmoothedCCK; - pEntry->rssi_stat.UndecoratedSmoothedOFDM = UndecoratedSmoothedOFDM; - pEntry->rssi_stat.UndecoratedSmoothedPWDB = UndecoratedSmoothedPWDB; + pEntry->rssi_stat.UndecoratedSmoothedCCK = + UndecoratedSmoothedCCK; + pEntry->rssi_stat.UndecoratedSmoothedOFDM = + UndecoratedSmoothedOFDM; + pEntry->rssi_stat.UndecoratedSmoothedPWDB = + UndecoratedSmoothedPWDB; } - } }/* Endianness before calling this API */ -void odm_phy_status_query (struct dm_odm_t *dm_odm,struct odm_phy_info *phy_info, +void odm_phy_status_query (struct dm_odm_t *dm_odm, +struct odm_phy_info *phy_info,struct rtl8723bs_phy_status_rpt *phy_status,struct odm_packet_info *pkt_info) { -odm_rx_phy_status_parsing (dm_odm, phy_info, phy_status, pkt_info);if (!dm_odm->RSSI_test)
@@ -394,11 +445,9 @@ void odm_phy_status_query(struct dm_odm_t *dm_odm, struct odm_phy_info *phy_info/* If you want to add a new IC, Please follow below template and generate a new one. */ -void ODM_ConfigRFWithHeaderFile ( -struct dm_odm_t *pDM_Odm, -enum ODM_RF_Config_Type ConfigType, -enum rf_path eRFPath -) +void ODM_ConfigRFWithHeaderFile (struct dm_odm_t *pDM_Odm, +enum ODM_RF_Config_Type ConfigType, +enum rf_path eRFPath) {if (ConfigType ==CONFIG_RF_RADIO )ODM_ReadAndConfig_MP_8723B_RadioA (pDM_Odm);
@@ -412,9 +461,8 @@ void ODM_ConfigRFWithTxPwrTrackHeaderFile(struct dm_odm_t *pDM_Odm)ODM_ReadAndConfig_MP_8723B_TxPowerTrack_SDIO (pDM_Odm); } -void ODM_ConfigBBWithHeaderFile ( -struct dm_odm_t *pDM_Odm,enum ODM_BB_Config_Type ConfigType -) +void ODM_ConfigBBWithHeaderFile (struct dm_odm_t *pDM_Odm, +enum ODM_BB_Config_Type ConfigType) {if (ConfigType ==CONFIG_BB_PHY_REG )ODM_ReadAndConfig_MP_8723B_PHY_REG (pDM_Odm);
Signature · 1 line
2.56.0
PATCH v5 2/2 staging: rtl8723bs: unwind cast mess and remove phy_stat struct
In reply to Timo JoanninPropagate the real struct type all the way through the call chain to remove redundant casts to and from u8 *.
Remove redundant phy_stat struct, along with the dead function prototype rtl8723b_query_rx_phy_status() which referenced it.
--- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 5 +++++ .../staging/rtl8723bs/include/rtl8192c_recv.h | 18 ------------------ .../staging/rtl8723bs/include/rtl8723b_recv.h | 1 - 3 files changed, 5 insertions(+), 19 deletions(-)
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +5 -0
@@ -432,8 +432,13 @@ static void odm_Process_RSSIForDM(struct dm_odm_t *pDM_Odm, }/* Endianness before calling this API */ +<<<<<<< HEAD void odm_phy_status_query(struct dm_odm_t *dm_odm,struct odm_phy_info *phy_info, +======= +void odm_phy_status_query (struct dm_odm_t *dm_odm, +struct odm_phy_info *phy_info, +>>>>>>> f52adf8 (staging: rtl8723bs: unwind cast mess and remove phy_stat struct) struct rtl8723bs_phy_status_rpt *phy_status, struct odm_packet_info *pkt_info) {
drivers/staging/rtl8723bs/include/rtl8192c_recv.h +0 -18
@@ -9,24 +9,6 @@#define MAX_RECVBUF_SZ (10240) -struct phy_stat { -unsigned int phydw0; - -unsigned int phydw1; - -unsigned int phydw2; - -unsigned int phydw3; - -unsigned int phydw4; - -unsigned int phydw5; - -unsigned int phydw6; - -unsigned int phydw7; -}; -/* Rx smooth factor */ #define Rx_Smooth_Factor (20)
drivers/staging/rtl8723bs/include/rtl8723b_recv.h +0 -1
@@ -84,7 +84,6 @@ struct rxreport_8723b {s32 rtl8723bs_init_recv_priv (struct adapter *padapter);void rtl8723bs_free_recv_priv (struct adapter *padapter); -void rtl8723b_query_rx_phy_status (union recv_frame *prframe,struct phy_stat *pphy_stat);void rtl8723b_process_phy_info (struct adapter *padapter,void *prframe);void rtl8723b_read_chip_version (struct adapter *padapter);
Signature · 1 line
2.56.0
Greg KH
maintainerRe: [PATCH v5 2/2] staging: rtl8723bs: unwind cast mess and remove phy_stat struct
Quoted 21 lines · Timo Joannin
Propagate the real struct type all the way through the call chain to remove redundant casts to and from u8 *.
Remove redundant
phy_statstruct, along with the dead function prototypertl8723b_query_rx_phy_status()which referenced it.Signed-off-by Timo Joannin <[email protected]>--- drivers/staging/rtl8723bs/hal/odm_HWConfig.c | 5 +++++ .../staging/rtl8723bs/include/rtl8192c_recv.h | 18 ------------------ .../staging/rtl8723bs/include/rtl8723b_recv.h | 1 - 3 files changed, 5 insertions(+), 19 deletions(-)drivers/staging/rtl8723bs/hal/odm_HWConfig.c +0
-0@@ -432,8 +432,13 @@ static void odm_Process_RSSIForDM(struct dm_odm_t *pDM_Odm, }/* Endianness before calling this API */
drivers/staging/rtl8723bs/hal/odm_HWConfig.c static void odm_Process_RSSIForDM(struct dm_odm_t *pDM_Odm, · line 444
Quoted 10 lines
drivers/staging/rtl8723bs/hal/odm_HWConfig.c +5
-0+<<<<<<< HEAD void odm_phy_status_query(struct dm_odm_t *dm_odm,struct odm_phy_info *phy_info, +======= +void odm_phy_status_query (struct dm_odm_t *dm_odm, +struct odm_phy_info *phy_info, +>>>>>>> f52adf8 (staging: rtl8723bs: unwind cast mess and remove phy_stat struct) struct rtl8723bs_phy_status_rpt *phy_status, struct odm_packet_info *pkt_info) {
I do not think you compiled this submission :(
kernel test robot
build botRe: [PATCH v5 2/2] staging: rtl8723bs: unwind cast mess and remove phy_stat struct
In reply to Timo Joanninkernel test robot noticed the following build errors:
Hi Timo,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Timo-Joannin/staging-rtl8723bs-rename-struct-phy_status_rpt_8192cd_t-to-rtl8723bs_phy_status_rpt/20261013-211502 base: staging/staging-testing patch link: https://lore.kernel.org/r/20261013191503.152056-3-timo.joannin%40gmail.com patch subject: [PATCH v5 2/2] staging: rtl8723bs: unwind cast mess and remove phy_stat struct config: nios2-allmodconfig (https://download.01.org/0day-ci/archive/20261016/[email protected]/config) compiler: nios2-linux-gcc (GCC) 11.5.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20261016/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All error/warnings (new ones prefixed by >>):
>> drivers/staging/rtl8723bs/hal/odm_HWConfig.c:435:1: error: version control conflict marker in file
435 | <<<<<<< HEAD
| ^~~~~~~
>> drivers/staging/rtl8723bs/hal/odm_HWConfig.c:251:13: warning: 'odm_Process_RSSIForDM' defined but not used [-Wunused-function]
251 | static void odm_Process_RSSIForDM(struct dm_odm_t *pDM_Odm,
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/staging/rtl8723bs/hal/odm_HWConfig.c:96:1: warning: 'odm_rx_phy_status_parsing' defined but not used [-Wunused-function] 96 | odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
vim +435 drivers/staging/rtl8723bs/hal/odm_HWConfig.c
250
> 251 static void odm_Process_RSSIForDM(struct dm_odm_t *pDM_Odm,
252 struct odm_phy_info *pPhyInfo,
253 struct odm_packet_info *pPktinfo)
254 {
255 s32 UndecoratedSmoothedPWDB, UndecoratedSmoothedCCK,
256 UndecoratedSmoothedOFDM, RSSI_Ave;
257 u8 isCCKrate = 0;
258 u8 RSSI_max, RSSI_min, i;
259 u32 OFDM_pkt = 0;
260 u32 Weighting = 0;
261 PSTA_INFO_T pEntry;
262
263 if (pPktinfo->station_id == 0xFF)
264 return;
265
266 pEntry = pDM_Odm->pODM_StaInfo[pPktinfo->station_id];
267
268 if (!IS_STA_VALID(pEntry))
269 return;
270
271 if ((!pPktinfo->bssid_match))
272 return;
273
274 if (pPktinfo->is_beacon)
275 pDM_Odm->PhyDbgInfo.NumQryBeaconPkt++;
276
277 isCCKrate = ((pPktinfo->data_rate <= DESC_RATE11M)) ? true : false;
278 pDM_Odm->RxRate = pPktinfo->data_rate;
279
280 /* Statistic for antenna/path diversity------------------ */
281 if (pDM_Odm->SupportAbility & ODM_BB_ANT_DIV) {
282 }
283
284 /* Smart Antenna Debug Message------------------ */
285
286 UndecoratedSmoothedCCK = pEntry->rssi_stat.UndecoratedSmoothedCCK;
287 UndecoratedSmoothedOFDM = pEntry->rssi_stat.UndecoratedSmoothedOFDM;
288 UndecoratedSmoothedPWDB = pEntry->rssi_stat.UndecoratedSmoothedPWDB;
289
290 if (pPktinfo->to_self || pPktinfo->is_beacon) {
291 if (!isCCKrate) { /* ofdm rate */
292 if (pPhyInfo->rx_mimo_signal_strength[RF_PATH_B] == 0) {
293 RSSI_Ave = pPhyInfo->rx_mimo_signal_strength
294 [RF_PATH_A];
295 pDM_Odm->RSSI_A =
296 pPhyInfo->rx_mimo_signal_strength
297 [RF_PATH_A];
298 pDM_Odm->RSSI_B = 0;
299 } else {
300 pDM_Odm->RSSI_A =
301 pPhyInfo->rx_mimo_signal_strength
302 [RF_PATH_A];
303 pDM_Odm->RSSI_B =
304 pPhyInfo->rx_mimo_signal_strength
305 [RF_PATH_B];
306
307 if (pPhyInfo->rx_mimo_signal_strength[RF_PATH_A] >
308 pPhyInfo->rx_mimo_signal_strength[RF_PATH_B]) {
309 RSSI_max =
310 pPhyInfo->rx_mimo_signal_strength
311 [RF_PATH_A];
312 RSSI_min =
313 pPhyInfo->rx_mimo_signal_strength
314 [RF_PATH_B];
315 } else {
316 RSSI_max =
317 pPhyInfo->rx_mimo_signal_strength
318 [RF_PATH_B];
319 RSSI_min =
320 pPhyInfo->rx_mimo_signal_strength
321 [RF_PATH_A];
322 }
323
324 if ((RSSI_max - RSSI_min) < 3)
325 RSSI_Ave = RSSI_max;
326 else if ((RSSI_max - RSSI_min) < 6)
327 RSSI_Ave = RSSI_max - 1;
328 else if ((RSSI_max - RSSI_min) < 10)
329 RSSI_Ave = RSSI_max - 2;
330 else
331 RSSI_Ave = RSSI_max - 3;
332 }
333
334 /* 1 Process OFDM RSSI */
335 if (UndecoratedSmoothedOFDM <= 0) /* initialize */
336 UndecoratedSmoothedOFDM = pPhyInfo->rx_pwd_ba11;
337 else {
338 if (pPhyInfo->rx_pwd_ba11 >
339 (u32)UndecoratedSmoothedOFDM) {
340 UndecoratedSmoothedOFDM =
341 ((UndecoratedSmoothedOFDM *
342 (Rx_Smooth_Factor - 1)) +
343 RSSI_Ave) /
344 Rx_Smooth_Factor;
345 UndecoratedSmoothedOFDM =
346 UndecoratedSmoothedOFDM + 1;
347 } else {
348 UndecoratedSmoothedOFDM =
349 ((UndecoratedSmoothedOFDM *
350 (Rx_Smooth_Factor - 1)) +
351 RSSI_Ave) /
352 Rx_Smooth_Factor;
353 }
354 }
355
356 pEntry->rssi_stat.PacketMap =
357 (pEntry->rssi_stat.PacketMap << 1) | BIT(0);
358
359 } else {
360 RSSI_Ave = pPhyInfo->rx_pwd_ba11;
361 pDM_Odm->RSSI_A = (u8)pPhyInfo->rx_pwd_ba11;
362 pDM_Odm->RSSI_B = 0;
363
364 /* 1 Process CCK RSSI */
365 if (UndecoratedSmoothedCCK <= 0) /* initialize */
366 UndecoratedSmoothedCCK = pPhyInfo->rx_pwd_ba11;
367 else {
368 if (pPhyInfo->rx_pwd_ba11 >
369 (u32)UndecoratedSmoothedCCK) {
370 UndecoratedSmoothedCCK =
371 ((UndecoratedSmoothedCCK *
372 (Rx_Smooth_Factor - 1)) +
373 pPhyInfo->rx_pwd_ba11) /
374 Rx_Smooth_Factor;
375 UndecoratedSmoothedCCK =
376 UndecoratedSmoothedCCK + 1;
377 } else {
378 UndecoratedSmoothedCCK =
379 ((UndecoratedSmoothedCCK *
380 (Rx_Smooth_Factor - 1)) +
381 pPhyInfo->rx_pwd_ba11) /
382 Rx_Smooth_Factor;
383 }
384 }
385 pEntry->rssi_stat.PacketMap =
386 pEntry->rssi_stat.PacketMap << 1;
387 }
388
389 /* if (pEntry) */
390 {
391 /* 2011.07.28 LukeLee: modified to prevent unstable CCK RSSI */
392 if (pEntry->rssi_stat.ValidBit >= 64)
393 pEntry->rssi_stat.ValidBit = 64;
394 else
395 pEntry->rssi_stat.ValidBit++;
396
397 for (i = 0; i < pEntry->rssi_stat.ValidBit; i++)
398 OFDM_pkt +=
399 (u8)(pEntry->rssi_stat.PacketMap >> i) &
400 BIT(0);
401
402 if (pEntry->rssi_stat.ValidBit == 64) {
403 Weighting = ((OFDM_pkt << 4) > 64) ?
404 64 :
405 (OFDM_pkt << 4);
406 UndecoratedSmoothedPWDB =
407 (Weighting * UndecoratedSmoothedOFDM +
408 (64 - Weighting) *
409 UndecoratedSmoothedCCK) >>
410 6;
411 } else {
412 if (pEntry->rssi_stat.ValidBit != 0)
413 UndecoratedSmoothedPWDB =
414 (OFDM_pkt *
415 UndecoratedSmoothedOFDM +
416 (pEntry->rssi_stat.ValidBit -
417 OFDM_pkt) *
418 UndecoratedSmoothedCCK) /
419 pEntry->rssi_stat.ValidBit;
420 else
421 UndecoratedSmoothedPWDB = 0;
422 }
423
424 pEntry->rssi_stat.UndecoratedSmoothedCCK =
425 UndecoratedSmoothedCCK;
426 pEntry->rssi_stat.UndecoratedSmoothedOFDM =
427 UndecoratedSmoothedOFDM;
428 pEntry->rssi_stat.UndecoratedSmoothedPWDB =
429 UndecoratedSmoothedPWDB;
430 }
431 }
432 }
433
434 /* Endianness before calling this API */
> 435 <<<<<<< HEAD 436 void odm_phy_status_query(struct dm_odm_t *dm_odm,
437 struct odm_phy_info *phy_info,
438 =======
439 void odm_phy_status_query(struct dm_odm_t *dm_odm,
440 struct odm_phy_info *phy_info,
441 >>>>>>> f52adf8 (staging: rtl8723bs: unwind cast mess and remove phy_stat struct)
442 struct rtl8723bs_phy_status_rpt *phy_status,
443 struct odm_packet_info *pkt_info)
444 {
445 odm_rx_phy_status_parsing(dm_odm, phy_info, phy_status, pkt_info);
446
447 if (!dm_odm->RSSI_test)
448 odm_Process_RSSIForDM(dm_odm, phy_info, pkt_info);
449 }
450
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki