summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2023-02-13 15:50:07 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2023-02-13 15:50:07 +0000
commitf645ca647f98fec6f7f642e4bb9dfa319f17f212 (patch)
treeaf8c5fe51dea12c6b5a49dd44db3c21a4135422e /sys/dev
parente581c5f98f49311e2ad9233319e8839e474777d0 (diff)
Fix an alignment issue in iwx(4) Rx descriptors.
Split a 64-bit field, aligned at a 4-byte boundary, into two 32 bit fields. Our driver does not use this field. Its definition does not matter to us, as long as its size remains correct. Fixes clang-15 warnings, which turn into compilation errors with -Werror. Reported by, and ok tb@ Relevant clang 15 errors are: In file included from /sys/dev/pci/if_iwx.c:151: /sys/dev/pci/if_iwxreg.h:3659:2: error: field within 'struct iwx_rx_mpdu_desc_v1' is less aligned than 'union iwx_rx_mpdu_desc_v1::(anonymous at /sys/dev/pci/if_iwxreg.h:3659:2)' and is usually due to 'struct iwx_rx_mpdu_desc_v1' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { ^ /sys/dev/pci/if_iwxreg.h:3626:2: error: field within 'struct iwx_rx_mpdu_desc_v3' is less aligned than 'union iwx_rx_mpdu_desc_v3::(anonymous at /sys/dev/pci/if_iwxreg.h:3626:2)' and is usually due to 'struct iwx_rx_mpdu_desc_v3' being packed, which can lead to unaligned accesses [-Werror,-Wunaligned-access] union { ^ 2 errors generated.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_iwxreg.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwxreg.h b/sys/dev/pci/if_iwxreg.h
index 732c6f18f61..29dc5cbe965 100644
--- a/sys/dev/pci/if_iwxreg.h
+++ b/sys/dev/pci/if_iwxreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwxreg.h,v 1.39 2022/05/10 09:11:44 stsp Exp $ */
+/* $OpenBSD: if_iwxreg.h,v 1.40 2023/02/13 15:50:06 stsp Exp $ */
/*-
* Based on BSD-licensed source modules in the Linux iwlwifi driver,
@@ -3628,7 +3628,8 @@ struct iwx_rx_mpdu_desc_v3 {
* TSF value on air rise (INA), only valid if
* IWX_RX_MPDU_PHY_TSF_OVERLOAD isn't set
*/
- uint64_t tsf_on_air_rise;
+ uint32_t tsf_on_air_rise0;
+ uint32_t tsf_on_air_rise1;
struct {
uint32_t phy_data0;
@@ -3657,7 +3658,8 @@ struct iwx_rx_mpdu_desc_v1 {
uint8_t mac_context;
uint32_t gp2_on_air_rise;
union {
- uint64_t tsf_on_air_rise;
+ uint32_t tsf_on_air_rise0;
+ uint32_t tsf_on_air_rise1;
struct {
uint32_t phy_data0;
uint32_t phy_data1;