Linux wireless drivers development
 help / color / mirror / Atom feed
* Re: [PATCH v1] wifi: ath9k: Fix typo
From: Jeff Johnson @ 2026-02-24 21:34 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: Toke Høiland-Jørgensen, linux-wireless,
	Rajkumar Manoharan, John W. Linville, Greg KH
In-Reply-To: <aZ4Wq6h-nMt-G3pC@devuan>

On 2/24/2026 1:27 PM, Alejandro Colomar wrote:
> Hi Jeff,
> 
> On 2026-02-24T10:45:02-0800, Jeff Johnson wrote:
>> On 2/23/2026 7:17 AM, Toke Høiland-Jørgensen wrote:
>>> Alejandro Colomar <alx@kernel.org> writes:
>>>
>>>> This only worked by chance, because all callers of this macro used the
>>>> same identifiers that were expected by the macro.
>>>>
>>>> 	$ grep -rn ath_for_each_chanctx
>>>> 	drivers/net/wireless/ath/ath9k/main.c:1576:	ath_for_each_chanctx(sc, ctx)
>>>> 	drivers/net/wireless/ath/ath9k/main.c:2554:	ath_for_each_chanctx(sc, ctx) {
>>>> 	drivers/net/wireless/ath/ath9k/channel.c:165:	ath_for_each_chanctx(sc, ctx) {
>>>> 	drivers/net/wireless/ath/ath9k/channel.c:291:	ath_for_each_chanctx(sc, ctx) {
>>>> 	drivers/net/wireless/ath/ath9k/channel.c:861:	ath_for_each_chanctx(sc, ctx) {
>>>> 	drivers/net/wireless/ath/ath9k/debug.c:717:	ath_for_each_chanctx(sc, ctx) {
>>>> 	drivers/net/wireless/ath/ath9k/ath9k.h:446:#define ath_for_each_chanctx(_sc, _ctx)                               \
>>>>
>>>> Fixes: c4dc0d040e35 (2014-06-19; "ath9k: Fetch appropriate operating channel context")
>>
>> I'm dropping the Fixes tag since the existing code actually works and hence
>> there is no need to backport to LTS kernels.
> 
> Sounds reasonable.  Alternatively, a line next to it saying
> 
> 	[Do not backport]
> 
> would work, I guess.
> 
> Greg, I've seen this situation already a few times.  A Fixes tag getting
> removed to avoid triggering a stable backport.  But I think keeping the
> Fixes tag could be useful.  Should we have a standard way to document
> that a patch fixes an old commit without meaning that it should be
> backported?  Maybe something like this?:
> 
> 	[Do not backport to stable]
> 	Fixes: ...
> 
> In any case, feel free to remove it.

Looks like we have this:
There furthermore is a variant of the stable tag you can use to make the
stable team’s backporting tools (e.g AUTOSEL or scripts that look for commits
containing a ‘Fixes:’ tag) ignore a change:
Cc: <stable+noautosel@kernel.org> # reason goes here, and must be present

https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-1

Do you want to re-spin with that?

/jeff

^ permalink raw reply

* Re: [PATCH v1] wifi: ath9k: Fix typo
From: Alejandro Colomar @ 2026-02-24 21:27 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: Toke Høiland-Jørgensen, linux-wireless,
	Rajkumar Manoharan, John W. Linville, Greg KH
In-Reply-To: <8beecde0-1280-4852-bb82-120590347fb3@oss.qualcomm.com>

[-- Attachment #1: Type: text/plain, Size: 2140 bytes --]

Hi Jeff,

On 2026-02-24T10:45:02-0800, Jeff Johnson wrote:
> On 2/23/2026 7:17 AM, Toke Høiland-Jørgensen wrote:
> > Alejandro Colomar <alx@kernel.org> writes:
> > 
> >> This only worked by chance, because all callers of this macro used the
> >> same identifiers that were expected by the macro.
> >>
> >> 	$ grep -rn ath_for_each_chanctx
> >> 	drivers/net/wireless/ath/ath9k/main.c:1576:	ath_for_each_chanctx(sc, ctx)
> >> 	drivers/net/wireless/ath/ath9k/main.c:2554:	ath_for_each_chanctx(sc, ctx) {
> >> 	drivers/net/wireless/ath/ath9k/channel.c:165:	ath_for_each_chanctx(sc, ctx) {
> >> 	drivers/net/wireless/ath/ath9k/channel.c:291:	ath_for_each_chanctx(sc, ctx) {
> >> 	drivers/net/wireless/ath/ath9k/channel.c:861:	ath_for_each_chanctx(sc, ctx) {
> >> 	drivers/net/wireless/ath/ath9k/debug.c:717:	ath_for_each_chanctx(sc, ctx) {
> >> 	drivers/net/wireless/ath/ath9k/ath9k.h:446:#define ath_for_each_chanctx(_sc, _ctx)                               \
> >>
> >> Fixes: c4dc0d040e35 (2014-06-19; "ath9k: Fetch appropriate operating channel context")
> 
> I'm dropping the Fixes tag since the existing code actually works and hence
> there is no need to backport to LTS kernels.

Sounds reasonable.  Alternatively, a line next to it saying

	[Do not backport]

would work, I guess.

Greg, I've seen this situation already a few times.  A Fixes tag getting
removed to avoid triggering a stable backport.  But I think keeping the
Fixes tag could be useful.  Should we have a standard way to document
that a patch fixes an old commit without meaning that it should be
backported?  Maybe something like this?:

	[Do not backport to stable]
	Fixes: ...

In any case, feel free to remove it.


Have a lovely night!
Alex

> 
> >> Cc: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
> >> Cc: John W. Linville <linville@tuxdriver.com>
> >> Cc: Toke Høiland-Jørgensen <toke@toke.dk>
> >> Signed-off-by: Alejandro Colomar <alx@kernel.org>
> > 
> > Yeah, looks reasonable - thanks!
> > 
> > Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
> > 
> 

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply

* Re: [PATCH wireless-next v4 1/2] wifi: UHR: define DPS/DBE/P-EDCA elements and fix size parsing
From: Johannes Berg @ 2026-02-24 20:47 UTC (permalink / raw)
  To: Karthikeyan Kathirvel; +Cc: linux-wireless, ath12k
In-Reply-To: <20260217054731.3667600-2-karthikeyan.kathirvel@oss.qualcomm.com>

On Tue, 2026-02-17 at 11:17 +0530, Karthikeyan Kathirvel wrote:
> 
> +/**
> + * struct ieee80211_uhr_dps_info - DPS operation information
> + *
> + * This structure is the "DPS Operation Parameter field" of "UHR
> + * Operation Element" fields as described in P802.11bn_D1.3
> + * subclause 9.4.1.87. See Figure 9-207u.
> + *
> + * Refer to IEEE80211_UHR_DPS*
> + * @dps_params:

I think it being in a DPS specific struct, we can drop the dps_ prefix
here?

> +/**
> + * struct ieee80211_uhr_dbe_info - DBE operation information
> + *
> + * This structure is the "DBE Operation Parameters field" of
> + * "UHR Operation Element" fields as described in P802.11bn_D1.3
> + * subclause 9.4.2.353. See Figure 9-aa6.
> + *
> + * Refer to IEEE80211_UHR_DBE_OPER*
> + * @dbe_params:

same here

> +/**
> + * struct ieee80211_uhr_p_edca_info - P-EDCA operation information
> + *
> + * This structure is the "P-EDCA Operation Parameters field" of
> + * "UHR Operation Element" fields as described in P802.11bn_D1.3
> + * subclause 9.4.2.353. See Figure 9-aa5.
> + *
> + * Refer to IEEE80211_UHR_P_EDCA*
> + * @p_edca_ec: The P-EDCA ECWmin, P-EDCA and ECWmax
> + *	fields indicate the CWmin and CWmax
> + *	value that are used by a P-EDCA STA during P-EDCA contention.
> + * @p_edca_params: The AIFSN field indicate the AIFSN value that are

and here

johannes

^ permalink raw reply

* [PATCH v3][next] wifi: ath6kl: wmi: Avoid -Wflex-array-member-not-at-end warning
From: Gustavo A. R. Silva @ 2026-02-24  4:46 UTC (permalink / raw)
  To: Jeff Johnson
  Cc: linux-wireless, linux-kernel, Gustavo A. R. Silva,
	linux-hardening

-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Remove unused structures bss_bias_info and bss_bias, and member
bss in struct roam_ctrl_cmd.

After these changes, the size of struct roam_ctrl_cmd, along
with its member's offsets remain the same, hence the memory layout
doesn't change:

Before changes:
struct roam_ctrl_cmd {
	union {
		u8                 bssid[6];             /*     0     6 */
		u8                 roam_mode;            /*     0     1 */
		struct bss_bias_info bss;                /*     0     1 */
		struct low_rssi_scan_params params;      /*     0     8 */
	} info;                                          /*     0     8 */
	u8                         roam_ctrl;            /*     8     1 */

	/* size: 9, cachelines: 1, members: 2 */
	/* last cacheline: 9 bytes */
} __attribute__((__packed__));

After changes:
struct roam_ctrl_cmd {
	union {
		u8                 bssid[6];             /*     0     6 */
		u8                 roam_mode;            /*     0     1 */
		struct low_rssi_scan_params params;      /*     0     8 */
	} info;                                          /*     0     8 */
	u8                         roam_ctrl;            /*     8     1 */

	/* size: 9, cachelines: 1, members: 2 */
	/* last cacheline: 9 bytes */
} __attribute__((__packed__));

With these changes fix the following warning:

drivers/net/wireless/ath/ath6kl/wmi.h:1658:20: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Changes in v3:
 - Remove unused structures. (Jeff)

Changes in v2:
 - Create new separate struct bss_bias_info_hdr, and use
   transparent struct members (in struct bss_bias_info)
   instead of rearranging members in struct roam_ctrl_cmd.
 - Update subject line - Add 'wifi:' prefix.
 - Link: https://lore.kernel.org/linux-hardening/aZP4RI-uN2001cBh@kspp/

v1:
 - Link: https://lore.kernel.org/linux-hardening/aR153k4ExCD-QTMq@kspp/

 drivers/net/wireless/ath/ath6kl/wmi.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h
index 3080d82e25cc..8fbece3fdad9 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.h
+++ b/drivers/net/wireless/ath/ath6kl/wmi.h
@@ -1630,16 +1630,6 @@ enum wmi_roam_mode {
 	WMI_LOCK_BSS_MODE = 3, /* Lock to the current BSS */
 };
 
-struct bss_bias {
-	u8 bssid[ETH_ALEN];
-	s8 bias;
-} __packed;
-
-struct bss_bias_info {
-	u8 num_bss;
-	struct bss_bias bss_bias[];
-} __packed;
-
 struct low_rssi_scan_params {
 	__le16 lrssi_scan_period;
 	a_sle16 lrssi_scan_threshold;
@@ -1652,7 +1642,6 @@ struct roam_ctrl_cmd {
 	union {
 		u8 bssid[ETH_ALEN]; /* WMI_FORCE_ROAM */
 		u8 roam_mode; /* WMI_SET_ROAM_MODE */
-		struct bss_bias_info bss; /* WMI_SET_HOST_BIAS */
 		struct low_rssi_scan_params params; /* WMI_SET_LRSSI_SCAN_PARAMS
 						     */
 	} __packed info;
-- 
2.43.0


^ permalink raw reply related

* [syzbot] [usb?] BUG: sleeping function called from invalid context in usb_tx_block
From: syzbot @ 2026-02-24 18:56 UTC (permalink / raw)
  To: libertas-dev, linux-kernel, linux-usb, linux-wireless,
	syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    8bf22c33e7a1 Merge tag 'net-7.0-rc1' of git://git.kernel.o..
git tree:       https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
console output: https://syzkaller.appspot.com/x/log.txt?x=127b9722580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=1ff39736314a9939
dashboard link: https://syzkaller.appspot.com/bug?extid=74afbb6355826ffc2239
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=1561fffa580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1031795a580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/0e19c10e1a0e/disk-8bf22c33.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8f3209ea7fd5/vmlinux-8bf22c33.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9be7f93d0a22/bzImage-8bf22c33.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+74afbb6355826ffc2239@syzkaller.appspotmail.com

usb8xxx: URB in failure status: -2
BUG: sleeping function called from invalid context at drivers/usb/core/urb.c:706
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/1
preempt_count: 101, expected: 0
RCU nest depth: 0, expected: 0
no locks held by swapper/1/0.
irq event stamp: 328389
hardirqs last  enabled at (328388): [<ffffffff876b10b2>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:178 [inline]
hardirqs last  enabled at (328388): [<ffffffff876b10b2>] _raw_spin_unlock_irqrestore+0x52/0x80 kernel/locking/spinlock.c:194
hardirqs last disabled at (328389): [<ffffffff876b0dc2>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:130 [inline]
hardirqs last disabled at (328389): [<ffffffff876b0dc2>] _raw_spin_lock_irqsave+0x52/0x60 kernel/locking/spinlock.c:162
softirqs last  enabled at (328372): [<ffffffff8176f0bd>] __do_softirq kernel/softirq.c:656 [inline]
softirqs last  enabled at (328372): [<ffffffff8176f0bd>] invoke_softirq kernel/softirq.c:496 [inline]
softirqs last  enabled at (328372): [<ffffffff8176f0bd>] __irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
softirqs last disabled at (328385): [<ffffffff8176f0bd>] __do_softirq kernel/softirq.c:656 [inline]
softirqs last disabled at (328385): [<ffffffff8176f0bd>] invoke_softirq kernel/softirq.c:496 [inline]
softirqs last disabled at (328385): [<ffffffff8176f0bd>] __irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 UID: 0 PID: 0 Comm: swapper/1 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 __might_resched.cold+0x1ec/0x232 kernel/sched/core.c:8884
 usb_kill_urb+0x8e/0x320 drivers/usb/core/urb.c:706
 usb_tx_block+0x91/0x320 drivers/net/wireless/marvell/libertas/if_usb.c:429
 if_usb_send_fw_pkt.isra.0+0x2e4/0x550 drivers/net/wireless/marvell/libertas/if_usb.c:366
 if_usb_receive_fwload+0x5d3/0x780 drivers/net/wireless/marvell/libertas/if_usb.c:592
 __usb_hcd_giveback_urb+0x38d/0x610 drivers/usb/core/hcd.c:1657
 usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741
 dummy_timer+0xd85/0x3670 drivers/usb/gadget/udc/dummy_hcd.c:1995
 __run_hrtimer kernel/time/hrtimer.c:1785 [inline]
 __hrtimer_run_queues+0x50e/0xa70 kernel/time/hrtimer.c:1849
 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1866
 handle_softirqs+0x1de/0x9d0 kernel/softirq.c:622
 __do_softirq kernel/softirq.c:656 [inline]
 invoke_softirq kernel/softirq.c:496 [inline]
 __irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline]
 sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1056
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697
RIP: 0010:pv_native_safe_halt+0xf/0x20 arch/x86/kernel/paravirt.c:63
Code: be b1 01 e9 13 e8 02 00 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 66 90 0f 00 2d d3 f1 1d 00 fb f4 <c3> cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 66 90 90 90 90 90 90
RSP: 0018:ffffc9000013fe00 EFLAGS: 00000242
RAX: 00000000000502bf RBX: ffff8881022a1d00 RCX: ffffffff876888d5
RDX: 0000000000000000 RSI: ffffffff8901d71b RDI: ffffffff87afa420
RBP: 0000000000000001 R08: 0000000000000001 R09: ffffed103eae6725
R10: ffff8881f573392b R11: 0000000000000000 R12: ffffed10204543a0
R13: 0000000000000001 R14: ffffffff8aefe2d0 R15: 0000000000000000
 arch_safe_halt arch/x86/include/asm/paravirt.h:73 [inline]
 default_idle+0x9/0x10 arch/x86/kernel/process.c:767
 default_idle_call+0x6c/0xb0 kernel/sched/idle.c:122
 cpuidle_idle_call kernel/sched/idle.c:191 [inline]
 do_idle+0x35b/0x4b0 kernel/sched/idle.c:332
 cpu_startup_entry+0x4f/0x60 kernel/sched/idle.c:430
 start_secondary+0x21d/0x2d0 arch/x86/kernel/smpboot.c:312
 common_startup_64+0x13e/0x148
 </TASK>
BUG: scheduling while atomic: swapper/1/0/0x00000102
no locks held by swapper/1/0.
Modules linked in:
irq event stamp: 328389
hardirqs last  enabled at (328388): [<ffffffff876b10b2>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:178 [inline]
hardirqs last  enabled at (328388): [<ffffffff876b10b2>] _raw_spin_unlock_irqrestore+0x52/0x80 kernel/locking/spinlock.c:194
hardirqs last disabled at (328389): [<ffffffff876b0dc2>] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:130 [inline]
hardirqs last disabled at (328389): [<ffffffff876b0dc2>] _raw_spin_lock_irqsave+0x52/0x60 kernel/locking/spinlock.c:162
softirqs last  enabled at (328372): [<ffffffff8176f0bd>] __do_softirq kernel/softirq.c:656 [inline]
softirqs last  enabled at (328372): [<ffffffff8176f0bd>] invoke_softirq kernel/softirq.c:496 [inline]
softirqs last  enabled at (328372): [<ffffffff8176f0bd>] __irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
softirqs last disabled at (328385): [<ffffffff8176f0bd>] __do_softirq kernel/softirq.c:656 [inline]
softirqs last disabled at (328385): [<ffffffff8176f0bd>] invoke_softirq kernel/softirq.c:496 [inline]
softirqs last disabled at (328385): [<ffffffff8176f0bd>] __irq_exit_rcu+0xed/0x150 kernel/softirq.c:723
Preemption disabled at:
[<0000000000000000>] 0x0
----------------
Code disassembly (best guess):
   0:	be b1 01 e9 13       	mov    $0x13e901b1,%esi
   5:	e8 02 00 0f 1f       	call   0x1f0f000c
   a:	00 90 90 90 90 90    	add    %dl,-0x6f6f6f70(%rax)
  10:	90                   	nop
  11:	90                   	nop
  12:	90                   	nop
  13:	90                   	nop
  14:	90                   	nop
  15:	90                   	nop
  16:	90                   	nop
  17:	90                   	nop
  18:	90                   	nop
  19:	90                   	nop
  1a:	90                   	nop
  1b:	f3 0f 1e fa          	endbr64
  1f:	66 90                	xchg   %ax,%ax
  21:	0f 00 2d d3 f1 1d 00 	verw   0x1df1d3(%rip)        # 0x1df1fb
  28:	fb                   	sti
  29:	f4                   	hlt
* 2a:	c3                   	ret <-- trapping instruction
  2b:	cc                   	int3
  2c:	cc                   	int3
  2d:	cc                   	int3
  2e:	cc                   	int3
  2f:	66 2e 0f 1f 84 00 00 	cs nopw 0x0(%rax,%rax,1)
  36:	00 00 00
  39:	66 90                	xchg   %ax,%ax
  3b:	90                   	nop
  3c:	90                   	nop
  3d:	90                   	nop
  3e:	90                   	nop
  3f:	90                   	nop


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

^ permalink raw reply

* Re: [PATCH v1] wifi: ath9k: Fix typo
From: Jeff Johnson @ 2026-02-24 18:45 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, Alejandro Colomar,
	linux-wireless
  Cc: Rajkumar Manoharan, John W. Linville
In-Reply-To: <871pibo5fj.fsf@toke.dk>

On 2/23/2026 7:17 AM, Toke Høiland-Jørgensen wrote:
> Alejandro Colomar <alx@kernel.org> writes:
> 
>> This only worked by chance, because all callers of this macro used the
>> same identifiers that were expected by the macro.
>>
>> 	$ grep -rn ath_for_each_chanctx
>> 	drivers/net/wireless/ath/ath9k/main.c:1576:	ath_for_each_chanctx(sc, ctx)
>> 	drivers/net/wireless/ath/ath9k/main.c:2554:	ath_for_each_chanctx(sc, ctx) {
>> 	drivers/net/wireless/ath/ath9k/channel.c:165:	ath_for_each_chanctx(sc, ctx) {
>> 	drivers/net/wireless/ath/ath9k/channel.c:291:	ath_for_each_chanctx(sc, ctx) {
>> 	drivers/net/wireless/ath/ath9k/channel.c:861:	ath_for_each_chanctx(sc, ctx) {
>> 	drivers/net/wireless/ath/ath9k/debug.c:717:	ath_for_each_chanctx(sc, ctx) {
>> 	drivers/net/wireless/ath/ath9k/ath9k.h:446:#define ath_for_each_chanctx(_sc, _ctx)                               \
>>
>> Fixes: c4dc0d040e35 (2014-06-19; "ath9k: Fetch appropriate operating channel context")

I'm dropping the Fixes tag since the existing code actually works and hence
there is no need to backport to LTS kernels.

>> Cc: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
>> Cc: John W. Linville <linville@tuxdriver.com>
>> Cc: Toke Høiland-Jørgensen <toke@toke.dk>
>> Signed-off-by: Alejandro Colomar <alx@kernel.org>
> 
> Yeah, looks reasonable - thanks!
> 
> Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
> 


^ permalink raw reply

* Re: [PATCH ath-next] wifi: ath5k: ahb: use devm for ioremap
From: Jiri Slaby @ 2026-02-24 18:23 UTC (permalink / raw)
  To: Rosen Penev, linux-wireless; +Cc: Nick Kossifidis, Luis Chamberlain, open list
In-Reply-To: <20260223030803.19451-1-rosenp@gmail.com>

On 23. 02. 26, 4:08, Rosen Penev wrote:
> Simplifies the code by quite a bit in probe.
> 
> Also allows removing a goto and returning directly.

Looks good except:

> --- a/drivers/net/wireless/ath/ath5k/ahb.c
> +++ b/drivers/net/wireless/ath/ath5k/ahb.c
...
> @@ -95,35 +94,21 @@ static int ath_ahb_probe(struct platform_device *pdev)
> 
>   	if (!dev_get_platdata(&pdev->dev)) {
>   		dev_err(&pdev->dev, "no platform data specified\n");
> -		ret = -EINVAL;
> -		goto err_out;
> +		return -EINVAL;
>   	}
> 
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (res == NULL) {
> -		dev_err(&pdev->dev, "no memory resource found\n");
> -		ret = -ENXIO;
> -		goto err_out;
> -	}
> -
> -	mem = ioremap(res->start, resource_size(res));
> -	if (mem == NULL) {
> -		dev_err(&pdev->dev, "ioremap failed\n");
> -		ret = -ENOMEM;
> -		goto err_out;
> -	}
> +	mem = devm_platform_ioremap_resources(pdev, 0);

Is this a typo or devm_platform_ioremap_resources() is new?

-- 
js
suse labs

^ permalink raw reply

* Re: [RFC PATCH v2 2/8] wifi: mac80211: change public RX API to use link stations
From: Jeff Johnson @ 2026-02-24 18:22 UTC (permalink / raw)
  To: Benjamin Berg, linux-wireless
  Cc: Rameshkumar Sundaram, Ramasamy Kaliappan, Benjamin Berg
In-Reply-To: <20260223133818.f2ed2b718c41.I4a2d45609e94b52654b10ec572e59a45d09c41f4@changeid>

On 2/23/2026 4:38 AM, Benjamin Berg wrote:
> @@ -1340,9 +1341,14 @@ void ath12k_dp_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev, struct napi_struc
>  
>  	pubsta = peer ? peer->sta : NULL;
>  
> -	if (pubsta && pubsta->valid_links) {
> -		status->link_valid = 1;
> -		status->link_id = peer->hw_links[rxcb->hw_link_id];
> +	if (pubsta) {
> +		if (pubsta->valid_links) {
> +			u8 link_id = peer->hw_links[rxcb->hw_link_id];

nit: Missing a blank line after declarations

> +			link_pubsta =
> +				rcu_dereference(pubsta->link[link_id]);
> +		} else {
> +			link_pubsta = &pubsta->deflink;
> +		}
>  	}
>  
>  	ath12k_dbg(dp->ab, ATH12K_DBG_DATA,

^ permalink raw reply

* Re: [RFC PATCH v2 8/8] wifi: mac80211: pass error station if non-STA transmit was requested
From: Ramasamy Kaliappan @ 2026-02-24 17:47 UTC (permalink / raw)
  To: Benjamin Berg, linux-wireless; +Cc: Rameshkumar Sundaram, Benjamin Berg
In-Reply-To: <20260223133818.00346f27a7d3.I5ffe7bc0d4ccefca5c1e506d5d3d482e13989cda@changeid>



On 2/23/2026 6:08 PM, Benjamin Berg wrote:
> From: Benjamin Berg <benjamin.berg@intel.com>
> 
> When cfg80211 requested a transmit without a station, pass an error
> station to ieee80211_tx_skb_tid instead of the correct one.
> 
> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
> ---
>   net/mac80211/offchannel.c | 13 +++++++++----
>   1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
> index 0a8b4c5e8c12..24a55186b87f 100644
> --- a/net/mac80211/offchannel.c
> +++ b/net/mac80211/offchannel.c
> @@ -857,8 +857,10 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>   			need_offchan = true;
>   
>   		rcu_read_lock();
> -		sta = sta_info_get_bss(sdata, mgmt->da);
> -		mlo_sta = sta && sta->sta.mlo;
> +		if (!params->no_sta) {
> +			sta = sta_info_get_bss(sdata, mgmt->da);
> +			mlo_sta = sta && sta->sta.mlo;
> +		}
>   
>   		if (!ieee80211_is_action(mgmt->frame_control) ||
>   		    mgmt->u.action.category == WLAN_CATEGORY_PUBLIC ||
> @@ -887,7 +889,8 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>   		     local->ops->remain_on_channel &&
>   		     memcmp(sdata->vif.cfg.ap_addr, mgmt->bssid, ETH_ALEN))) {
>   			need_offchan = true;
> -		} else if (sdata->u.mgd.associated &&
> +		} else if (!params->no_sta &&
> +			   sdata->u.mgd.associated &&
>   			   ether_addr_equal(sdata->vif.cfg.ap_addr, mgmt->da)) {
>   			sta = sta_info_get_bss(sdata, mgmt->da);
>   			mlo_sta = sta && sta->sta.mlo;
> @@ -1026,7 +1029,9 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>   	}
>   
>   	if (!need_offchan) {
> -		ieee80211_tx_skb_tid(sdata, skb, NULL, 7, link_id);
> +		ieee80211_tx_skb_tid(sdata, skb,
> +				     sta ? sta : ERR_PTR(-ENOENT),
Do we need to pass sta here? I didn't see sta actually being used in 
__ieee80211_tx_skb_tid_band().
> +				     7, link_id);
>   		ret = 0;
>   		goto out_unlock;
>   	}


Thanks,
Ramasamy

^ permalink raw reply

* Re: [RFC PATCH v2 7/8] wifi: mac80211: pass station to ieee80211_tx_skb_tid
From: Ramasamy Kaliappan @ 2026-02-24 17:45 UTC (permalink / raw)
  To: Benjamin Berg, linux-wireless; +Cc: Rameshkumar Sundaram, Benjamin Berg
In-Reply-To: <20260223133818.c932d807e54e.Ib7be90db0d3712d14e7a292023ff3d922baef860@changeid>



On 2/23/2026 6:08 PM, Benjamin Berg wrote:
> From: Benjamin Berg <benjamin.berg@intel.com>
> 
> The station may be relevant for queuing and will also generally be
> resolved in some cases. However, we want to be able to prevent looking
> up the station based on the address.
> 
> Add a station parameter, which can be set to the correct station, to an
> error value to prevent station lookup or to NULL to get the old
> behaviour where the address is used to find the appropriate station.
> 
> Also disable the station lookup for ieee80211_tx_skb_tid_band already as
> it does not make any sense to find a station when doing an off-channel
> transmit.
> 
> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
> ---
>   net/mac80211/agg-tx.c      |  6 +++---
>   net/mac80211/ht.c          |  4 ++--
>   net/mac80211/ieee80211_i.h | 14 ++++++++------
>   net/mac80211/offchannel.c  |  2 +-
>   net/mac80211/rx.c          |  2 +-
>   net/mac80211/tdls.c        |  4 ++--
>   net/mac80211/tx.c          |  8 +++++---
>   7 files changed, 22 insertions(+), 18 deletions(-)
> 
> diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
> index d981b0fc57bf..6a5754351f08 100644
> --- a/net/mac80211/agg-tx.c
> +++ b/net/mac80211/agg-tx.c
> @@ -9,7 +9,7 @@
>    * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
>    * Copyright 2007-2010, Intel Corporation
>    * Copyright(c) 2015-2017 Intel Deutschland GmbH
> - * Copyright (C) 2018 - 2024 Intel Corporation
> + * Copyright (C) 2018 - 2024, 2026 Intel Corporation
>    */
>   
>   #include <linux/ieee80211.h>
> @@ -97,7 +97,7 @@ static void ieee80211_send_addba_request(struct sta_info *sta, u16 tid,
>   	if (sta->sta.deflink.he_cap.has_he)
>   		ieee80211_add_addbaext(skb, 0, agg_size);
>   
> -	ieee80211_tx_skb_tid(sdata, skb, tid, -1);
> +	ieee80211_tx_skb_tid(sdata, skb, NULL, tid, -1);
>   }
>   
>   void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn)
> @@ -126,7 +126,7 @@ void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn)
>   
>   	IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT |
>   					IEEE80211_TX_CTL_REQ_TX_STATUS;
> -	ieee80211_tx_skb_tid(sdata, skb, tid, -1);
> +	ieee80211_tx_skb_tid(sdata, skb, NULL, tid, -1);
>   }
>   EXPORT_SYMBOL(ieee80211_send_bar);
>   
> diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
> index 1c82a28b03de..f98f5a9a2ebe 100644
> --- a/net/mac80211/ht.c
> +++ b/net/mac80211/ht.c
> @@ -9,7 +9,7 @@
>    * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
>    * Copyright 2007-2010, Intel Corporation
>    * Copyright 2017	Intel Deutschland GmbH
> - * Copyright(c) 2020-2025 Intel Corporation
> + * Copyright(c) 2020-2026 Intel Corporation
>    */
>   
>   #include <linux/ieee80211.h>
> @@ -571,7 +571,7 @@ int ieee80211_send_smps_action(struct ieee80211_sub_if_data *sdata,
>   	info->status_data = IEEE80211_STATUS_TYPE_SMPS |
>   			    u16_encode_bits(status_link_id << 2 | smps,
>   					    IEEE80211_STATUS_SUBDATA_MASK);
> -	ieee80211_tx_skb_tid(sdata, skb, 7, link_id);
> +	ieee80211_tx_skb_tid(sdata, skb, NULL, 7, link_id);
>   
>   	return 0;
>   }
> diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
> index e60b814dd89e..793331c1d748 100644
> --- a/net/mac80211/ieee80211_i.h
> +++ b/net/mac80211/ieee80211_i.h
> @@ -2393,7 +2393,8 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata,
>   		    struct sta_info *sta, struct sk_buff *skb);
>   
>   void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
> -				 struct sk_buff *skb, int tid, int link_id,
> +				 struct sk_buff *skb, struct sta_info *sta,
> +				 int tid, int link_id,
>   				 enum nl80211_band band);
>   
>   static inline bool ieee80211_require_encrypted_assoc(__le16 fc,
> @@ -2411,22 +2412,23 @@ int ieee80211_lookup_ra_sta(struct ieee80211_sub_if_data *sdata,
>   
>   static inline void
>   ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
> -			  struct sk_buff *skb, int tid,
> -			  enum nl80211_band band)
> +			  struct sk_buff *skb, int tid, enum nl80211_band band)
do we need this hunk? There’s no functional change.
>   {
>   	rcu_read_lock();
> -	__ieee80211_tx_skb_tid_band(sdata, skb, tid, -1, band);
> +	__ieee80211_tx_skb_tid_band(sdata, skb, ERR_PTR(-ENOENT),
> +				    tid, -1, band);
>   	rcu_read_unlock();
>   }
>   
>   void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
> -			  struct sk_buff *skb, int tid, int link_id);
> +			  struct sk_buff *skb, struct sta_info *sta,
> +			  int tid, int link_id);
>   
>   static inline void ieee80211_tx_skb(struct ieee80211_sub_if_data *sdata,
>   				    struct sk_buff *skb)
>   {
>   	/* Send all internal mgmt frames on VO. Accordingly set TID to 7. */
> -	ieee80211_tx_skb_tid(sdata, skb, 7, -1);
> +	ieee80211_tx_skb_tid(sdata, skb, NULL, 7, -1);
>   }
>   
>   /**
> diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
> index ae82533e3c02..0a8b4c5e8c12 100644
> --- a/net/mac80211/offchannel.c
> +++ b/net/mac80211/offchannel.c
> @@ -1026,7 +1026,7 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
>   	}
>   
>   	if (!need_offchan) {
> -		ieee80211_tx_skb_tid(sdata, skb, 7, link_id);
> +		ieee80211_tx_skb_tid(sdata, skb, NULL, 7, link_id);
>   		ret = 0;
>   		goto out_unlock;
>   	}
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index ec718b7f3e16..5109791546a7 100644
> --- a/net/mac80211/rx.c	
> +++ b/net/mac80211/rx.c
> @@ -4072,7 +4072,7 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
>   					local->hw.offchannel_tx_hw_queue;
>   		}
>   
> -		__ieee80211_tx_skb_tid_band(rx->sdata, nskb, 7, -1,
> +		__ieee80211_tx_skb_tid_band(rx->sdata, nskb, rx->sta, 7, -1,
>   					    status->band);
>   	}
>   
> diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
> index dbbfe2d6842f..39a880ab7edb 100644
> --- a/net/mac80211/tdls.c
> +++ b/net/mac80211/tdls.c
> @@ -6,7 +6,7 @@
>    * Copyright 2014, Intel Corporation
>    * Copyright 2014  Intel Mobile Communications GmbH
>    * Copyright 2015 - 2016 Intel Deutschland GmbH
> - * Copyright (C) 2019, 2021-2025 Intel Corporation
> + * Copyright (C) 2019, 2021-2026 Intel Corporation
>    */
>   
>   #include <linux/ieee80211.h>
> @@ -1067,7 +1067,7 @@ ieee80211_tdls_prep_mgmt_packet(struct wiphy *wiphy, struct net_device *dev,
>   	}
>   
>   	if (action_code == WLAN_PUB_ACTION_TDLS_DISCOVER_RES) {
> -		ieee80211_tx_skb_tid(sdata, skb, 7, link_id);
> +		ieee80211_tx_skb_tid(sdata, skb, sta, 7, link_id);
>   		return 0;
>   	}
>   
> diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
> index 007f5a368d41..c788d48ef365 100644
> --- a/net/mac80211/tx.c
> +++ b/net/mac80211/tx.c
> @@ -6235,7 +6235,8 @@ void ieee80211_unreserve_tid(struct ieee80211_sta *pubsta, u8 tid)
>   EXPORT_SYMBOL(ieee80211_unreserve_tid);
>   
>   void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
> -				 struct sk_buff *skb, int tid, int link_id,
> +				 struct sk_buff *skb, struct sta_info *sta,
*sta is not used anywhere in this function, do we actually need to add it?
> +				 int tid, int link_id,
>   				 enum nl80211_band band)
>   {
>   	const struct ieee80211_hdr *hdr = (void *)skb->data;
> @@ -6292,7 +6293,8 @@ void __ieee80211_tx_skb_tid_band(struct ieee80211_sub_if_data *sdata,
>   }
>   
>   void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
> -			  struct sk_buff *skb, int tid, int link_id)
> +			  struct sk_buff *skb, struct sta_info *sta,
> +			  int tid, int link_id)
>   {
>   	struct ieee80211_chanctx_conf *chanctx_conf;
>   	enum nl80211_band band;
> @@ -6317,7 +6319,7 @@ void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
>   		band = 0;
>   	}
>   
> -	__ieee80211_tx_skb_tid_band(sdata, skb, tid, link_id, band);
> +	__ieee80211_tx_skb_tid_band(sdata, skb, sta, tid, link_id, band);
>   	rcu_read_unlock();
>   }
>   

For the no_sta tx path, The sta lookup happens in ieee80211_tx_prepare() 
(invoked by ieee80211_tx). My understanding is that the skb still ends 
up being queued with a sta.  Is that correct?


Thanks,
Ramasamy

^ permalink raw reply

* Re: [RFC PATCH v2 2/8] wifi: mac80211: change public RX API to use link stations
From: Ramasamy Kaliappan @ 2026-02-24 17:41 UTC (permalink / raw)
  To: Benjamin Berg, linux-wireless; +Cc: Rameshkumar Sundaram, Benjamin Berg
In-Reply-To: <20260223133818.f2ed2b718c41.I4a2d45609e94b52654b10ec572e59a45d09c41f4@changeid>



On 2/23/2026 6:08 PM, Benjamin Berg wrote:
> From: Benjamin Berg <benjamin.berg@intel.com>
> 
> If a station is passed then the link ID also needs to be known. As such,
> it is a more natural API to simply pass the link station directly rather
> than pushing the link information into the RX status.
> 
> Furthermore, having the link ID in the RX status is not actually correct
> because the link IDs are VIF specific and there may be multiple VIFs. In
> the case of a station this relationship is clear, but then one may as
> well use the link station.
> 
> This patch only changes the API and emulates the old (incorrect)
> behaviour for now. The mac80211 RX code will be updated in later
> patches.
> 
> Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
> ---
>   drivers/net/wireless/ath/ath11k/dp_rx.c       |  2 +-
>   drivers/net/wireless/ath/ath12k/dp_mon.c      | 18 +++++++--------
>   drivers/net/wireless/ath/ath12k/dp_rx.c       | 15 +++++++++----
>   drivers/net/wireless/intel/iwlwifi/mld/rx.c   |  7 +-----
>   drivers/net/wireless/intel/iwlwifi/mvm/rx.c   |  2 +-
>   drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c |  6 ++---
>   drivers/net/wireless/mediatek/mt76/mac80211.c | 22 +++++++++++--------
>   drivers/net/wireless/realtek/rtw89/core.c     |  6 -----
>   drivers/net/wireless/virtual/mac80211_hwsim.c |  3 ---
>   include/net/mac80211.h                        | 16 ++++++++++----
>   net/mac80211/rx.c                             | 20 ++++++++++++-----
>   11 files changed, 65 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
> index b9e976ddcbbf..911e40178234 100644
> --- a/drivers/net/wireless/ath/ath11k/dp_rx.c
> +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
> @@ -2500,7 +2500,7 @@ static void ath11k_dp_rx_deliver_msdu(struct ath11k *ar, struct napi_struct *nap
>   	    !(is_mcbc && rx_status->flag & RX_FLAG_DECRYPTED))
>   		rx_status->flag |= RX_FLAG_8023;
>   
> -	ieee80211_rx_napi(ar->hw, pubsta, msdu, napi);
> +	ieee80211_rx_napi(ar->hw, &pubsta->deflink, msdu, napi);
>   }
>   
>   static int ath11k_dp_rx_process_msdu(struct ath11k *ar,
> diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
> index 737287a9aa46..71f14f2e15bd 100644
> --- a/drivers/net/wireless/ath/ath12k/dp_mon.c
> +++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
> @@ -508,7 +508,7 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
>   	};
>   	struct ieee80211_rx_status *rx_status;
>   	struct ieee80211_radiotap_he *he = NULL;
> -	struct ieee80211_sta *pubsta = NULL;
> +	struct ieee80211_link_sta *link_pubsta = NULL;
>   	struct ath12k_dp_link_peer *peer;
>   	struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
>   	struct hal_rx_desc_data rx_info;
> @@ -517,8 +517,6 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
>   	struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)msdu->data;
>   	u8 addr[ETH_ALEN] = {};
>   
> -	status->link_valid = 0;
> -
>   	if ((status->encoding == RX_ENC_HE) && !(status->flag & RX_FLAG_RADIOTAP_HE) &&
>   	    !(status->flag & RX_FLAG_SKIP_MONITOR)) {
>   		he = skb_push(msdu, sizeof(known));
> @@ -532,12 +530,11 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
>   	spin_lock_bh(&dp->dp_lock);
>   	peer = ath12k_dp_rx_h_find_link_peer(dp_pdev, msdu, &rx_info);
>   	if (peer && peer->sta) {
> -		pubsta = peer->sta;
> -		memcpy(addr, peer->addr, ETH_ALEN);
It appears memcpy of peer address is required, this shouldn't be 
removed, right?
> -		if (pubsta->valid_links) {
> -			status->link_valid = 1;
> -			status->link_id = peer->link_id;
> -		}
> +		if (peer->sta->valid_links)
> +			link_pubsta =
> +				rcu_dereference(peer->sta->link[peer->link_id]);
> +		else
> +			link_pubsta = &peer->sta->deflink;
>   	}
>   
>   	spin_unlock_bh(&dp->dp_lock);
> @@ -583,7 +580,8 @@ void ath12k_dp_mon_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev,
>   	    !(is_mcbc && rx_status->flag & RX_FLAG_DECRYPTED))
>   		rx_status->flag |= RX_FLAG_8023;
>   
> -	ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), pubsta, msdu, napi);
> +	ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), link_pubsta, msdu,
> +			  napi);
>   }
>   EXPORT_SYMBOL(ath12k_dp_mon_rx_deliver_msdu);
>   
> diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
> index a32ee9f8061a..49b161c5a878 100644
> --- a/drivers/net/wireless/ath/ath12k/dp_rx.c
> +++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
> @@ -1329,6 +1329,7 @@ void ath12k_dp_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev, struct napi_struc
>   	struct ath12k_dp *dp = dp_pdev->dp;
>   	struct ieee80211_rx_status *rx_status;
>   	struct ieee80211_sta *pubsta;
> +	struct ieee80211_link_sta *link_pubsta = NULL;
>   	struct ath12k_dp_peer *peer;
>   	struct ath12k_skb_rxcb *rxcb = ATH12K_SKB_RXCB(msdu);
>   	struct ieee80211_rx_status *status = rx_info->rx_status;
> @@ -1340,9 +1341,14 @@ void ath12k_dp_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev, struct napi_struc
>   
>   	pubsta = peer ? peer->sta : NULL;
>   
> -	if (pubsta && pubsta->valid_links) {
> -		status->link_valid = 1;
> -		status->link_id = peer->hw_links[rxcb->hw_link_id];
> +	if (pubsta) {
> +		if (pubsta->valid_links) {
> +			u8 link_id = peer->hw_links[rxcb->hw_link_id];
> +			link_pubsta =
> +				rcu_dereference(pubsta->link[link_id]);
> +		} else {
> +			link_pubsta = &pubsta->deflink;
> +		}
>   	}
>   
>   	ath12k_dbg(dp->ab, ATH12K_DBG_DATA,
> @@ -1388,7 +1394,8 @@ void ath12k_dp_rx_deliver_msdu(struct ath12k_pdev_dp *dp_pdev, struct napi_struc
>   	    !(is_mcbc && rx_status->flag & RX_FLAG_DECRYPTED))
>   		rx_status->flag |= RX_FLAG_8023;
>   
> -	ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), pubsta, msdu, napi);
> +	ieee80211_rx_napi(ath12k_pdev_dp_to_hw(dp_pdev), link_pubsta, msdu,
> +			  napi);
>   }
>   EXPORT_SYMBOL(ath12k_dp_rx_deliver_msdu);
>   
> diff --git a/drivers/net/wireless/intel/iwlwifi/mld/rx.c b/drivers/net/wireless/intel/iwlwifi/mld/rx.c
> index de2feeb74009..2a12ae412bfd 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mld/rx.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mld/rx.c
> @@ -131,7 +131,7 @@ void iwl_mld_pass_packet_to_mac80211(struct iwl_mld *mld,
>   		return;
>   	}
>   
> -	ieee80211_rx_napi(mld->hw, link_sta->sta, skb, napi);
> +	ieee80211_rx_napi(mld->hw, link_sta, skb, napi);
>   }
>   EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_mld_pass_packet_to_mac80211);
>   
> @@ -1765,11 +1765,6 @@ iwl_mld_rx_with_sta(struct iwl_mld *mld, struct ieee80211_hdr *hdr,
>   
>   	rx_status = IEEE80211_SKB_RXCB(skb);
>   
> -	if (link_sta && sta->valid_links) {
> -		rx_status->link_valid = true;
> -		rx_status->link_id = link_sta->link_id;
> -	}
> -
>   	/* fill checksum */
>   	if (ieee80211_is_data(hdr->frame_control) &&
>   	    pkt->len_n_flags & cpu_to_le32(FH_RSCSR_RPA_EN)) {
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
> index d0c0faae0122..a83bede06487 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c
> @@ -90,7 +90,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
>   				fraglen, rxb->truesize);
>   	}
>   
> -	ieee80211_rx_napi(mvm->hw, sta, skb, napi);
> +	ieee80211_rx_napi(mvm->hw, &sta->deflink, skb, napi);
>   }
>   
>   /*
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
> index 7f0b4f5daa21..fe5a2d0a798b 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
> @@ -1,6 +1,6 @@
>   // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
>   /*
> - * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
> + * Copyright (C) 2012-2014, 2018-2026 Intel Corporation
>    * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
>    * Copyright (C) 2015-2017 Intel Deutschland GmbH
>    */
> @@ -243,7 +243,7 @@ static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
>   		return;
>   	}
>   
> -	ieee80211_rx_napi(mvm->hw, sta, skb, napi);
> +	ieee80211_rx_napi(mvm->hw, &sta->deflink, skb, napi);
>   }
>   
>   static bool iwl_mvm_used_average_energy(struct iwl_mvm *mvm,
> @@ -2528,7 +2528,7 @@ void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi,
>   	}
>   
>   	rcu_read_lock();
> -	ieee80211_rx_napi(mvm->hw, sta, skb, napi);
> +	ieee80211_rx_napi(mvm->hw, &sta->deflink, skb, napi);
>   	rcu_read_unlock();
>   }
>   
> diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c
> index 75772979f438..a0b887c83591 100644
> --- a/drivers/net/wireless/mediatek/mt76/mac80211.c
> +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c
> @@ -1232,7 +1232,7 @@ EXPORT_SYMBOL(mt76_rx_signal);
>   static void
>   mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb,
>   		struct ieee80211_hw **hw,
> -		struct ieee80211_sta **sta)
> +		struct ieee80211_link_sta **link_sta)
>   {
>   	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
>   	struct ieee80211_hdr *hdr = mt76_skb_get_hdr(skb);
> @@ -1279,11 +1279,15 @@ mt76_rx_convert(struct mt76_dev *dev, struct sk_buff *skb,
>   	       sizeof(mstat.chain_signal));
>   
>   	if (mstat.wcid) {
> -		status->link_valid = mstat.wcid->link_valid;
> -		status->link_id = mstat.wcid->link_id;
> +		struct ieee80211_sta *sta = wcid_to_sta(mstat.wcid);
> +
> +		if (mstat.wcid->link_valid)
> +			*link_sta =
> +				rcu_dereference(sta->link[mstat.wcid->link_id]);
> +		else
> +			*link_sta = &sta->deflink;
>   	}
>   
> -	*sta = wcid_to_sta(mstat.wcid);
>   	*hw = mt76_phy_hw(dev, mstat.phy_idx);
>   }
>   
> @@ -1507,7 +1511,7 @@ mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb)
>   void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
>   		      struct napi_struct *napi)
>   {
> -	struct ieee80211_sta *sta;
> +	struct ieee80211_link_sta *link_sta;
>   	struct ieee80211_hw *hw;
>   	struct sk_buff *skb, *tmp;
>   	LIST_HEAD(list);
> @@ -1518,8 +1522,8 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
>   
>   		mt76_check_ccmp_pn(skb);
>   		skb_shinfo(skb)->frag_list = NULL;
> -		mt76_rx_convert(dev, skb, &hw, &sta);
> -		ieee80211_rx_list(hw, sta, skb, &list);
> +		mt76_rx_convert(dev, skb, &hw, &link_sta);
> +		ieee80211_rx_list(hw, link_sta, skb, &list);
>   
>   		/* subsequent amsdu frames */
>   		while (nskb) {
> @@ -1527,8 +1531,8 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
>   			nskb = nskb->next;
>   			skb->next = NULL;
>   
> -			mt76_rx_convert(dev, skb, &hw, &sta);
> -			ieee80211_rx_list(hw, sta, skb, &list);
> +			mt76_rx_convert(dev, skb, &hw, &link_sta);
> +			ieee80211_rx_list(hw, link_sta, skb, &list);
>   		}
>   	}
>   	spin_unlock(&dev->rx_lock);
> diff --git a/drivers/net/wireless/realtek/rtw89/core.c b/drivers/net/wireless/realtek/rtw89/core.c
> index 6e77522bcd8f..f6bcf309936d 100644
> --- a/drivers/net/wireless/realtek/rtw89/core.c
> +++ b/drivers/net/wireless/realtek/rtw89/core.c
> @@ -2953,7 +2953,6 @@ static void rtw89_vif_rx_stats_iter(void *data, u8 *mac,
>   	struct rtw89_pkt_stat *pkt_stat = &rtwdev->phystat.cur_pkt_stat;
>   	struct rtw89_rx_desc_info *desc_info = iter_data->desc_info;
>   	struct sk_buff *skb = iter_data->skb;
> -	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
>   	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
>   	struct rtw89_rx_phy_ppdu *phy_ppdu = iter_data->phy_ppdu;
>   	bool is_mld = ieee80211_vif_is_mld(vif);
> @@ -2988,11 +2987,6 @@ static void rtw89_vif_rx_stats_iter(void *data, u8 *mac,
>   	if (!ether_addr_equal(target_bssid, bssid))
>   		goto out;
>   
> -	if (is_mld) {
> -		rx_status->link_valid = true;
> -		rx_status->link_id = rtwvif_link->link_id;
> -	}
> -
>   	if (ieee80211_is_beacon(hdr->frame_control)) {
>   		if (vif->type == NL80211_IFTYPE_STATION &&
>   		    !test_bit(RTW89_FLAG_WOWLAN, rtwdev->flags)) {
> diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c
> index 4d9f5f87e814..7d529aa129f8 100644
> --- a/drivers/net/wireless/virtual/mac80211_hwsim.c
> +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
> @@ -1755,9 +1755,6 @@ static void mac80211_hwsim_rx(struct mac80211_hwsim_data *data,
>   				sp->active_links_rx &= ~BIT(link_id);
>   			else
>   				sp->active_links_rx |= BIT(link_id);
> -
> -			rx_status->link_valid = true;
> -			rx_status->link_id = link_id;
>   		}
>   		rcu_read_unlock();
>   	}
> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
> index 7f9d96939a4e..4d9dbd35369b 100644
> --- a/include/net/mac80211.h
> +++ b/include/net/mac80211.h
> @@ -5207,14 +5207,18 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw);
>    * mixed for a single hardware. Must not run concurrently with
>    * ieee80211_tx_status_skb() or ieee80211_tx_status_ni().
>    *
> + * For data frames, when hardware has done address translation, a link station
> + * has to be provided and the frequency information may be skipped.
> + *
>    * This function must be called with BHs disabled and RCU read lock
>    *
>    * @hw: the hardware this frame came in on
> - * @sta: the station the frame was received from, or %NULL
> + * @link_sta: the link station the data frame was received from, or %NULL
>    * @skb: the buffer to receive, owned by mac80211 after this call
>    * @list: the destination list
>    */
> -void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
> +void ieee80211_rx_list(struct ieee80211_hw *hw,
> +		       struct ieee80211_link_sta *link_sta,
>   		       struct sk_buff *skb, struct list_head *list);
>   
>   /**
> @@ -5232,14 +5236,18 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
>    * mixed for a single hardware. Must not run concurrently with
>    * ieee80211_tx_status_skb() or ieee80211_tx_status_ni().
>    *
> + * For data frames, when hardware has done address translation, a link station
> + * has to be provided and the frequency information may be skipped.
> + *
>    * This function must be called with BHs disabled.
>    *
>    * @hw: the hardware this frame came in on
> - * @sta: the station the frame was received from, or %NULL
> + * @link_sta: the link station the data frame was received from, or %NULL
>    * @skb: the buffer to receive, owned by mac80211 after this call
>    * @napi: the NAPI context
>    */
> -void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
> +void ieee80211_rx_napi(struct ieee80211_hw *hw,
> +		       struct ieee80211_link_sta *link_sta,
>   		       struct sk_buff *skb, struct napi_struct *napi);
>   
>   /**
> diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
> index 11d6c56c9d7e..4098f63ec824 100644
> --- a/net/mac80211/rx.c
> +++ b/net/mac80211/rx.c
> @@ -5432,7 +5432,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
>    * This is the receive path handler. It is called by a low level driver when an
>    * 802.11 MPDU is received from the hardware.
>    */
> -void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
> +void ieee80211_rx_list(struct ieee80211_hw *hw,
> +		       struct ieee80211_link_sta *link_pubsta,
>   		       struct sk_buff *skb, struct list_head *list)
>   {
>   	struct ieee80211_local *local = hw_to_local(hw);
> @@ -5440,6 +5441,7 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
>   	struct ieee80211_supported_band *sband;
>   	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
>   	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
> +	struct ieee80211_sta *pubsta;
>   
>   	WARN_ON_ONCE(softirq_count() == 0);
>   
> @@ -5562,8 +5564,15 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
>   		}
>   	}
>   
> -	if (WARN_ON_ONCE(status->link_id >= IEEE80211_LINK_UNSPECIFIED))
> -		goto drop;
> +	/* FIXME: Emulate the old driver behaviour for now */
> +	if (link_pubsta) {
> +		status->link_valid = 1;
> +		status->link_id = link_pubsta->link_id;
> +		pubsta = link_pubsta->sta;
> +	} else {
> +		status->link_valid = 0;
> +		pubsta = NULL;
> +	}
>   
>   	status->rx_flags = 0;
>   
> @@ -5595,7 +5604,8 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
>   }
>   EXPORT_SYMBOL(ieee80211_rx_list);
>   
> -void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
> +void ieee80211_rx_napi(struct ieee80211_hw *hw,
> +		       struct ieee80211_link_sta *link_pubsta,
>   		       struct sk_buff *skb, struct napi_struct *napi)
>   {
>   	struct sk_buff *tmp;
> @@ -5608,7 +5618,7 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
>   	 * receive processing
>   	 */
>   	rcu_read_lock();
> -	ieee80211_rx_list(hw, pubsta, skb, &list);
> +	ieee80211_rx_list(hw, link_pubsta, skb, &list);
>   	rcu_read_unlock();
>   
>   	if (!napi) {


^ permalink raw reply

* Re: [PATCH wireless-next v4 1/2] wifi: UHR: define DPS/DBE/P-EDCA elements and fix size parsing
From: Johannes Berg @ 2026-02-24 17:38 UTC (permalink / raw)
  To: Karthikeyan Kathirvel; +Cc: linux-wireless, ath12k
In-Reply-To: <c71a84fe19a632ccd748d0f1fded1a8b1277e0b1.camel@sipsolutions.net>

On Tue, 2026-02-24 at 17:42 +0100, Johannes Berg wrote:
> Oh, another thing
> 
> > + * @dbe_params:
> > + *	B0-B2 - DBE Bandwidth field is set to indicate
> > + *	expanded bandwidth for DBE mode
> > + *	Value 0 is reserved.
> > + *	Set to 1 to indicate 40 MHz DBE bandwidth.
> > + *	Set to 2 to indicate 80 MHz DBE bandwidth.
> > + *	Set to 3 to indicate 160 MHz DBE bandwidth.
> > + *	Set to 4 to indicate 320-1 MHz DBE bandwidth.
> > + *	Set to 5 to indicate 320-2 MHz DBE bandwidth.
> > + *	Values 6 to 7 are reserved.
> > + *	B3 - DBE Disabled Subchannel Bitmap Present.
> 
> Seems we should have an enum for the possible bandwidth values?

How about this?

enum ieee80211_uhr_dbe_oper_bw {
        IEEE80211_UHR_DBE_OPER_BW_40    = 1,
        IEEE80211_UHR_DBE_OPER_BW_80    = 2,
        IEEE80211_UHR_DBE_OPER_BW_160   = 3,
        IEEE80211_UHR_DBE_OPER_BW_320_1 = 4,
        IEEE80211_UHR_DBE_OPER_BW_32_2  = 5,
};


johannes

^ permalink raw reply

* Re: [RFC PATCH v2 0/8] Adding NO_STA flag and reworking RX link resolution
From: Ramasamy Kaliappan @ 2026-02-24 17:35 UTC (permalink / raw)
  To: Benjamin Berg, linux-wireless; +Cc: Rameshkumar Sundaram, Benjamin Berg
In-Reply-To: <20260223123818.384184-10-benjamin@sipsolutions.net>



On 2/23/2026 6:08 PM, Benjamin Berg wrote:
> From: Benjamin Berg <benjamin.berg@intel.com>
> 
> Hi,
> 
> This patchset refactors the RX link resolution a bit to fix some issues
> where mac80211 might accept frames on the wrong link and incorrectly
> translate the address. It also adds a new NL80211_ATTR_FRAME_CMD_NO_STA
> flag so that userspace can know whether address translation was done by
> the kernel on RX and can also prevent address translation for management
> frames during TX.
> 
> This together should be enough to fix the existing issues in hostapd
> where stations that are still associated try to authenticate again but
> hostapd for example ends up sending the frame to an old link address.
> 
> I would appreciate if you test the patches and work on the hostapd side.
> Note that I have not properly verified the new nl80211 API, so it could
> well be that I missed something.
> 
I'll work on the hostapd side accordingly and share the patches for review.
> Benjamin
> 
> Changes in RFCv2:
>   * Port other drivers to new API (untested)
>   * Fix a checkpatch warning
> 
> Benjamin Berg (8):
>    wifi: iwlwifi: use link_sta internally to the driver
>    wifi: mac80211: change public RX API to use link stations
>    wifi: mac80211: refactor RX link_id and station handling
>    wifi: mac80211: rework RX packet handling
>    wifi: cfg80211: add attribute for TX/RX denoting there is no station
>    wifi: mac80211: report to cfg80211 when no STA is known for a frame
>    wifi: mac80211: pass station to ieee80211_tx_skb_tid
>    wifi: mac80211: pass error station if non-STA transmit was requested
> 
>   drivers/net/wireless/ath/ath11k/dp_rx.c       |   2 +-
>   drivers/net/wireless/ath/ath12k/dp_mon.c      |  18 +-
>   drivers/net/wireless/ath/ath12k/dp_rx.c       |  15 +-
>   drivers/net/wireless/intel/iwlwifi/mld/agg.c  |  21 +-
>   drivers/net/wireless/intel/iwlwifi/mld/agg.h  |   4 +-
>   drivers/net/wireless/intel/iwlwifi/mld/rx.c   |  50 +-
>   drivers/net/wireless/intel/iwlwifi/mld/rx.h   |   2 +-
>   .../wireless/intel/iwlwifi/mld/tests/agg.c    |   7 +-
>   drivers/net/wireless/intel/iwlwifi/mvm/rx.c   |   2 +-
>   drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c |   6 +-
>   drivers/net/wireless/mediatek/mt76/mac80211.c |  22 +-
>   drivers/net/wireless/realtek/rtw89/core.c     |   6 -
>   drivers/net/wireless/virtual/mac80211_hwsim.c |   3 -
>   include/net/cfg80211.h                        |   4 +
>   include/net/mac80211.h                        |  25 +-
>   include/uapi/linux/nl80211.h                  |   7 +
>   net/mac80211/agg-tx.c                         |   6 +-
>   net/mac80211/eht.c                            |   3 -
>   net/mac80211/ht.c                             |   4 +-
>   net/mac80211/ieee80211_i.h                    |  14 +-
>   net/mac80211/iface.c                          |   7 +-
>   net/mac80211/mlme.c                           |   9 +-
>   net/mac80211/offchannel.c                     |  13 +-
>   net/mac80211/rx.c                             | 436 ++++++++++--------
>   net/mac80211/scan.c                           |  10 +-
>   net/mac80211/tdls.c                           |   4 +-
>   net/mac80211/tx.c                             |   8 +-
>   net/wireless/nl80211.c                        |   8 +-
>   28 files changed, 390 insertions(+), 326 deletions(-)
> 

Thanks,
Ramasamy

^ permalink raw reply

* Re: [PATCH wireless-next v4 1/2] wifi: UHR: define DPS/DBE/P-EDCA elements and fix size parsing
From: Johannes Berg @ 2026-02-24 16:42 UTC (permalink / raw)
  To: Karthikeyan Kathirvel; +Cc: linux-wireless, ath12k
In-Reply-To: <20260217054731.3667600-2-karthikeyan.kathirvel@oss.qualcomm.com>

Oh, another thing

> + * @dbe_params:
> + *	B0-B2 - DBE Bandwidth field is set to indicate
> + *	expanded bandwidth for DBE mode
> + *	Value 0 is reserved.
> + *	Set to 1 to indicate 40 MHz DBE bandwidth.
> + *	Set to 2 to indicate 80 MHz DBE bandwidth.
> + *	Set to 3 to indicate 160 MHz DBE bandwidth.
> + *	Set to 4 to indicate 320-1 MHz DBE bandwidth.
> + *	Set to 5 to indicate 320-2 MHz DBE bandwidth.
> + *	Values 6 to 7 are reserved.
> + *	B3 - DBE Disabled Subchannel Bitmap Present.

Seems we should have an enum for the possible bandwidth values?


And also, it's confusing:

> +/**
> + * enum ieee80211_dbe_bandwidth - DBE Bandwidth

because this one is just "DBE Bandwidth" - I think you should rename
this to "DBE Maximum Supported Bandwidth" or something related, and add
the operational, since there's a 4/5 difference with 320 vs. 320-1/320-2
(the latter in UHR operation)

johannes

^ permalink raw reply

* Re: [PATCH wireless-next v4 1/2] wifi: UHR: define DPS/DBE/P-EDCA elements and fix size parsing
From: Johannes Berg @ 2026-02-24 16:32 UTC (permalink / raw)
  To: Karthikeyan Kathirvel; +Cc: linux-wireless, ath12k
In-Reply-To: <20260217054731.3667600-2-karthikeyan.kathirvel@oss.qualcomm.com>

On Tue, 2026-02-17 at 11:17 +0530, Karthikeyan Kathirvel wrote:
> 
> + * Refer to IEEE80211_UHR_P_EDCA*
> + * @p_edca_ec: The P-EDCA ECWmin, P-EDCA and ECWmax

that seems unclear?


> + * @p_edca_params: The AIFSN field indicate the AIFSN value that are

"indicates", "value that is used"? I think it's one? Or "values that are
used"

> + *	used by a P-EDCA STA during P-EDCA contention.
> + *	The CW DS field indicate the value used

indicates

> + *	for the randomization of the transmission slot of the DS-CTS
> + *	frame. The value 3 is reserved. The value 0 indicate that

indicates

> + *	randomization not enabled.
> + *	The P-EDCA PSRC threshold field indicates the maximum number
> + *	of allowed consecutive DS-CTS transmissions. The value 0 and
> + *	values greater than 4 are reserved
> + *	The P-EDCA QSRC threshold field indicates the value of the
> + *	QSRC[AC_VO] counter to be allowed to start P-EDCA contention.
> + *	The value 0 is reserved.
> + */
> +struct ieee80211_uhr_p_edca_info {
> +	u8 p_edca_ec;
> +	__le16 p_edca_params;
> +} __packed;
> +
>  static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len,
>  					      bool beacon)
>  {
> @@ -47,19 +232,52 @@ static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len,
>  	if (beacon)
>  		return true;
>  
> -	/* FIXME: DPS, DBE, P-EDCA (consider order, also relative to NPCA) */
> +	/* DPS Operation Parameters (fixed 4 bytes) */
> +	if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DPS_ENA)) {
> +		needed += sizeof(struct ieee80211_uhr_dps_info);
> +		if (len < needed)
> +			return false;
> +	}
>  
> +	/* NPCA Operation Parameters (fixed 4 bytes + optional 2 bytes) */
>  	if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA)) {
>  		const struct ieee80211_uhr_npca_info *npca =
> -			(const void *)oper->variable;
> +			(const void *)(data + needed);
>  
>  		needed += sizeof(*npca);
> -
>  		if (len < needed)
>  			return false;
>  
> -		if (npca->params & cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES))
> +		if (npca->params &
> +		    cpu_to_le32(IEEE80211_UHR_NPCA_PARAMS_DIS_SUBCH_BMAP_PRES)) {
>  			needed += sizeof(npca->dis_subch_bmap[0]);
> +			if (len < needed)
> +				return false;
> +		}
> +	}
> +
> +	/* P-EDCA Operation Parameters (fixed 3 bytes) */
> +	if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_PEDCA_ENA)) {
> +		needed += sizeof(struct ieee80211_uhr_p_edca_info);
> +		if (len < needed)
> +			return false;
> +	}
> +
> +	/* DBE Operation Parameters (fixed 1 byte + optional 2 bytes) */
> +	if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DBE_ENA)) {
> +		const struct ieee80211_uhr_dbe_info *dbe =
> +			(const void *)(data + needed);
> +
> +		needed += sizeof(*dbe);
> +		if (len < needed)
> +			return false;
> +
> +		if (dbe->dbe_params &
> +		    IEEE80211_UHR_DBE_OPER_DIS_SUBCHANNEL_BITMAP_PRES) {
> +			needed += sizeof(dbe->dis_subch_bmap[0]);
> +			if (len < needed)
> +				return false;
> +		}
>  	}
>  
>  	return len >= needed;
> @@ -72,12 +290,15 @@ static inline bool ieee80211_uhr_oper_size_ok(const u8 *data, u8 len,
>  static inline const struct ieee80211_uhr_npca_info *
>  ieee80211_uhr_npca_info(const struct ieee80211_uhr_operation *oper)
>  {
> +	const u8 *pos = oper->variable;
> +
>  	if (!(oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_NPCA_ENA)))
>  		return NULL;
>  
> -	/* FIXME: DPS */
> +	if (oper->params & cpu_to_le16(IEEE80211_UHR_OPER_PARAMS_DPS_ENA))
> +		pos += sizeof(struct ieee80211_uhr_dps_info);
>  
> -	return (const void *)oper->variable;
> +	return (const void *)pos;
>  }
>  
>  static inline const __le16 *
> @@ -131,6 +352,25 @@ ieee80211_uhr_npca_dis_subch_bitmap(const struct ieee80211_uhr_operation *oper)
>  #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_160_PRES	0x08
>  #define IEEE80211_UHR_MAC_CAP_DBE_EHT_MCS_MAP_320_PRES	0x10
>  
> +/**
> + * enum ieee80211_dbe_bandwidth - DBE Bandwidth
> + *
> + * As per spec P802.11bn_D1.3 "Table 9-bb5—Encoding of the DBE Maximum
> + * Supported Bandwidth field"
> + *
> + * @IEEE80211_DBE_BANDWIDTH_40MHZ: Indicate 40 MHz DBE bandwidth
> + * @IEEE80211_DBE_BANDWIDTH_80MHZ: Indicate 80 MHz DBE bandwidth
> + * @IEEE80211_DBE_BANDWIDTH_160MHZ: Indicate 160 MHz DBE bandwidth
> + * @IEEE80211_DBE_BANDWIDTH_320MHZ: Indicate 320 MHz DBE bandwidth
> + *
> + */
> +enum ieee80211_dbe_bandwidth {
> +	IEEE80211_DBE_BANDWIDTH_40MHZ = 1,
> +	IEEE80211_DBE_BANDWIDTH_80MHZ = 2,
> +	IEEE80211_DBE_BANDWIDTH_160MHZ = 3,
> +	IEEE80211_DBE_BANDWIDTH_320MHZ = 4,
> +};
> +
>  struct ieee80211_uhr_cap_mac {
>  	u8 mac_cap[5];
>  } __packed;

^ permalink raw reply

* Re: [PATCH wireless-next v4 2/2] wifi: mac80211_hwsim: Add UHR capabilities to the driver
From: Johannes Berg @ 2026-02-24 16:20 UTC (permalink / raw)
  To: Karthikeyan Kathirvel; +Cc: linux-wireless, ath12k
In-Reply-To: <20260217054731.3667600-3-karthikeyan.kathirvel@oss.qualcomm.com>

On Tue, 2026-02-17 at 11:17 +0530, Karthikeyan Kathirvel wrote:
> 
> +		.uhr_cap = {
> +			.has_uhr = true,
> +			.mac = {
> +				.mac_cap[0] =
> +					IEEE80211_UHR_MAC_CAP0_DPS_SUPP |
> +					IEEE80211_UHR_MAC_CAP0_DPS_ASSIST_SUPP |

I'm really not sure we should claim all of this, e.g. DPS assist, right
now.

Also, I think you really mixed this up - a regular AP shouldn't claim
DPS below (only mobile AP), but this here station should probably not
normally claim DPS assist?

Just as examples! There are other issues like this such as:

> +					IEEE80211_UHR_MAC_CAP1_AP_PUO_SUPP |

I don't think the station should claim AP PUO support.

Certainly not an exhaustive list, ELR also seems wrong, etc.

johannes

^ permalink raw reply

* Re: [PATCH v3 19/21] wifi: rtl8xxxu: add hw crypto support for AP mode
From: Martin Kaistra @ 2026-02-24 15:43 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless
  Cc: Jes Sorensen, Ping-Ke Shih, Sebastian Andrzej Siewior
In-Reply-To: <b47a1c95-60c4-468d-9944-c59546e082bf@gmail.com>

Am 21.02.26 um 23:09 schrieb Bitterblue Smith:
> On 22/12/2023 12:14, Martin Kaistra wrote:
>> Add a custom function for allocating entries in the sec cam. This allows
>> us to store multiple keys with the same keyidx.
>>
>> The maximum number of sec cam entries for 8188f is 16 according to the
>> vendor driver. Add the number to rtl8xxxu_fileops, so that other chips
>> which might support more entries, can set a different number there.
>>
>> Set the bssid as mac address for group keys instead of just using the
>> ethernet broadcast address and use BIT(6) in the sec cam ctrl entry
>> for differentiating them from pairwise keys like in the vendor driver.
>>
>> Add the TXDESC_EN_DESC_ID bit and the hw_key_idx to tx
>> broadcast/multicast packets in AP mode.
>>
>> Finally, allow the usage of rtl8xxxu_set_key() for AP mode.
>>
>> Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
>> Reviewed-by: Ping-Ke Shih <pkshih@realtek.com>
>> ---
>>   .../net/wireless/realtek/rtl8xxxu/rtl8xxxu.h  |  5 ++
>>   .../realtek/rtl8xxxu/rtl8xxxu_8188f.c         |  1 +
>>   .../wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 48 +++++++++++++++----
>>   3 files changed, 44 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
>> index c5e6d8f7d26bd..62e6318bc0924 100644
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
>> @@ -498,6 +498,7 @@ struct rtl8xxxu_txdesc40 {
>>   #define DESC_RATE_ID_SHIFT		16
>>   #define DESC_RATE_ID_MASK		0xf
>>   #define TXDESC_NAVUSEHDR		BIT(20)
>> +#define TXDESC_EN_DESC_ID		BIT(21)
>>   #define TXDESC_SEC_RC4			0x00400000
>>   #define TXDESC_SEC_AES			0x00c00000
>>   #define TXDESC_PKT_OFFSET_SHIFT		26
>> @@ -1775,6 +1776,7 @@ struct rtl8xxxu_cfo_tracking {
>>   #define RTL8XXXU_MAX_MAC_ID_NUM	128
>>   #define RTL8XXXU_BC_MC_MACID	0
>>   #define RTL8XXXU_BC_MC_MACID1	1
>> +#define RTL8XXXU_MAX_SEC_CAM_NUM	64
>>   
>>   struct rtl8xxxu_priv {
>>   	struct ieee80211_hw *hw;
>> @@ -1908,6 +1910,7 @@ struct rtl8xxxu_priv {
>>   	char led_name[32];
>>   	struct led_classdev led_cdev;
>>   	DECLARE_BITMAP(mac_id_map, RTL8XXXU_MAX_MAC_ID_NUM);
>> +	DECLARE_BITMAP(cam_map, RTL8XXXU_MAX_SEC_CAM_NUM);
>>   };
>>   
>>   struct rtl8xxxu_sta_info {
>> @@ -1919,6 +1922,7 @@ struct rtl8xxxu_sta_info {
>>   
>>   struct rtl8xxxu_vif {
>>   	int port_num;
>> +	u8 hw_key_idx;
>>   };
>>   
>>   struct rtl8xxxu_rx_urb {
>> @@ -1993,6 +1997,7 @@ struct rtl8xxxu_fileops {
>>   	u16 max_aggr_num;
>>   	u8 supports_ap:1;
>>   	u16 max_macid_num;
>> +	u16 max_sec_cam_num;
>>   	u32 adda_1t_init;
>>   	u32 adda_1t_path_on;
>>   	u32 adda_2t_path_on_a;
>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
>> index 1e1c8fa194cb8..574a5fe951543 100644
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c
>> @@ -1751,6 +1751,7 @@ struct rtl8xxxu_fileops rtl8188fu_fops = {
>>   	.max_aggr_num = 0x0c14,
>>   	.supports_ap = 1,
>>   	.max_macid_num = 16,
>> +	.max_sec_cam_num = 16,
>>   	.adda_1t_init = 0x03c00014,
>>   	.adda_1t_path_on = 0x03c00014,
>>   	.trxff_boundary = 0x3f7f,
>> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>> index ecf54eb8dba61..7aafae9fe76b8 100644
>> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
>> @@ -4559,8 +4559,10 @@ static void rtl8xxxu_cam_write(struct rtl8xxxu_priv *priv,
>>   	 * This is a bit of a hack - the lower bits of the cipher
>>   	 * suite selector happens to match the cipher index in the CAM
>>   	 */
>> -	addr = key->keyidx << CAM_CMD_KEY_SHIFT;
>> +	addr = key->hw_key_idx << CAM_CMD_KEY_SHIFT;
>>   	ctrl = (key->cipher & 0x0f) << 2 | key->keyidx | CAM_WRITE_VALID;
>> +	if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
>> +		ctrl |= BIT(6);
>>   
>>   	for (j = 5; j >= 0; j--) {
>>   		switch (j) {
>> @@ -5546,13 +5548,14 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
>>   	struct rtl8xxxu_tx_urb *tx_urb;
>>   	struct ieee80211_sta *sta = NULL;
>>   	struct ieee80211_vif *vif = tx_info->control.vif;
>> +	struct rtl8xxxu_vif *rtlvif = (struct rtl8xxxu_vif *)vif->drv_priv;
>>   	struct device *dev = &priv->udev->dev;
>>   	u32 queue, rts_rate;
>>   	u16 pktlen = skb->len;
>>   	int tx_desc_size = priv->fops->tx_desc_size;
>>   	u8 macid;
>>   	int ret;
>> -	bool ampdu_enable, sgi = false, short_preamble = false;
>> +	bool ampdu_enable, sgi = false, short_preamble = false, bmc = false;
>>   
>>   	if (skb_headroom(skb) < tx_desc_size) {
>>   		dev_warn(dev,
>> @@ -5594,10 +5597,14 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
>>   		tx_desc->txdw0 =
>>   			TXDESC_OWN | TXDESC_FIRST_SEGMENT | TXDESC_LAST_SEGMENT;
>>   	if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) ||
>> -	    is_broadcast_ether_addr(ieee80211_get_DA(hdr)))
>> +	    is_broadcast_ether_addr(ieee80211_get_DA(hdr))) {
>>   		tx_desc->txdw0 |= TXDESC_BROADMULTICAST;
>> +		bmc = true;
>> +	}
>> +
>>   
>>   	tx_desc->txdw1 = cpu_to_le32(queue << TXDESC_QUEUE_SHIFT);
>> +	macid = rtl8xxxu_get_macid(priv, sta);
>>   
>>   	if (tx_info->control.hw_key) {
>>   		switch (tx_info->control.hw_key->cipher) {
>> @@ -5612,6 +5619,10 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
>>   		default:
>>   			break;
>>   		}
>> +		if (bmc && rtlvif->hw_key_idx != 0xff) {
>> +			tx_desc->txdw1 |= TXDESC_EN_DESC_ID;
>> +			macid = rtlvif->hw_key_idx;
>> +		}
>>   	}
>>   
>>   	/* (tx_info->flags & IEEE80211_TX_CTL_AMPDU) && */
>> @@ -5655,7 +5666,6 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
>>   	else
>>   		rts_rate = 0;
>>   
>> -	macid = rtl8xxxu_get_macid(priv, sta);
>>   	priv->fops->fill_txdesc(hw, hdr, tx_info, tx_desc, sgi, short_preamble,
>>   				ampdu_enable, rts_rate, macid);
>>   
>> @@ -6667,6 +6677,7 @@ static int rtl8xxxu_add_interface(struct ieee80211_hw *hw,
>>   
>>   	priv->vifs[port_num] = vif;
>>   	rtlvif->port_num = port_num;
>> +	rtlvif->hw_key_idx = 0xff;
>>   
>>   	rtl8xxxu_set_linktype(priv, vif->type, port_num);
>>   	ether_addr_copy(priv->mac_addr, vif->addr);
>> @@ -6843,11 +6854,19 @@ static int rtl8xxxu_set_rts_threshold(struct ieee80211_hw *hw, u32 rts)
>>   	return 0;
>>   }
>>   
>> +static int rtl8xxxu_get_free_sec_cam(struct ieee80211_hw *hw)
>> +{
>> +	struct rtl8xxxu_priv *priv = hw->priv;
>> +
>> +	return find_first_zero_bit(priv->cam_map, priv->fops->max_sec_cam_num);
>> +}
>> +
>>   static int rtl8xxxu_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
>>   			    struct ieee80211_vif *vif,
>>   			    struct ieee80211_sta *sta,
>>   			    struct ieee80211_key_conf *key)
>>   {
>> +	struct rtl8xxxu_vif *rtlvif = (struct rtl8xxxu_vif *)vif->drv_priv;
>>   	struct rtl8xxxu_priv *priv = hw->priv;
>>   	struct device *dev = &priv->udev->dev;
>>   	u8 mac_addr[ETH_ALEN];
>> @@ -6859,9 +6878,6 @@ static int rtl8xxxu_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
>>   	dev_dbg(dev, "%s: cmd %02x, cipher %08x, index %i\n",
>>   		__func__, cmd, key->cipher, key->keyidx);
>>   
>> -	if (vif->type != NL80211_IFTYPE_STATION)
>> -		return -EOPNOTSUPP;
>> -
>>   	if (key->keyidx > 3)
>>   		return -EOPNOTSUPP;
>>   
>> @@ -6885,7 +6901,7 @@ static int rtl8xxxu_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
>>   		ether_addr_copy(mac_addr, sta->addr);
>>   	} else {
>>   		dev_dbg(dev, "%s: group key\n", __func__);
>> -		eth_broadcast_addr(mac_addr);
>> +		ether_addr_copy(mac_addr, vif->bss_conf.bssid);
>>   	}
>>   
>>   	val16 = rtl8xxxu_read16(priv, REG_CR);
>> @@ -6899,16 +6915,28 @@ static int rtl8xxxu_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
>>   
>>   	switch (cmd) {
>>   	case SET_KEY:
>> -		key->hw_key_idx = key->keyidx;
>> +
>> +		retval = rtl8xxxu_get_free_sec_cam(hw);
>> +		if (retval < 0)
>> +			return -EOPNOTSUPP;
>> +
>> +		key->hw_key_idx = retval;
>> +
>> +		if (vif->type == NL80211_IFTYPE_AP && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
>> +			rtlvif->hw_key_idx = key->hw_key_idx;
>> +
>>   		key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV;
>>   		rtl8xxxu_cam_write(priv, key, mac_addr);
>> +		set_bit(key->hw_key_idx, priv->cam_map);
> 
> Hi Martin,

Hi Bitterblue,

> 
> It turns out RTL8188CUS and RTL8192CU don't like this patch, specifically
> when we use iwd. After the WPA2 handshake no more data is transmitted.
> 
> Before this patch, key->hw_key_idx was the same as key->keyidx. After
> this patch, when we use iwd, the group key is installed first. It has
> key->keyidx = 1, but it gets key->hw_key_idx = 0. The pairwise key is
> installed second. It has key->keyidx = 0, but it gets key->hw_key_idx = 1.
> Both keyidx and hw_key_idx are passed to the chip in rtl8xxxu_cam_write().
> 
> It's fine with wpa_supplicant. wpa_supplicant installs the pairwise key
> first, with key->keyidx = 0, then the group key, with key->keyidx = 1.
> 
> This patch imitating rtw88 makes the old chips work again with iwd.
> What do you think?

So you reserve the first 4 entries for group keys and use key->keyidx as 
key->hw_key_idx directly for those, right? Does that work if 2 virtual 
interfaces are used at the same time?
I will do some tests in the next days, but I suspect this be an issue.

> 
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/core.c b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> index ee278f0548e4..f7b35655bec5 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/core.c
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/core.c
> @@ -6942,7 +6942,8 @@ static int rtl8xxxu_get_free_sec_cam(struct ieee80211_hw *hw)
>   {
>   	struct rtl8xxxu_priv *priv = hw->priv;
>   
> -	return find_first_zero_bit(priv->cam_map, priv->fops->max_sec_cam_num);
> +	return find_next_zero_bit(priv->cam_map, priv->fops->max_sec_cam_num,
> +				  RTL8XXXU_SEC_DEFAULT_KEY_NUM);
>   }
>   
>   static int rtl8xxxu_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> @@ -6999,12 +7000,15 @@ static int rtl8xxxu_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
>   
>   	switch (cmd) {
>   	case SET_KEY:
> +		if (key->flags & IEEE80211_KEY_FLAG_PAIRWISE) {
> +			retval = rtl8xxxu_get_free_sec_cam(hw);
> +			if (retval < 0)
> +				return -EOPNOTSUPP;
>   
> -		retval = rtl8xxxu_get_free_sec_cam(hw);
> -		if (retval < 0)
> -			return -EOPNOTSUPP;
> -
> -		key->hw_key_idx = retval;
> +			key->hw_key_idx = retval;
> +		} else {
> +			key->hw_key_idx = key->keyidx;
> +		}
>   
>   		if (vif->type == NL80211_IFTYPE_AP && !(key->flags & IEEE80211_KEY_FLAG_PAIRWISE))
>   			rtlvif->hw_key_idx = key->hw_key_idx;
> diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
> index 4b05dba22e67..188f4bbe99cd 100644
> --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
> +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
> @@ -1788,6 +1788,7 @@ struct rtl8xxxu_cfo_tracking {
>   #define RTL8XXXU_BC_MC_MACID	0
>   #define RTL8XXXU_BC_MC_MACID1	1
>   #define RTL8XXXU_MAX_SEC_CAM_NUM	64
> +#define RTL8XXXU_SEC_DEFAULT_KEY_NUM	4
>   
>   struct rtl8xxxu_priv {
>   	struct ieee80211_hw *hw;


^ permalink raw reply

* Re: [PATCH wireless-next v8 2/3] wifi: cfg80211: add initial UHR support
From: Harshitha Prem @ 2026-02-24 11:01 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless
  Cc: Karthikeyan Kathirvel, vasanthakumar.thiagarajan,
	Lorenzo Bianconi, ath12k, Jeff Johnson, Ping-Ke Shih,
	Manish Dharanenthiran
In-Reply-To: <0f4b34f0b529fd93fc608d8bbac0e98516b7a3d2.camel@sipsolutions.net>



On 2/17/2026 3:35 PM, Johannes Berg wrote:

Hi Johannes,

Thank you very much for your patience, and apologies for the delayed
response. We spent some time discussing this internally and wanted to
follow up thoughtfully.

> Hi,
> 
>> This approach looks well suited to handling overlapping update scenarios.
>>
>> To make sure I understand it correctly, I’d like to walk through a
>> concise example where a UHR critical update and a CSA overlap on link 0
>> of a 3‑link AP MLD.
> 
> Well, so honestly, you should probably treat what I write as equivalent
> to a paper napkin sketch during a night of drinking ;-)
> 
> I surely didn't think it totally through. I was just trying to
> illustrate that I feel like we need to have some kind of new design for
> all these overlapping updates (CSA, BSS color change, EHT and UHR
> critical updates?) than the piecemeal design we have now.
> 
> And, importantly, that perhaps I think that this means we need to have
> "post-update UHR operation" more than the individual UHR operation
> updates broken out - which after all is where we started from.
> 
> 
>> t1: A UHR critical update is triggered. hostapd sends
>> NL80211_CMD_START_MLD_BSS_UPDATE with an advanced notification (5
>> TBTTs), post‑interval (5 TBTTs), and the beacon template with UHR
>> parameters update element for link 0. Timers start in mac80211, and
>> hostapd receives cookie X.
> 
> Don't know if timers would be really in mac80211 - I guess if the driver
> pulls each individual beacon then mac80211 could handle the countdown,
> but otherwise this might just be given to firmware.

Yes, agreed.

> 
> Also I guess the counter would have offset(s) from the start, i.e. the
> beacon template would be in this operation already. Or maybe even beacon
> updates for multiple links? Don't know if that really matters much
> either way.
> 
>> t2: hostapd sends NL80211_CMD_UPDATE_AP with cookie X and offset where
>> the counter is updated for link 1 (and then link 2).
>>
>> the countdown values would be handled in mac80211 with the offset
>> mentioned similar to ieee80211_set_beacon_cntdwn().
> 
> Sort of, yeah. I imagined that the CMD_UPDATE_AP would come with a list
> of "cookie X: { offset X_1, offset X_2 }, cookie Y: { offset Y_1 }" or
> something like that.
> 
>> t3: Before the UHR advanced interval completes, a CSA is triggered (due
>> to radar or user‑initiated). Another NL80211_CMD_START_MLD_BSS_UPDATE is
>> issued with CSA countdown 5, including CSA and after beacon templates.
>> The after template carries cookie X and the offset. Since UHR CU is
>> already in progress, hostapd could also include an updated parameters
>> update element. 
> 
> Would have to, I think? I think in your example it's unlikely the _after
> CSA_ template still has cookie X / offset(s) X_n, since you only had 10
> beacon intervals overall for the UHR critical update and CSA might be
> longer, but we could also imagine the UHR critical update was advertised
> for a longer time.
> 
>> Also, an updated UHR operation element which can be
>> modified in after beacon template if CSA finishes after the UHR CU
>> advance interval. (why to provide the UHR operation element separately
>> is because the advance notification can be before or after the CSA
>> finalize).
>> hostapd then receives cookie Y for the CSA.
> 
> This could get trickier than I imagined - you now have three periods of
> time:
> 
>  - now
>  - after CSA but before UHR update
>  - after UHR update
> 
> and actually all three might need different UHR operation, since the CSA
> can change the bandwidth and therefore e.g. DBE/NPCA. The intermediate
> period ("after CSA but before UHR update") can be captured by the CSA
> operation (given a template/UHR operation for after) easily.
> 
> But I was imagining we capture all this in the operations already, so I
> guess to do that we would need a "NL80211_CMD_MODIFY_MLD_BSS_UPDATE"
> command that takes the cookie and updates the post-operation values, so
> that the changes due to the CSA could be taken into account in the
> previously started UHR update.

The idea of introducing an NL80211_CMD_MODIFY_MLD_BSS_UPDATE command
makes a lot of sense to us. In cases where
NL80211_CMD_START_MLD_BSS_UPDATE is already in progress, having a modify
path to update the current beacon seems easier to reason about and
manage. From that perspective, a pairing such as
NL80211_CMD_START_MLD_BSS_UPDATE together with
NL80211_CMD_MODIFY_MLD_BSS_UPDATE feels quite natural.

> 
> FWIW, I was also kind of imagining that we'd design this combined update
> command in a way that it replaces the CSA and color change commands,
> handles the proposed link removal thing from Lorenzo, and then we don't
> need to handle overlapping operations of all kinds, just of this new
> kind that can do many different things. Not a huge difference though
> since CSA/CCA would map to a subset of the new "thing".
> 

[...]

Please find below the envisioned design flow for the UHR CU and CSA
intersection.

Hostapd (User)          mac80211 (Kernel)           Air / Station
   |                           |                           |
 1 | CMD_START_AP [Adv Notif,  |                           |
   |  Post Notif, Upd Int]     |                           |
   |-------------------------->|                           |
   |                           |                           |
 2 | CMD_START_MLD_BSS_UPDATE  |                           |
   | [Link:0, CurTmpl+Offset   |                           |
   |  (All), Timer, PostTmpl   |                           |
   |  (All), Type:UHR_CU,      |                           |
   |  Post UHR Op element]     |                           |
   |-------------------------->|                           |
   |                           |                           |
 3 |                           | [Set Tmpl, Timer: Adv=10, |
   |                           |  Post=10, TIM Update]     |
   |                           |                           |
 4 |         Cookie X          |                           |
   |<--------------------------|                           |
   |                           |                           |
 5 | EVENT_UHR_CU (CU_START)   |                           |
   |<--------------------------|                           |
   |                           |                           |
 6 |                           | Beacons: 10, 9, 8...      |
   |                           |-------------------------->|
   |                           |                           |
 7 | [CSA Triggered: Link0,    |                           |
   |  Count 10. Sees Cookie X] |                           |
   |                           |                           |
 8 | CMD_START_MLD_BSS_UPDATE  |                           |
   | [Type:CSA, Link:0, Tmpls, |                           |
   |  Cookie X + Offset,       |                           |
   |  Post Tmpl (No UHR ele)]  |                           |
   |-------------------------->|                           |
   |                           |                           |
 9 |         Cookie Y          |                           |
   |<--------------------------|                           |
   |                           |                           |
10 | CMD_CH_SWITCH_STARTED_    |                           |
   | NOTIFY                    |                           |
   |<--------------------------|                           |
   |                           |                           |
11 |                           | Beacons: X=7, Y=10        |
   |                           |-------------------------->|
   |                           |                           |
12 | CMD_MODIFY_MLD_BSS_UPDATE |                           |
   | (Cookie X Post Tmpl w/    |                           |
   |  Chan Info, 3 Links)      |                           |
   |-------------------------->|                           |
   |                           |                           |
13 |                           | Beacons: X=1, Y=4         |
   |                           |-------------------------->|
   |                           |                           |
14 |                           | [X=0: Modify Cur Tmpl     |
   |                           |  w/ Post UHR Op element]  |
   |                           |                           |
15 | EVENT_UHR_CU              |                           |
   | (CU_ADVANCE_COMPLETE)     |                           |
   |<--------------------------|                           |
   |                           |                           |
16 | CMD_MODIFY_MLD_BSS_UPDATE |                           |
   | (Cookie Y Post Tmpl w/    |                           |
   |  UHR Op + Param elements) |                           |
   |-------------------------->|                           |
   |                           |                           |
17 |                           | Beacons: X=127, Y=3       |
   |                           |-------------------------->|
   |                           |                           |
18 |                           | Beacons: X=128/129,       |
   |                           |          Y=2/1 (CSA done) |
   |                           |-------------------------->|
   |                           |                           |
19 |                           | [Y=0: Set Post Tmpl       |
   |                           |  cookie Y, UHR Param      |
   |                           |  Off, X=130]              |
   |                           |                           |
20 | CMD_CH_SWITCH_NOTIFY      |                           |
   |<--------------------------|                           |
   |                           |                           |
21 | CMD_MLD_BSS_UPDATE_NOTIFY |                           |
   | (Complete Cookie Y)       |                           |
   |<--------------------------|                           |
   |                           |                           |
22 | CMD_MODIFY_MLD_BSS_UPDATE |                           |
   | (Cookie X Post Tmpl w/    |                           |
   |  UpdatedChan Info)        |                           |
   |-------------------------->|                           |
   |                           |                           |
23 |                           | Beacons Continue...       |
   |                           |-------------------------->|
   |                           |                           |
24 |                           | Probe Request             |
   |                           |<--------------------------|
   |                           | [Fetch TBTT]              |
   |     send_mgmt (TBTT)      |                           |
   |<--------------------------|                           |
   |                           |                           |
25 | send_mgmt (Probe Resp     |                           |
   |  w/ TBTT in UHR Param)    |                           |
   |-------------------------->|                           |
   |                           |                           |
26 |                           | [Post Notif Complete:     |
   |                           |  Set Post Tmpl Cookie X]  |
   |                           |                           |
27 | EVENT_UHR_CU              |                           |
   | (CU_POST_NOTIF_COMPLETE)  |                           |
   |<--------------------------|                           |
   |                           |                           |
28 |                           | [Continue w/ Updated TIM] |
   |                           |                           |
29 | EVENT_UHR_CU              |                           |
   | (CU_SESSION_END)          |                           |
   |<--------------------------|                           |
   |                           |                           |


The diagram uses a number of abbreviations, so an explanation is
provided below for clarity.

Step 2 – NL80211_CMD_START_MLD_BSS_UPDATE
	This would include:
		1. The affected link ID
		2. Current beacon templates for all links, along with the offsets
where counters need to be updated.
		3. Post‑beacon templates for all links
		4. The post‑UHR operation element
		5. Countdown values
		6. Type: UHR CU


Step 8 – NL80211_CMD_START_MLD_BSS_UPDATE
	This would include:
		1. The affected link ID
		2. Current beacon templates for all links, along with
the offsets where counters need to be updated
		3. Cookie X – { offset_A }
		4. Post‑beacon templates for all links
		5. Countdown values
		6. Type: CSA


Step 14
	The driver/firmware can update the current beacon template with
the post‑UHR operation element. Until the advance notification interval
completes, the UHR operation element would not yet be updated.

Step 12 & Step 22
	These steps are somewhat duplicate, but keeping the latest modified
state once hostapd receives NL80211_CMD_MLD_BSS_UPDATE_NOTIFY_COMPLETE
seems reasonable.

Step 24
	Reporting the TBTT count back to hostapd for attribute types such as
UHR_CU, LINK_REMOVE, etc.

Cookies act as identifiers for both the post‑beacon template and the
associated countdown values.


A few potential concerns to consider:

1. Carrying both the current and post‑beacon templates for all
affiliated links of an MLD might make the NL message fairly large. we
are not sure how well that fits with existing practice, since multipart
handling seems to be used mostly for dump commands. As an alternate, can
we have multiple commands with message id and reassemble it?

2. There may be a small sequencing aspect worth thinking through. For
example, if a UHR_CU operation is close to completion and we are about
to apply its post‑beacon template, but before hostapd processes
EVENT_UHR_CU with CU_POST_NOTIF_COMPLETE it issues a
START_MLD_BSS_UPDATE for CSA, we could potentially end up using an
unexpected version of the current beacon template. This may already be
handled by the existing flow, but it seemed worth calling out for
completeness.


Thanks,
Harshitha

> 
> Thanks,
> johannes


^ permalink raw reply

* Re: [PATCHv2 wireless-next] wifi: rt2x00: use generic nvmem_cell_get
From: Stanislaw Gruszka @ 2026-02-24 10:09 UTC (permalink / raw)
  To: Rosen Penev; +Cc: linux-wireless, open list
In-Reply-To: <20260223214004.19960-1-rosenp@gmail.com>

On Mon, Feb 23, 2026 at 01:40:04PM -0800, Rosen Penev wrote:
> The library doesn't necessarily depend on OF. This codepath is used by
> both soc (OF only) and pci (no such requirement). After this, the only
> of specific function is of_get_mac_address, which is needed for nvmem.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

> ---
>  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> index 65d0f805459c..93e4ce604171 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> @@ -10965,13 +10965,13 @@ EXPORT_SYMBOL_GPL(rt2800_read_eeprom_efuse);
> 
>  int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev)
>  {
> -	struct device_node *np = rt2x00dev->dev->of_node;
> +	struct device *dev = rt2x00dev->dev;
>  	unsigned int len = rt2x00dev->ops->eeprom_size;
>  	struct nvmem_cell *cell;
>  	const void *data;
>  	size_t retlen;
> 
> -	cell = of_nvmem_cell_get(np, "eeprom");
> +	cell = nvmem_cell_get(dev, "eeprom");
>  	if (IS_ERR(cell))
>  		return PTR_ERR(cell);
> 
> --
> 2.53.0
> 

^ permalink raw reply

* Re: [PATCH net] wifi: rtw88: properly drop usb interface reference on error
From: Greg Kroah-Hartman @ 2026-02-24  6:18 UTC (permalink / raw)
  To: Ping-Ke Shih
  Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable
In-Reply-To: <a52baa6c345c4c1689094b386e3963d5@realtek.com>

On Tue, Feb 24, 2026 at 01:49:24AM +0000, Ping-Ke Shih wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > On Tue, Feb 24, 2026 at 12:46:02AM +0000, Ping-Ke Shih wrote:
> > > Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > > > If an error happens in the usb probe path, in rtw_usb_intf_init(), the
> > > > usb interface reference needs to be properly dropped, otherwise is is
> > > > incorrectly increased when returning to the USB core.
> > > >
> > > > Cc: Ping-Ke Shih <pkshih@realtek.com>
> > > > Cc: stable <stable@kernel.org>
> > > > Assisted-by: gkh_clanker_2000
> > > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > > ---
> > > >  drivers/net/wireless/realtek/rtw88/usb.c | 8 ++++++--
> > > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> > > > index 433b06c8d8a6..36ac20039ce2 100644
> > > > --- a/drivers/net/wireless/realtek/rtw88/usb.c
> > > > +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> > > > @@ -1046,13 +1046,17 @@ static int rtw_usb_intf_init(struct rtw_dev *rtwdev,
> > > >
> > > >         rtwusb->udev = udev;
> > > >         ret = rtw_usb_parse(rtwdev, intf);
> > > > -       if (ret)
> > > > +       if (ret) {
> > > > +               usb_put_dev(udev);
> > > >                 return ret;
> > > > +       }
> > > >
> > > >         rtwusb->usb_data = kcalloc(RTW_USB_MAX_RXTX_COUNT, sizeof(u32),
> > > >                                    GFP_KERNEL);
> > > > -       if (!rtwusb->usb_data)
> > > > +       if (!rtwusb->usb_data) {
> > > > +               usb_put_dev(udev);
> > > >                 return -ENOMEM;
> > > > +       }
> > > >
> > > >         usb_set_intfdata(intf, rtwdev->hw);
> > > >
> > >
> > > Since rtwusb->udev isn't used right after assignment in this function.
> > > Would it be simpler that moving usb_get_dev() downward like below?
> > 
> > What is even simpler, and easier, is to never call usb_get_dev() at all
> > anyway as it's not needed :)
> > 
> > I created that pattern a few decades ago when we thought that it was
> > going to be required, but as long as the usb interface is bound to the
> > driver, that pointer is going to be valid so there's no real need to
> > increment the reference count, except to feel good about doing it.
> > 
> > I'll gladly do that fix instead, if you want me to, I was just trying to
> > follow the style of the existing code and fix up the current bug.
> 
> Because I'm not much familiar with USB devices, I can't afford to the change
> that is too big to me. :)
> 
> Let's take your version, so
> 
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Great, thanks!

> This patch can go via rtw-next tree (subtree of wireless-next), right?

Sure, please do so.

thanks,

greg k-h

^ permalink raw reply

* Re: [PATCH] wifi: ath11k: Silence remoteproc probe deferral prints
From: Baochen Qiang @ 2026-02-24  2:51 UTC (permalink / raw)
  To: Bjorn Andersson, Jeff Johnson
  Cc: linux-arm-msm, linux-wireless, ath11k, linux-kernel
In-Reply-To: <20260212-ath11k-silence-probe-deferr-v1-1-b8a49bb3c332@oss.qualcomm.com>



On 2/12/2026 10:52 PM, Bjorn Andersson wrote:
> Upon failing to resolve the remoteproc phandle one ath11k_dbg() and one
> ath11k_err() is used to tell the user about the (presumably) temporary
> failure.
> 
> Reduce the log spam by removing the duplicate print and switching to
> dev_err_probe(), in line with how ath12k handles this error.
> 
> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath11k/ahb.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c
> index 8dfe9b40c12626649639fc1dd9da0e5e0c2dcaf1..08d3a0c8f105b26b1548c5d6006f6ea162fe58ff 100644
> --- a/drivers/net/wireless/ath/ath11k/ahb.c
> +++ b/drivers/net/wireless/ath/ath11k/ahb.c
> @@ -807,10 +807,8 @@ static int ath11k_core_get_rproc(struct ath11k_base *ab)
>  	}
>  
>  	prproc = rproc_get_by_phandle(rproc_phandle);
> -	if (!prproc) {
> -		ath11k_dbg(ab, ATH11K_DBG_AHB, "failed to get rproc, deferring\n");
> -		return -EPROBE_DEFER;
> -	}
> +	if (!prproc)
> +		return dev_err_probe(&ab->pdev->dev, -EPROBE_DEFER, "failed to get rproc\n");
>  	ab_ahb->tgt_rproc = prproc;
>  
>  	return 0;
> @@ -1190,10 +1188,8 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
>  	ath11k_ahb_init_qmi_ce_config(ab);
>  
>  	ret = ath11k_core_get_rproc(ab);
> -	if (ret) {
> -		ath11k_err(ab, "failed to get rproc: %d\n", ret);
> +	if (ret)
>  		goto err_ce_free;
> -	}
>  
>  	ret = ath11k_core_init(ab);
>  	if (ret) {
> 
> ---
> base-commit: fd9678829d6dd0c10fde080b536abf4b1121c346
> change-id: 20260212-ath11k-silence-probe-deferr-28c2532bcc1d
> 
> Best regards,

Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>


^ permalink raw reply

* [PATCH] mac80211: update outdated comment
From: kexinsun @ 2026-02-24  2:15 UTC (permalink / raw)
  To: johannes
  Cc: linux-wireless, linux-kernel, julia.lawall, xutong.ma, yunbolyu,
	ratnadiraw, kexinsun

The function ieee80211_start_scan() was refactored and replaced by
__ieee80211_start_scan() in commit f3b85252f081 ("mac80211: fix scan
races and rework scanning"). Update the comment in
ieee80211_tx_h_check_assoc() accordingly.

Signed-off-by: kexinsun <kexinsun@smail.nju.edu.cn>
---
 net/mac80211/tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8cdbd417d7be..85c48b42474c 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -288,7 +288,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
 		 * sent and we should not get here, but if we do
 		 * nonetheless, drop them to avoid sending them
 		 * off-channel. See the link below and
-		 * ieee80211_start_scan() for more.
+		 * __ieee80211_start_scan() for more.
 		 *
 		 * http://article.gmane.org/gmane.linux.kernel.wireless.general/30089
 		 */
-- 
2.25.1


^ permalink raw reply related

* RE: [PATCH net] wifi: rtw88: properly drop usb interface reference on error
From: Ping-Ke Shih @ 2026-02-24  1:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable
In-Reply-To: <2026022459-robe-mutual-fc3d@gregkh>

Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Tue, Feb 24, 2026 at 12:46:02AM +0000, Ping-Ke Shih wrote:
> > Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > > If an error happens in the usb probe path, in rtw_usb_intf_init(), the
> > > usb interface reference needs to be properly dropped, otherwise is is
> > > incorrectly increased when returning to the USB core.
> > >
> > > Cc: Ping-Ke Shih <pkshih@realtek.com>
> > > Cc: stable <stable@kernel.org>
> > > Assisted-by: gkh_clanker_2000
> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > ---
> > >  drivers/net/wireless/realtek/rtw88/usb.c | 8 ++++++--
> > >  1 file changed, 6 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> > > index 433b06c8d8a6..36ac20039ce2 100644
> > > --- a/drivers/net/wireless/realtek/rtw88/usb.c
> > > +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> > > @@ -1046,13 +1046,17 @@ static int rtw_usb_intf_init(struct rtw_dev *rtwdev,
> > >
> > >         rtwusb->udev = udev;
> > >         ret = rtw_usb_parse(rtwdev, intf);
> > > -       if (ret)
> > > +       if (ret) {
> > > +               usb_put_dev(udev);
> > >                 return ret;
> > > +       }
> > >
> > >         rtwusb->usb_data = kcalloc(RTW_USB_MAX_RXTX_COUNT, sizeof(u32),
> > >                                    GFP_KERNEL);
> > > -       if (!rtwusb->usb_data)
> > > +       if (!rtwusb->usb_data) {
> > > +               usb_put_dev(udev);
> > >                 return -ENOMEM;
> > > +       }
> > >
> > >         usb_set_intfdata(intf, rtwdev->hw);
> > >
> >
> > Since rtwusb->udev isn't used right after assignment in this function.
> > Would it be simpler that moving usb_get_dev() downward like below?
> 
> What is even simpler, and easier, is to never call usb_get_dev() at all
> anyway as it's not needed :)
> 
> I created that pattern a few decades ago when we thought that it was
> going to be required, but as long as the usb interface is bound to the
> driver, that pointer is going to be valid so there's no real need to
> increment the reference count, except to feel good about doing it.
> 
> I'll gladly do that fix instead, if you want me to, I was just trying to
> follow the style of the existing code and fix up the current bug.

Because I'm not much familiar with USB devices, I can't afford to the change
that is too big to me. :)

Let's take your version, so

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

This patch can go via rtw-next tree (subtree of wireless-next), right?



^ permalink raw reply

* Re: Wi-Fi quirk found in Dell Inspiron 5567
From: Baochen Qiang @ 2026-02-24  1:14 UTC (permalink / raw)
  To: Bandhan Pramanik, linux-wireless, ath10k
In-Reply-To: <c7c5a458-ec8b-457f-893d-1c4b147ebb65@gmail.com>



On 2/17/2026 1:05 AM, Bandhan Pramanik wrote:
> Hello,
> 
> I messaged regarding Dell Inspiron 5567 earlier. This is regarding the QCA9377 chips
> placed on these devices.
> 
> I fixed the issue using "pcie_aspm=off", and I can say that the ASPM configs of the Wi-Fi
> chip might be problematic on this device.
> 
> The reason is that *these laptops run Wi-Fi erratically if we don't turn off the ASPM*.
> The result is the overwriting of the dmesg ring buffer within seconds of boot and IRQ #16
> being turned off for the influx of multiple correctable errors, which hampers the
> touchpads too.
> 
> What are your thoughts on turning off this device's ASPM by default? I will be happy to
> provide any details as needed.

can you please share the complete dmesg log, as well as the output of

	cat /proc/interrupts
> 
> Bandhan
> 
> 
> 


^ permalink raw reply

* Re: [PATCH net] wifi: rtw88: properly drop usb interface reference on error
From: Greg Kroah-Hartman @ 2026-02-24  1:09 UTC (permalink / raw)
  To: Ping-Ke Shih
  Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable
In-Reply-To: <0a1b75853588468d87725e4d6aad8f22@realtek.com>

On Tue, Feb 24, 2026 at 12:46:02AM +0000, Ping-Ke Shih wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > If an error happens in the usb probe path, in rtw_usb_intf_init(), the
> > usb interface reference needs to be properly dropped, otherwise is is
> > incorrectly increased when returning to the USB core.
> > 
> > Cc: Ping-Ke Shih <pkshih@realtek.com>
> > Cc: stable <stable@kernel.org>
> > Assisted-by: gkh_clanker_2000
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > ---
> >  drivers/net/wireless/realtek/rtw88/usb.c | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> > index 433b06c8d8a6..36ac20039ce2 100644
> > --- a/drivers/net/wireless/realtek/rtw88/usb.c
> > +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> > @@ -1046,13 +1046,17 @@ static int rtw_usb_intf_init(struct rtw_dev *rtwdev,
> > 
> >         rtwusb->udev = udev;
> >         ret = rtw_usb_parse(rtwdev, intf);
> > -       if (ret)
> > +       if (ret) {
> > +               usb_put_dev(udev);
> >                 return ret;
> > +       }
> > 
> >         rtwusb->usb_data = kcalloc(RTW_USB_MAX_RXTX_COUNT, sizeof(u32),
> >                                    GFP_KERNEL);
> > -       if (!rtwusb->usb_data)
> > +       if (!rtwusb->usb_data) {
> > +               usb_put_dev(udev);
> >                 return -ENOMEM;
> > +       }
> > 
> >         usb_set_intfdata(intf, rtwdev->hw);
> > 
> 
> Since rtwusb->udev isn't used right after assignment in this function.
> Would it be simpler that moving usb_get_dev() downward like below?

What is even simpler, and easier, is to never call usb_get_dev() at all
anyway as it's not needed :)

I created that pattern a few decades ago when we thought that it was
going to be required, but as long as the usb interface is bound to the
driver, that pointer is going to be valid so there's no real need to
increment the reference count, except to feel good about doing it.

I'll gladly do that fix instead, if you want me to, I was just trying to
follow the style of the existing code and fix up the current bug.

> diff --git a/drivers/net/wireless/realtek/rtw88/usb.c b/drivers/net/wireless/realtek/rtw88/usb.c
> index db60e142268d..6e5c9c6f3e00 100644
> --- a/drivers/net/wireless/realtek/rtw88/usb.c
> +++ b/drivers/net/wireless/realtek/rtw88/usb.c
> @@ -1041,10 +1041,8 @@ static int rtw_usb_intf_init(struct rtw_dev *rtwdev,
>                              struct usb_interface *intf)
>  {
>         struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev);
> -       struct usb_device *udev = usb_get_dev(interface_to_usbdev(intf));
>         int ret;
> 
> -       rtwusb->udev = udev;
>         ret = rtw_usb_parse(rtwdev, intf);
>         if (ret)
>                 return ret;
> @@ -1054,6 +1052,8 @@ static int rtw_usb_intf_init(struct rtw_dev *rtwdev,
>         if (!rtwusb->usb_data)
>                 return -ENOMEM;
> 
> +       rtwusb->udev = usb_get_dev(interface_to_usbdev(intf));

That too works, or again, just drop the usb_get_dev() and usb_put_dev()
calls entirely.

thanks,

greg k-h

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox