From: Felix Fietkau <nbd@nbd.name>
To: linux-wireless@vger.kernel.org
Cc: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Subject: [PATCH v2 09/24] wifi: mt76: connac: add support for IEEE 802.11 fragmentation
Date: Tue, 27 Aug 2024 11:29:56 +0200 [thread overview]
Message-ID: <20240827093011.18621-9-nbd@nbd.name> (raw)
In-Reply-To: <20240827093011.18621-1-nbd@nbd.name>
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Add fragmentation index into TXD.DW2 to support IEEE 802.11 fragmentation.
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h | 7 +++++++
drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c | 10 +++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h
index 5f132115ebfc..eb4765365b8c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac2_mac.h
@@ -355,4 +355,11 @@ enum tx_port_idx {
MT_TX_PORT_IDX_MCU
};
+enum tx_frag_idx {
+ MT_TX_FRAG_NONE,
+ MT_TX_FRAG_FIRST,
+ MT_TX_FRAG_MID,
+ MT_TX_FRAG_LAST
+};
+
#endif /* __MT76_CONNAC2_MAC_H */
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
index b841bf628d02..a3db65254e37 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
@@ -391,6 +391,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
bool multicast = is_multicast_ether_addr(hdr->addr1);
u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
__le16 fc = hdr->frame_control;
+ __le16 sc = hdr->seq_ctrl;
u8 fc_type, fc_stype;
u32 val;
@@ -432,6 +433,13 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
info->flags & IEEE80211_TX_CTL_USE_MINRATE)
val |= MT_TXD2_FIX_RATE;
+ if (ieee80211_has_morefrags(fc) && ieee80211_is_first_frag(sc))
+ val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_FIRST);
+ else if (ieee80211_has_morefrags(fc) && !ieee80211_is_first_frag(sc))
+ val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_MID);
+ else if (!ieee80211_has_morefrags(fc) && !ieee80211_is_first_frag(sc))
+ val |= FIELD_PREP(MT_TXD2_FRAG, MT_TX_FRAG_LAST);
+
txwi[2] |= cpu_to_le32(val);
if (ieee80211_is_beacon(fc)) {
@@ -440,7 +448,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
}
if (info->flags & IEEE80211_TX_CTL_INJECTED) {
- u16 seqno = le16_to_cpu(hdr->seq_ctrl);
+ u16 seqno = le16_to_cpu(sc);
if (ieee80211_is_back_req(hdr->frame_control)) {
struct ieee80211_bar *bar;
--
2.46.0
next prev parent reply other threads:[~2024-08-27 9:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 9:29 [PATCH v2 01/24] mt76: mt7603: fix mixed declarations and code Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 02/24] wifi: mt76: mt7603: fix reading target power from eeprom Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 03/24] wifi: mt76: mt7603: initialize chainmask Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 04/24] wifi: mt76: fix mt76_get_rate Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 05/24] wifi: mt76: partially move channel change code to core Felix Fietkau
2024-08-27 18:02 ` Shiji Yang
2024-08-27 18:37 ` Felix Fietkau
2024-08-28 1:32 ` Shiji Yang
2024-08-28 6:34 ` [PATCH v3 " Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 06/24] wifi: mt76: add separate tx scheduling queue for off-channel tx Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 07/24] wifi: mt76: mt7915: disable tx worker during tx BA session enable/disable Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 08/24] wifi: mt76: mt7915: allocate vif wcid in the same range as stations Felix Fietkau
2024-08-27 9:29 ` Felix Fietkau [this message]
2024-08-27 9:29 ` [PATCH v2 10/24] wifi: mt76: connac: add support for passing connection state directly Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 11/24] wifi: mt76: change .sta_assoc callback to .sta_event Felix Fietkau
2024-08-27 9:29 ` [PATCH v2 12/24] wifi: mt76: mt7915: use mac80211 .sta_state op Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 13/24] wifi: mt76: mt7915: set MT76_MCU_RESET early in mt7915_mac_full_reset Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 14/24] wifi: mt76: mt7915: retry mcu messages Felix Fietkau
2024-09-13 19:32 ` Nícolas F. R. A. Prado
2024-09-17 10:22 ` Kalle Valo
2024-08-27 9:30 ` [PATCH v2 15/24] wifi: mt76: mt7915: reset the device after MCU timeout Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 16/24] wifi: mt76: mt7915: add dummy HW offload of IEEE 802.11 fragmentation Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 17/24] wifi: mt76: mt7915: hold dev->mt76.mutex while disabling tx worker Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 18/24] wifi: mt76: connac: move mt7615_mcu_del_wtbl_all to connac Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 19/24] wifi: mt76: mt7915: improve hardware restart reliability Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 20/24] mt76: shrink mt76_queue_buf Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 21/24] wifi: mt76: mt7915: fix rx filter setting for bfee functionality Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 22/24] wifi: mt76: mt7915: always query station rx rate from firmware Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 23/24] wifi: mt76: mt7996: fix uninitialized TLV data Felix Fietkau
2024-08-27 9:30 ` [PATCH v2 24/24] wifi: mt76: mt7915: avoid long MCU command timeouts during SER Felix Fietkau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240827093011.18621-9-nbd@nbd.name \
--to=nbd@nbd.name \
--cc=benjamin-jw.lin@mediatek.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox