From nobody Mon Aug 21 01:36:47 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RTZp74vBtz4r1MK; Mon, 21 Aug 2023 01:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RTZp74MV7z4kmR; Mon, 21 Aug 2023 01:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692581807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jKp/FsH2Iw3E5sttPCWskNzwoLGiDWNCQno3PiubMjo=; b=n81V9KWdqlfgdiFxSMstvWLk+kTXYzQt/I8j/ZMNoewjqLZgGLmr+e9JuMKC5YN9QCHums M9BQc2rKNFYPGv51RU0DkB6CDXpB7O9t3QoibYH5DKJxcAfpytfGr0EISX1/LxT19phaeV r6PayJMPwGohW5+G8fdrVAmjzfoYoGH8u638xpvWPcKeVhEzRSwL4xYaYvYdMrSXBoL8U7 qarKF8wLwYUe029iIiXMrz6+njKrTAZ7ml0bqLbuiznfc9la2uk2KwsJMmjLoKMr8bxQvv wnfbwoM5zK1LqcLJxZnvNCGdCwvMq8a1YRwdh7epDiLOg5pDCh0SR1JuysxhmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692581807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jKp/FsH2Iw3E5sttPCWskNzwoLGiDWNCQno3PiubMjo=; b=v0h0Sl14DC3B877Qj1uEdL1xQ5Bendv/obalBjHrq+UsYgL0AK7GqkQEsGzJ7VuMFd2OXa OnvoI6JJNHjF0Yx0/WfldRYQKEEmS3TzjdiQ/liO+6WDAktjkBdPVKOf3jEuX3vGnU2DBY +QE9ueb3ksQKysocZ2v681YQy8hIfd2eESO8eQok9Wu5LqIM5sjsAGKGHB6eWxcqFJq2xa 02MZRHX3z5ySAAaXgPzN1t/s3317/YnfjtSj65w9GUCaKKBhThmvdJT4i98oIuPTvHlKKa 8fwEMgRrEAeNErat3S7ZZGry6X8T6q99MAW/7oQB8DRcsC2TxCtOvlmHpzAwSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692581807; a=rsa-sha256; cv=none; b=ppRRWdwe7n9r5m7oc96zqw36ZnUjWE4nh5W2lEcSEarv53dV8Aps9WHRWQdXZ7F6sD/wiQ vjNooJzwL2MmZQOTW40t78oFzKvoeSjbED5LjItkS3WTGsL8ef4n7k+OSYoO9nYJsu7mpT Xc2cR4mHXTWTuc+X/hqFXtQ6Gyqm/1DMS6jtnz428D/haWC5BAixZQujhAif5ttv2ji2s1 YCTyvpSGKu3jA7jluhGLoJ1Nu+14fMpUf5S232NIeb2nM8O9OvvELEo3K5JiM9s3n5vlaF 3baDgeg3O8/aJRef6YoyP12DDrhUwesueXEDqnPxzcE8ywAM9QLFA6EWRLvr2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RTZp72v9Lz128L; Mon, 21 Aug 2023 01:36:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37L1alCk038229; Mon, 21 Aug 2023 01:36:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37L1alhk038226; Mon, 21 Aug 2023 01:36:47 GMT (envelope-from git) Date: Mon, 21 Aug 2023 01:36:47 GMT Message-Id: <202308210136.37L1alhk038226@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: eb50aa680f58 - main - ath1xk_common: update common athk files from upstream List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb50aa680f5864c5ae0f0137819bbe61b42a550e Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eb50aa680f5864c5ae0f0137819bbe61b42a550e commit eb50aa680f5864c5ae0f0137819bbe61b42a550e Author: Bjoern A. Zeeb AuthorDate: 2023-05-20 00:38:12 +0000 Commit: Bjoern A. Zeeb 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 #include #include +#if defined(__FreeBSD__) +#include +#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(