From 5f1c74711ae605d04ef35f3768695c9919a1bdc4 Mon Sep 17 00:00:00 2001
From: Fiona Klute <fiona.klute@gmx.de>
Date: Sat, 2 Mar 2024 18:56:58 +0100
Subject: [PATCH 054/463] 8723cs: Ensure types are available in headers

During compilation these headers are included after others that define
those types/macros, but Clangd doesn't know that.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
 .../hal/phydm/halrf/halrf_powertracking_ce.h       |  2 ++
 .../staging/rtl8723cs/hal/phydm/phydm_phystatus.h  | 14 ++++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723cs/hal/phydm/halrf/halrf_powertracking_ce.h b/drivers/staging/rtl8723cs/hal/phydm/halrf/halrf_powertracking_ce.h
index 3fec1abf799f7..436136b471799 100644
--- a/drivers/staging/rtl8723cs/hal/phydm/halrf/halrf_powertracking_ce.h
+++ b/drivers/staging/rtl8723cs/hal/phydm/halrf/halrf_powertracking_ce.h
@@ -26,6 +26,8 @@
 #ifndef __HALRF_POWERTRACKING_H__
 #define __HALRF_POWERTRACKING_H__
 
+#include "phydm_types.h"
+
 #define DPK_DELTA_MAPPING_NUM 13
 #define index_mapping_HP_NUM 15
 #define OFDM_TABLE_SIZE 43
diff --git a/drivers/staging/rtl8723cs/hal/phydm/phydm_phystatus.h b/drivers/staging/rtl8723cs/hal/phydm/phydm_phystatus.h
index c65b6245f83e2..aacfbfa91c202 100644
--- a/drivers/staging/rtl8723cs/hal/phydm/phydm_phystatus.h
+++ b/drivers/staging/rtl8723cs/hal/phydm/phydm_phystatus.h
@@ -26,6 +26,16 @@
 #ifndef __PHYDM_PHYSTATUS_H__
 #define __PHYDM_PHYSTATUS_H__
 
+/* Clangd compatibility fixes: I can't include phydm_precomp.h here
+ * because it includes this file. All definitions of __PACK in
+ * phydm_precomp.h are literally the same as this, and without
+ * phydm_types.h types like u8 are missing.
+ */
+#ifndef __PACK
+#define __PACK
+#endif
+#include "phydm_types.h"
+
 /* 2020.07.03 fix cck report bug due to 8723F coding error*/
 #define PHYSTS_VERSION "1.2"
 
@@ -675,7 +685,7 @@ __PACK struct phy_sts_rpt_jgr3_type6 {
 	u8 hw_antsw_occur_keep_cck : 1;
 	u8 gnt_bt_keep_cck : 1;
 	u8 rssi_msb : 3;
-	u8 rsvd_2 : 2;	
+	u8 rsvd_2 : 2;
 #else
 	u8 rsvd_2 : 2;
 	u8 rssi_msb : 3;
@@ -704,7 +714,7 @@ __PACK struct phy_sts_rpt_jgr3_type6 {
 /* @DW3 : Offset 12 */
 	u16 rsvd_4_2;
 	u8 rsvd_5_1;
-	u8 avg_cfo;	
+	u8 avg_cfo;
 /* @DW4 : Offset 16 */
 	u8 coarse_cfo;
 #if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
-- 
2.46.0

