git: 86220d3cbd50 - main - LinuxKPI: 802.11: fix compat code for i386

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Thu, 31 Mar 2022 17:35:18 UTC
The branch main has been updated by bz:

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

commit 86220d3cbd500b1018dcdabb0ba70644db438cfd
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-03-31 17:29:53 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-03-31 17:29:53 +0000

    LinuxKPI: 802.11: fix compat code for i386
    
    Compiling another driver on i386 revealed two problems:
    - ieee80211_tx_info.status.status_driver_data space needs to be
      calculated.  While a pointer is 32bit vm_paddr_t is 64 bit on i386
      so we didn't fit more than one of these in but needed more space.
    - the arguments to ieee80211_txq_get_depth() are expected to
      unsigned long and not uint64_t.
    
    No user noticable changes.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      3 days
---
 sys/compat/linuxkpi/common/include/net/mac80211.h | 9 +++++----
 sys/compat/linuxkpi/common/src/linux_80211.c      | 4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h
index 5cf2c8b75e40..d69f5094765b 100644
--- a/sys/compat/linuxkpi/common/include/net/mac80211.h
+++ b/sys/compat/linuxkpi/common/include/net/mac80211.h
@@ -670,7 +670,7 @@ struct ieee80211_tx_info {
 			uint8_t				antenna;
 			uint16_t			tx_time;
 			bool				is_valid_ack_signal;
-			void				*status_driver_data[2];		/* XXX TODO */
+			void				*status_driver_data[16 / sizeof(void *)];		/* XXX TODO */
 		} status;
 #define	IEEE80211_TX_INFO_DRIVER_DATA_SIZE	(5 * sizeof(void *))			/* XXX TODO 5? */
 		void					*driver_data[IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)];
@@ -900,8 +900,8 @@ struct sk_buff *linuxkpi_ieee80211_pspoll_get(struct ieee80211_hw *,
     struct ieee80211_vif *);
 struct sk_buff *linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *,
     struct ieee80211_vif *, bool);
-void linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *, uint64_t *,
-    uint64_t *);
+void linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *, unsigned long *,
+    unsigned long *);
 struct wireless_dev *linuxkpi_ieee80211_vif_to_wdev(struct ieee80211_vif *);
 void linuxkpi_ieee80211_connection_loss(struct ieee80211_vif *);
 void linuxkpi_ieee80211_beacon_loss(struct ieee80211_vif *);
@@ -1931,7 +1931,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
 }
 
 static __inline void
-ieee80211_txq_get_depth(struct ieee80211_txq *txq, uint64_t *frame_cnt, uint64_t *byte_cnt)
+ieee80211_txq_get_depth(struct ieee80211_txq *txq, unsigned long *frame_cnt,
+    unsigned long *byte_cnt)
 {
 
 	if (frame_cnt == NULL && byte_cnt == NULL)
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 3a70d8bbfcab..13ad2908c021 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -4007,11 +4007,11 @@ linuxkpi_ieee80211_tx_dequeue(struct ieee80211_hw *hw,
 
 void
 linuxkpi_ieee80211_txq_get_depth(struct ieee80211_txq *txq,
-    uint64_t *frame_cnt, uint64_t *byte_cnt)
+    unsigned long *frame_cnt, unsigned long *byte_cnt)
 {
 	struct lkpi_txq *ltxq;
 	struct sk_buff *skb;
-	uint64_t fc, bc;
+	unsigned long fc, bc;
 
 	ltxq = TXQ_TO_LTXQ(txq);