From nobody Tue Dec 31 01:36:03 2024 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 4YMbCR4mTzz5jLCn; Tue, 31 Dec 2024 01:36:03 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YMbCR2GFxz4hj6; Tue, 31 Dec 2024 01:36:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735608963; 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=x6bGNjmY67dRzrTqqv+cCcNK3goFNAMPERfB04vyXdg=; b=ySsWu4DPG+LZG13vfR7sXVTqsESZCR2k5zoQ4fM7plIjWqqEUxkr0Dkld3CkWTZaC7Kexy PQtbG5b1QL6/kcAoTrxzJ46RFHvUDFm96rfvqxCEQ6+v+gVMw9hrXtfgn0kT2/sDFDZA+V C2uAhASrTfO+rvqXbK4GQ5tErCK4tBhX/CeSiezTEf4w03exOrsppN+603donKpYu82Pgj ibtlXD/6bRWr90SxQiRe1/Y+IMDDWuAmxUQVcjLpvB9ymz2qlETHB85rE+ko06y8+gPZb9 0i7rrZLnmX7ieVdn+oXg9WY4O3LeWXjgLXOT62scZ7UF8G0LCH9orByAG+7u6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735608963; 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=x6bGNjmY67dRzrTqqv+cCcNK3goFNAMPERfB04vyXdg=; b=uag0t07Pdoi+HcwANAvHcoviP5WTPYDuDSY8u9Qsc83iDj5dDblDrm84Pdsu0IUJJ1nzAT lzqhunkaBfCgMSuURbKGl3tIflsFMxo+JDvVCmGtE2zq6KR+uKKxmXucED6qPC7etXUnkP sQmi/mA2dgtd5qv5dwNDhCUiegjT6vonPM+96oTp/kFipbyff0gs83qQjkFsdrzVv/Kd9v Zd/G8i427I8n+zcluN4G2gLxsctOMOVX2Z/Vf9E2fXbYP45+rZRSQDJ6qIOIHIHaw9rUSk 8OhLAqdC3KDbffJuj8hVpaVUSESsO9H5FCLRjjqmG1hawiYI+Yeyt2UdA5EkPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735608963; a=rsa-sha256; cv=none; b=HnrKVjgdrrNJwqBe51SzSNR2Nim8q9bJwMwyToSgIoNHY6ga65o2UU+r3JPVQatkdKl5Ym SwEw56wi1d/+1j+yTLaFDu9UtKf+sGouGyARrVlzopF6R58KJrIGAQIBlknVcUX5dG0wji 2+CeHv1DQ2ETmEWQ49xW76w+KmY9pVFM4YWC+UckogNl61KC38yGm8xU6p8YpCSpUDIZ33 t6Na0LZjgbqvp7Yr2c9BPMB32yzvvk+sQKFbCtMiXKl8x50s73eEHM0ibkldxzJgCGCkkT 7WrvIDLLG5SM2taQPiYvQqKwQyfClUBZ8RZYFRqPasYG23KcfouOOqrFDyFAUA== 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 4YMbCR1nVwzJjv; Tue, 31 Dec 2024 01:36:03 +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 4BV1a3x1060731; Tue, 31 Dec 2024 01:36:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BV1a3qC060728; Tue, 31 Dec 2024 01:36:03 GMT (envelope-from git) Date: Tue, 31 Dec 2024 01:36:03 GMT Message-Id: <202412310136.4BV1a3qC060728@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 4fad98b5c8d7 - main - rtwn: remove SEQ_SEL, replace with a QOS bit 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: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fad98b5c8d77c771c2dd14e3d4ce517b4bb92d9 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=4fad98b5c8d77c771c2dd14e3d4ce517b4bb92d9 commit 4fad98b5c8d77c771c2dd14e3d4ce517b4bb92d9 Author: Adrian Chadd AuthorDate: 2024-12-15 18:11:57 +0000 Commit: Adrian Chadd CommitDate: 2024-12-31 01:35:13 +0000 rtwn: remove SEQ_SEL, replace with a QOS bit I've reviewed all of the linux vendor and upstream drivers. This SEQ_SEL field isn't a mask and doesn't ever look like it it was; instead this bit is set to tag QoS data frames. In fact, it effectively was set to 0 for STA frames and potentially 1 for broadcast/multicast frames as the STA macid of 0 and broadcast/ multicast macid of 1 maps to that. In AP modes it would be tagged based on bit 0. So, bring it in line with the vendor and linux drivers. Locally tested: * RTL8192CU, STA, hostap * RTL8188EU, STA * RTL8192EU, STA Differential Revision: https://reviews.freebsd.org/D48092 --- sys/dev/rtwn/rtl8192c/r92c_beacon.c | 1 - sys/dev/rtwn/rtl8192c/r92c_tx.c | 12 ++++++------ sys/dev/rtwn/rtl8192c/r92c_tx_desc.h | 3 +-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sys/dev/rtwn/rtl8192c/r92c_beacon.c b/sys/dev/rtwn/rtl8192c/r92c_beacon.c index 8084d5b69438..4646b9317c2f 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_beacon.c +++ b/sys/dev/rtwn/rtl8192c/r92c_beacon.c @@ -64,7 +64,6 @@ r92c_beacon_init(struct rtwn_softc *sc, void *buf, int id) rtwn_r92c_tx_setup_macid(sc, buf, id); txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); - txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, id)); txd->txdw4 |= htole32(SM(R92C_TXDW4_PORT_ID, id)); txd->txdw5 |= htole32(SM(R92C_TXDW5_DATARATE, RTWN_RIDX_CCK1)); } diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx.c b/sys/dev/rtwn/rtl8192c/r92c_tx.c index 313f79e216e6..c60081fc675c 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx.c +++ b/sys/dev/rtwn/rtl8192c/r92c_tx.c @@ -272,7 +272,13 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, if (ismcast) txd->flags0 |= R92C_FLAGS0_BMCAST; + if (IEEE80211_IS_QOSDATA(wh)) + txd->txdw4 |= htole32(R92C_TXDW4_QOS); + if (!ismcast) { + struct rtwn_node *un = RTWN_NODE(ni); + macid = un->id; + /* Unicast frame, check if an ACK is expected. */ if (!qos || (qos & IEEE80211_QOS_ACKPOLICY) != IEEE80211_QOS_ACKPOLICY_NOACK) { @@ -281,9 +287,6 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, maxretry)); } - struct rtwn_node *un = RTWN_NODE(ni); - macid = un->id; - if (type == IEEE80211_FC0_TYPE_DATA) { qsel = tid % RTWN_MAX_TID; @@ -348,7 +351,6 @@ r92c_fill_tx_desc(struct rtwn_softc *sc, struct ieee80211_node *ni, if (!hasqos) { /* Use HW sequence numbering for non-QoS frames. */ rtwn_r92c_tx_setup_hwseq(sc, txd); - txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, uvp->id)); } else { uint16_t seqno; @@ -409,7 +411,6 @@ r92c_fill_tx_desc_raw(struct rtwn_softc *sc, struct ieee80211_node *ni, if (!IEEE80211_QOS_HAS_SEQ(wh)) { /* Use HW sequence numbering for non-QoS frames. */ rtwn_r92c_tx_setup_hwseq(sc, txd); - txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, uvp->id)); } else { /* Set sequence number. */ txd->txdseq |= htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); @@ -438,7 +439,6 @@ r92c_fill_tx_desc_null(struct rtwn_softc *sc, void *buf, int is11b, if (!qos) { rtwn_r92c_tx_setup_hwseq(sc, txd); - txd->txdw4 |= htole32(SM(R92C_TXDW4_SEQ_SEL, id)); } } diff --git a/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h b/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h index 6e546c3da236..33edb975f062 100644 --- a/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h +++ b/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h @@ -69,8 +69,7 @@ struct r92c_tx_desc { uint32_t txdw4; #define R92C_TXDW4_RTSRATE_M 0x0000001f #define R92C_TXDW4_RTSRATE_S 0 -#define R92C_TXDW4_SEQ_SEL_M 0x00000040 -#define R92C_TXDW4_SEQ_SEL_S 6 +#define R92C_TXDW4_QOS 0x00000040 /* BIT(6) for 8188cu/8192cu/8723au */ #define R92C_TXDW4_HWSEQ_EN 0x00000080 #define R92C_TXDW4_DRVRATE 0x00000100 #define R92C_TXDW4_CTS2SELF 0x00000800