git: 7db7bfe1a7b9 - main - iwlwifi: quieten more compiler warnings

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 20 Apr 2023 16:08:43 UTC
The branch main has been updated by bz:

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

commit 7db7bfe1a7b95c1acfc7861e05ee8808d448715f
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-04-20 15:57:14 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-04-20 16:07:05 +0000

    iwlwifi: quieten more compiler warnings
    
    Quieten some more (valid) gcc warnings and disable dead code.
    There are more warnings, some probably a compiler problem, the
    other related to firmware structs which I do not want to adjust
    just locally.  Leave a comment to revisit after a next driver
    update.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/contrib/dev/iwlwifi/fw/dbg.c            | 6 ++++++
 sys/contrib/dev/iwlwifi/fw/pnvm.c           | 3 +++
 sys/contrib/dev/iwlwifi/mvm/ftm-initiator.c | 4 ++++
 sys/contrib/dev/iwlwifi/mvm/ftm-responder.c | 2 ++
 sys/contrib/dev/iwlwifi/mvm/mvm.h           | 2 ++
 sys/contrib/dev/iwlwifi/mvm/sta.c           | 2 ++
 sys/contrib/dev/iwlwifi/mvm/sta.h           | 2 ++
 7 files changed, 21 insertions(+)

diff --git a/sys/contrib/dev/iwlwifi/fw/dbg.c b/sys/contrib/dev/iwlwifi/fw/dbg.c
index c2928d1f2b65..fd3483fe50b2 100644
--- a/sys/contrib/dev/iwlwifi/fw/dbg.c
+++ b/sys/contrib/dev/iwlwifi/fw/dbg.c
@@ -1459,6 +1459,9 @@ static int iwl_dump_ini_rxf_iter(struct iwl_fw_runtime *fwrt,
 	__le32 *data;
 	int i;
 
+#if defined(__FreeBSD__)
+	rxf_data.size = 0;
+#endif
 	iwl_ini_get_rxf_data(fwrt, reg_data, &rxf_data);
 	if (!rxf_data.size)
 		return -EIO;
@@ -1984,6 +1987,9 @@ static u32 iwl_dump_ini_rxf_get_size(struct iwl_fw_runtime *fwrt,
 	if (reg->fifos.hdr_only)
 		return size;
 
+#if defined(__FreeBSD__)
+	rx_data.size = 0;
+#endif
 	iwl_ini_get_rxf_data(fwrt, reg_data, &rx_data);
 	size += rx_data.size;
 
diff --git a/sys/contrib/dev/iwlwifi/fw/pnvm.c b/sys/contrib/dev/iwlwifi/fw/pnvm.c
index b6d3ac6ed440..1ced9cb2836b 100644
--- a/sys/contrib/dev/iwlwifi/fw/pnvm.c
+++ b/sys/contrib/dev/iwlwifi/fw/pnvm.c
@@ -319,6 +319,9 @@ parse:
 
 skip_parse:
 	data = NULL;
+#if defined(__FreeBSD__)
+	len = 0;
+#endif
 	/* now try to get the reduce power table, if not loaded yet */
 	if (!trans->reduce_power_loaded) {
 		data = iwl_uefi_get_reduced_power(trans, &len);
diff --git a/sys/contrib/dev/iwlwifi/mvm/ftm-initiator.c b/sys/contrib/dev/iwlwifi/mvm/ftm-initiator.c
index 430044bc4755..66140af891d3 100644
--- a/sys/contrib/dev/iwlwifi/mvm/ftm-initiator.c
+++ b/sys/contrib/dev/iwlwifi/mvm/ftm-initiator.c
@@ -230,7 +230,11 @@ static void iwl_mvm_ftm_cmd_v5(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 
 static void iwl_mvm_ftm_cmd_common(struct iwl_mvm *mvm,
 				   struct ieee80211_vif *vif,
+#if defined(__linux__)
 				   struct iwl_tof_range_req_cmd_v9 *cmd,
+#elif defined(__FreeBSD__)
+				   struct iwl_tof_range_req_cmd_v9 *cmd,	/* XXX-BZ Probably better solved by a common struct in fw for top parts of the struct. */
+#endif
 				   struct cfg80211_pmsr_request *req)
 {
 	int i;
diff --git a/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c b/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c
index 9729680476fd..4cb15046ec5c 100644
--- a/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c
+++ b/sys/contrib/dev/iwlwifi/mvm/ftm-responder.c
@@ -306,6 +306,7 @@ static void iwl_mvm_resp_del_pasn_sta(struct iwl_mvm *mvm,
 	kfree(sta);
 }
 
+#if defined(__linux__)
 int iwl_mvm_ftm_respoder_add_pasn_sta(struct iwl_mvm *mvm,
 				      struct ieee80211_vif *vif,
 				      u8 *addr, u32 cipher, u8 *tk, u32 tk_len,
@@ -374,6 +375,7 @@ int iwl_mvm_ftm_resp_remove_pasn_sta(struct iwl_mvm *mvm,
 	IWL_ERR(mvm, "FTM: PASN station %pM not found\n", addr);
 	return -EINVAL;
 }
+#endif
 
 int iwl_mvm_ftm_start_responder(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
 {
diff --git a/sys/contrib/dev/iwlwifi/mvm/mvm.h b/sys/contrib/dev/iwlwifi/mvm/mvm.h
index 73fd5dca45c4..7e905deab8ab 100644
--- a/sys/contrib/dev/iwlwifi/mvm/mvm.h
+++ b/sys/contrib/dev/iwlwifi/mvm/mvm.h
@@ -1993,12 +1993,14 @@ void iwl_mvm_ftm_restart_responder(struct iwl_mvm *mvm,
 				   struct ieee80211_vif *vif);
 void iwl_mvm_ftm_responder_stats(struct iwl_mvm *mvm,
 				 struct iwl_rx_cmd_buffer *rxb);
+#if defined(__linux__)
 int iwl_mvm_ftm_resp_remove_pasn_sta(struct iwl_mvm *mvm,
 				     struct ieee80211_vif *vif, u8 *addr);
 int iwl_mvm_ftm_respoder_add_pasn_sta(struct iwl_mvm *mvm,
 				      struct ieee80211_vif *vif,
 				      u8 *addr, u32 cipher, u8 *tk, u32 tk_len,
 				      u8 *hltk, u32 hltk_len);
+#endif
 void iwl_mvm_ftm_responder_clear(struct iwl_mvm *mvm,
 				 struct ieee80211_vif *vif);
 
diff --git a/sys/contrib/dev/iwlwifi/mvm/sta.c b/sys/contrib/dev/iwlwifi/mvm/sta.c
index cf3d0922cf83..71d9f2a2988a 100644
--- a/sys/contrib/dev/iwlwifi/mvm/sta.c
+++ b/sys/contrib/dev/iwlwifi/mvm/sta.c
@@ -4116,6 +4116,7 @@ u16 iwl_mvm_tid_queued(struct iwl_mvm *mvm, struct iwl_mvm_tid_data *tid_data)
 	return ieee80211_sn_sub(sn, tid_data->next_reclaimed);
 }
 
+#if defined(__linux__)
 int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			 struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
 			 u8 *key, u32 key_len)
@@ -4155,6 +4156,7 @@ out:
 	iwl_mvm_dealloc_int_sta(mvm, sta);
 	return ret;
 }
+#endif
 
 void iwl_mvm_cancel_channel_switch(struct iwl_mvm *mvm,
 				   struct ieee80211_vif *vif,
diff --git a/sys/contrib/dev/iwlwifi/mvm/sta.h b/sys/contrib/dev/iwlwifi/mvm/sta.h
index f1a4fc3e4038..d72f52230f22 100644
--- a/sys/contrib/dev/iwlwifi/mvm/sta.h
+++ b/sys/contrib/dev/iwlwifi/mvm/sta.h
@@ -545,9 +545,11 @@ void iwl_mvm_modify_all_sta_disable_tx(struct iwl_mvm *mvm,
 				       bool disable);
 void iwl_mvm_csa_client_absent(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
 void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk);
+#if defined(__linux__)
 int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			 struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
 			 u8 *key, u32 key_len);
+#endif
 void iwl_mvm_cancel_channel_switch(struct iwl_mvm *mvm,
 				   struct ieee80211_vif *vif,
 				   u32 mac_id);