git: bbf3fc5b00b8 - stable/13 - iwlwifi: adjust to make d3.c compile

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 19 Feb 2024 08:07:53 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=bbf3fc5b00b8fdacbb3b941dc953c3253a7b4f31

commit bbf3fc5b00b8fdacbb3b941dc953c3253a7b4f31
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-01-29 14:23:01 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-02-19 08:02:00 +0000

    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().
    
    Reviewed by:    cc
    Differential Revision: https://reviews.freebsd.org/D43647
    
    (cherry picked from commit e1d31d0685f0b430f385023b7de49f47be6c7de0)
---
 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 <linux/etherdevice.h>
 #include <linux/ip.h>
 #include <linux/fs.h>
+#if defined(__FreeBSD__)
+#include <linux/string.h>
+#endif
 #include <net/cfg80211.h>
 #include <net/ipv6.h>
 #include <net/tcp.h>