Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Aug 2023 01:36:47 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: eb50aa680f58 - main - ath1xk_common: update common athk files from upstream
Message-ID:  <202308210136.37L1alhk038226@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz:

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

commit eb50aa680f5864c5ae0f0137819bbe61b42a550e
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2023-05-20 00:38:12 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2023-08-21 01:31:57 +0000

    ath1xk_common: update common athk files from upstream
    
    Update ath1xk_common based on wireless-testing (wt-2023-05-11)
    711dca0ca3d77414f8f346e564e9c8640147f40d (right after v6.4-rc1).
    
    MFC after:      20 days
---
 sys/contrib/dev/athk/ath.h             | 15 ++++++++++-----
 sys/contrib/dev/athk/hw.c              |  2 +-
 sys/contrib/dev/athk/key.c             |  2 +-
 sys/contrib/dev/athk/regd.c            | 10 +++++-----
 sys/contrib/dev/athk/spectral_common.h |  4 ++--
 sys/contrib/dev/athk/trace.h           |  7 ++-----
 6 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/sys/contrib/dev/athk/ath.h b/sys/contrib/dev/athk/ath.h
index f083fb9038c3..90869e6d28da 100644
--- a/sys/contrib/dev/athk/ath.h
+++ b/sys/contrib/dev/athk/ath.h
@@ -22,6 +22,9 @@
 #include <linux/if_ether.h>
 #include <linux/spinlock.h>
 #include <net/mac80211.h>
+#if defined(__FreeBSD__)
+#include <linux/stddef.h>
+#endif
 
 /*
  * The key cache is used for h/w cipher state and also for
@@ -96,11 +99,13 @@ struct ath_keyval {
 	u8 kv_type;
 	u8 kv_pad;
 	u16 kv_len;
-	u8 kv_val[16]; /* TK */
-	u8 kv_mic[8]; /* Michael MIC key */
-	u8 kv_txmic[8]; /* Michael MIC TX key (used only if the hardware
-			 * supports both MIC keys in the same key cache entry;
-			 * in that case, kv_mic is the RX key) */
+	struct_group(kv_values,
+		u8 kv_val[16]; /* TK */
+		u8 kv_mic[8]; /* Michael MIC key */
+		u8 kv_txmic[8]; /* Michael MIC TX key (used only if the hardware
+				 * supports both MIC keys in the same key cache entry;
+				 * in that case, kv_mic is the RX key) */
+	);
 };
 
 enum ath_cipher {
diff --git a/sys/contrib/dev/athk/hw.c b/sys/contrib/dev/athk/hw.c
index b53ebb3ac9a2..85955572a705 100644
--- a/sys/contrib/dev/athk/hw.c
+++ b/sys/contrib/dev/athk/hw.c
@@ -48,7 +48,7 @@
  * the MAC address to obtain the relevant bits and compare the result with
  * (frame's BSSID & mask) to see if they match.
  *
- * Simple example: on your card you have have two BSSes you have created with
+ * Simple example: on your card you have two BSSes you have created with
  * BSSID-01 and BSSID-02. Lets assume BSSID-01 will not use the MAC address.
  * There is another BSSID-03 but you are not part of it. For simplicity's sake,
  * assuming only 4 bits for a mac address and for BSSIDs you can then have:
diff --git a/sys/contrib/dev/athk/key.c b/sys/contrib/dev/athk/key.c
index 61b59a804e30..b7b61d4f02ba 100644
--- a/sys/contrib/dev/athk/key.c
+++ b/sys/contrib/dev/athk/key.c
@@ -503,7 +503,7 @@ int ath_key_config(struct ath_common *common,
 
 	hk.kv_len = key->keylen;
 	if (key->keylen)
-		memcpy(hk.kv_val, key->key, key->keylen);
+		memcpy(&hk.kv_values, key->key, key->keylen);
 
 	if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) {
 		switch (vif->type) {
diff --git a/sys/contrib/dev/athk/regd.c b/sys/contrib/dev/athk/regd.c
index b2400e2417a5..f15e7bd690b5 100644
--- a/sys/contrib/dev/athk/regd.c
+++ b/sys/contrib/dev/athk/regd.c
@@ -667,14 +667,14 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
 
 /*
  * Some users have reported their EEPROM programmed with
- * 0x8000 or 0x0 set, this is not a supported regulatory
- * domain but since we have more than one user with it we
- * need a solution for them. We default to 0x64, which is
- * the default Atheros world regulatory domain.
+ * 0x8000 set, this is not a supported regulatory domain
+ * but since we have more than one user with it we need
+ * a solution for them. We default to 0x64, which is the
+ * default Atheros world regulatory domain.
  */
 static void ath_regd_sanitize(struct ath_regulatory *reg)
 {
-	if (reg->current_rd != COUNTRY_ERD_FLAG && reg->current_rd != 0)
+	if (reg->current_rd != COUNTRY_ERD_FLAG)
 		return;
 	printk(KERN_DEBUG "ath: EEPROM regdomain sanitized\n");
 	reg->current_rd = 0x64;
diff --git a/sys/contrib/dev/athk/spectral_common.h b/sys/contrib/dev/athk/spectral_common.h
index e14f374f97d4..fe187c1fbeb0 100644
--- a/sys/contrib/dev/athk/spectral_common.h
+++ b/sys/contrib/dev/athk/spectral_common.h
@@ -108,7 +108,7 @@ struct fft_sample_ath10k {
 	u8 avgpwr_db;
 	u8 max_exp;
 
-	u8 data[0];
+	u8 data[];
 } __packed;
 
 struct fft_sample_ath11k {
@@ -123,7 +123,7 @@ struct fft_sample_ath11k {
 	__be32 tsf;
 	__be32 noise;
 
-	u8 data[0];
+	u8 data[];
 } __packed;
 
 #endif /* SPECTRAL_COMMON_H */
diff --git a/sys/contrib/dev/athk/trace.h b/sys/contrib/dev/athk/trace.h
index ba711644d27e..9935cf475b6d 100644
--- a/sys/contrib/dev/athk/trace.h
+++ b/sys/contrib/dev/athk/trace.h
@@ -40,16 +40,13 @@ TRACE_EVENT(ath_log,
 	    TP_STRUCT__entry(
 		    __string(device, wiphy_name(wiphy))
 		    __string(driver, KBUILD_MODNAME)
-		    __dynamic_array(char, msg, ATH_DBG_MAX_LEN)
+		    __vstring(msg, vaf->fmt, vaf->va)
 	    ),
 
 	    TP_fast_assign(
 		    __assign_str(device, wiphy_name(wiphy));
 		    __assign_str(driver, KBUILD_MODNAME);
-		    WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
-					   ATH_DBG_MAX_LEN,
-					   vaf->fmt,
-					   *vaf->va) >= ATH_DBG_MAX_LEN);
+		    __assign_vstr(msg, vaf->fmt, vaf->va);
 	    ),
 
 	    TP_printk(



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308210136.37L1alhk038226>