From nobody Sun Aug 24 14:38:59 2025 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 4c8xPw3Vnnz65XLp; Sun, 24 Aug 2025 14:39:00 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4c8xPv751Yz3WgN; Sun, 24 Aug 2025 14:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756046340; 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=D8uErg5CuND2ncrhRsSm22AytJEExr+vKN2rKGoD77g=; b=VpOffwv1ctacWUhy7MDS/vLvwDyFII+gzzvr9bGXQJOoThrHuiiIkaOd10+aa8bzyMaHHt q9oEOhbY4bVZfjIAwtILhkXhBaP48ysqtW1UqCJif6C6MhvvQVO2XkhfDz9JfAoryQ02Hj 4RwvO+ZuO/jPGyvCpREzU1LLqlsUa50baLjA0ZluV1uH1swK1wJmHXdOPNVcWMkNRaTeY8 PFzvzgok4S0KfttsUtINBZ7/WmoD41mIrV9wsqeI6N0IX60Y9yCfu58rPFcDZRN9CFnjaa XjOe8GzDrmD7KPZhJEX/2du5DFh+bZ+rBpANthKWM8i8aKlX4Kc1FSC8IibWrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1756046340; 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=D8uErg5CuND2ncrhRsSm22AytJEExr+vKN2rKGoD77g=; b=aCDsccWssyo/Eepv4Qt/xvu0gEQssUHHcgcL0NgwuYmR+GhvhWBkXb3yFE6qDpGc+dBXh6 c+t0xBCWrUCjUcuWsPFzoIOnbChD1xyc+YvlPeVXZOlCEUr+7hEkilA8R4vd5ofKAuZeMh WJMWSdWlmuytIS7cLmzl0v3Vr9bnw54LKrE47fPSIiFsRm1w+UE/qFvjNebQzHK0k+Pac8 6R4bw3kB21F7Cr8kUQDckKC7hauGXYv/2nrUXV1EalEDMh3J1TmTwaWqnEwC1oB/R9IVrM k8lCj/FRs200eNxt35fSeY8QlcU4lRe6SGTf9T/woM/CTT89+oVhuHMgbgk9ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1756046340; a=rsa-sha256; cv=none; b=w64XTH2Uv9pAPDlf8hgy55BuVyBr0qjcLh2S4qBz4qIG9XuCdPppXYCPQJnIDop2cO4qvY v+CBrh93F1SUrcbpfR/Rjr9c5Qv5vuTQ7yvJ3R9dXmqziItexs4rpy6olK05q+8iZ+yuZS +6OAq5CqJMxKdCIugPCWchaUgWbERhN7+0l/9s93CC9aF5IcuwpB8ovoFYDypO9sdqwJCu y9XYD1c8lBdIniEHOaB78QfiydWM9dh1kSI6obanVOKP5mX19b3s7S5IEH+yAxdsVjQ0+o qFfkKFVUfgMnR7hSniys8qVXB/wU3LiGl2boxGQjYDq1ModONgwIiQ0qDpEuRw== 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 4c8xPv6hLhz165N; Sun, 24 Aug 2025 14:38:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 57OEcxp8040748; Sun, 24 Aug 2025 14:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 57OEcxrm040745; Sun, 24 Aug 2025 14:38:59 GMT (envelope-from git) Date: Sun, 24 Aug 2025 14:38:59 GMT Message-Id: <202508241438.57OEcxrm040745@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: b3b61079ccc2 - main - LinuxKPI: 802.11: fill in sinfo for chains in case driver does not 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-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: b3b61079ccc24792f1410840e42c36f71b9cab9f Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b3b61079ccc24792f1410840e42c36f71b9cab9f commit b3b61079ccc24792f1410840e42c36f71b9cab9f Author: Bjoern A. Zeeb AuthorDate: 2025-06-14 00:23:26 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-08-24 10:26:44 +0000 LinuxKPI: 802.11: fill in sinfo for chains in case driver does not We are getting per-packet information on the rx chains. Save them locally like we do for rx rate and add them to sinfo for the sysctl in case the driver does not fill in that information. Also note: chain_signal is a bitmask and not a number; treat it accordingly. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index eb270fe7c8f6..91836b857727 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -325,6 +325,14 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) memcpy(&sinfo.rxrate, &lsta->sinfo.rxrate, sizeof(sinfo.rxrate)); sinfo.filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE); } + /* If no CHAIN_SIGNAL is reported, try to fill it in from the lsta sinfo. */ + if ((sinfo.filled & BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL)) == 0 && + (lsta->sinfo.filled & BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL)) != 0) { + sinfo.chains = lsta->sinfo.chains; + memcpy(sinfo.chain_signal, lsta->sinfo.chain_signal, + sizeof(sinfo.chain_signal)); + sinfo.filled |= BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL); + } lkpi_nl80211_sta_info_to_str(&s, " nl80211_sta_info (valid fields)", sinfo.filled); sbuf_printf(&s, " connected_time %u inactive_time %u\n", @@ -341,11 +349,12 @@ lkpi_80211_dump_stas(SYSCTL_HANDLER_ARGS) sbuf_printf(&s, " signal %d signal_avg %d ack_signal %d avg_ack_signal %d\n", sinfo.signal, sinfo.signal_avg, sinfo.ack_signal, sinfo.avg_ack_signal); - - sbuf_printf(&s, " generation %d assoc_req_ies_len %zu chains %d\n", + sbuf_printf(&s, " generation %d assoc_req_ies_len %zu chains %#04x\n", sinfo.generation, sinfo.assoc_req_ies_len, sinfo.chains); - for (int i = 0; i < sinfo.chains && i < IEEE80211_MAX_CHAINS; i++) { + for (int i = 0; i < nitems(sinfo.chain_signal) && i < IEEE80211_MAX_CHAINS; i++) { + if (!(sinfo.chains & BIT(i))) + continue; sbuf_printf(&s, " chain[%d] signal %d signal_avg %d\n", i, (int8_t)sinfo.chain_signal[i], (int8_t)sinfo.chain_signal_avg[i]); } @@ -6881,9 +6890,17 @@ lkpi_convert_rx_status(struct ieee80211_hw *hw, struct lkpi_sta *lsta, rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_FCSCRC; #endif + /* Fill in some sinfo bits to fill gaps not reported byt the driver. */ if (lsta != NULL) { memcpy(&lsta->sinfo.rxrate, &rxrate, sizeof(rxrate)); lsta->sinfo.filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE); + + if (rx_status->chains != 0) { + lsta->sinfo.chains = rx_status->chains; + memcpy(lsta->sinfo.chain_signal, rx_status->chain_signal, + sizeof(lsta->sinfo.chain_signal)); + lsta->sinfo.filled |= BIT_ULL(NL80211_STA_INFO_CHAIN_SIGNAL); + } } }