From e1d31d0685f0b430f385023b7de49f47be6c7de0 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Mon, 29 Jan 2024 14:23:01 +0000 Subject: [PATCH] iwlwifi: adjust to make d3.c compile struct iwl_mvm_wep_key_cmd ends in a variable sized array but later is included in another struct followed by the actual struct iwl_mvm_wep_key in d3.c. Make the array[0] instead of [] to avoid the warning about it being a GNU-extension. Also include string.h explicitly for memset_after(). MFC after: 3 days Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43647 --- sys/contrib/dev/iwlwifi/fw/api/sta.h | 4 ++++ sys/contrib/dev/iwlwifi/mvm/d3.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/sys/contrib/dev/iwlwifi/fw/api/sta.h b/sys/contrib/dev/iwlwifi/fw/api/sta.h index d62fed543276..18f9470db301 100644 --- a/sys/contrib/dev/iwlwifi/fw/api/sta.h +++ b/sys/contrib/dev/iwlwifi/fw/api/sta.h @@ -477,7 +477,11 @@ struct iwl_mvm_wep_key_cmd { u8 decryption_type; u8 flags; u8 reserved; +#if defined(__linux__) struct iwl_mvm_wep_key wep_key[]; +#elif defined(__FreeBSD__) + struct iwl_mvm_wep_key wep_key[0]; +#endif } __packed; /* SEC_CURR_WEP_KEY_CMD_API_S_VER_2 */ /** diff --git a/sys/contrib/dev/iwlwifi/mvm/d3.c b/sys/contrib/dev/iwlwifi/mvm/d3.c index f6488b4bbe68..17d74a771d13 100644 --- a/sys/contrib/dev/iwlwifi/mvm/d3.c +++ b/sys/contrib/dev/iwlwifi/mvm/d3.c @@ -7,6 +7,9 @@ #include #include #include +#if defined(__FreeBSD__) +#include +#endif #include #include #include