All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mt76: mt7915: fix injected MPDU transmission to not use HW A-MSDU
@ 2022-02-04 15:47 Johan Almbladh
  2022-02-04 21:46 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Almbladh @ 2022-02-04 15:47 UTC (permalink / raw)
  To: nbd, lorenzo.bianconi83; +Cc: ryder.lee, linux-wireless, Johan Almbladh

Before, the hardware would be allowed to transmit injected 802.11 MPDUs
as A-MSDU. This resulted in corrupted frames being transmitted. Now,
injected MPDUs are transmitted as-is, without A-MSDU.

The fix was verified with frame injection on MT7915 hardware, both with
and without the injected frame being encrypted.

If the hardware cannot do A-MSDU aggregation on MPDUs, this problem
would also be present in the TX path where mac80211 does the 802.11
encapsulation. However, I have not observed any such problem when
disabling IEEE80211_HW_SUPPORTS_TX_ENCAP_OFFLOAD to force that mode.
Therefore this fix is isolated to injected frames only.

The same A-MSDU logic is also present in the mt7921 driver, so it is
likely that this fix should be applied there too. I do not have access
to mt7921 hardware so I have not been able to test that.

Signed-off-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
---
 mt7915/mac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mt7915/mac.c b/mt7915/mac.c
index 08ee78f6..1848fa16 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1121,6 +1121,7 @@ mt7915_mac_write_txwi_80211(struct mt7915_dev *dev, __le32 *txwi,
 		val = MT_TXD3_SN_VALID |
 		      FIELD_PREP(MT_TXD3_SEQ, IEEE80211_SEQ_TO_SN(seqno));
 		txwi[3] |= cpu_to_le32(val);
+		txwi[7] &= ~cpu_to_le32(MT_TXD7_HW_AMSDU);
 	}
 
 	val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mt76: mt7915: fix injected MPDU transmission to not use HW A-MSDU
  2022-02-04 15:47 [PATCH] mt76: mt7915: fix injected MPDU transmission to not use HW A-MSDU Johan Almbladh
@ 2022-02-04 21:46 ` Johannes Berg
  2022-02-04 22:33   ` Johan Almbladh
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2022-02-04 21:46 UTC (permalink / raw)
  To: Johan Almbladh, nbd, lorenzo.bianconi83; +Cc: ryder.lee, linux-wireless

On Fri, 2022-02-04 at 16:47 +0100, Johan Almbladh wrote:
> 
> diff --git a/mt7915/mac.c b/mt7915/mac.c
> index 08ee78f6..1848fa16 100644
> --- a/mt7915/mac.c

You should probably resend that with a full path.

johannes

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mt76: mt7915: fix injected MPDU transmission to not use HW A-MSDU
  2022-02-04 21:46 ` Johannes Berg
@ 2022-02-04 22:33   ` Johan Almbladh
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Almbladh @ 2022-02-04 22:33 UTC (permalink / raw)
  To: Johannes Berg, nbd; +Cc: lorenzo.bianconi83, ryder.lee, linux-wireless

On Fri, Feb 4, 2022 at 10:46 PM Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Fri, 2022-02-04 at 16:47 +0100, Johan Almbladh wrote:
> >
> > diff --git a/mt7915/mac.c b/mt7915/mac.c
> > index 08ee78f6..1848fa16 100644
> > --- a/mt7915/mac.c
>
> You should probably resend that with a full path.

Will do.

May I ask what tree is expected for mt76 patches? The kernel
MAINTAINERS file says nothing about it.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-04 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 15:47 [PATCH] mt76: mt7915: fix injected MPDU transmission to not use HW A-MSDU Johan Almbladh
2022-02-04 21:46 ` Johannes Berg
2022-02-04 22:33   ` Johan Almbladh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.