* Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
[not found] <33dd8e4b7f7f72d191e8eca88b33b32dbf2595d2.1644313224.git.deren.wu@mediatek.comk--annotate>
@ 2022-02-08 19:18 ` sean.wang
0 siblings, 0 replies; 8+ messages in thread
From: sean.wang @ 2022-02-08 19:18 UTC (permalink / raw)
To: deren.wu
Cc: lorenzo.bianconi, nbd, sean.wang, Soul.Huang, YN.Chen, Leon.Yen,
Eric-SY.Chang, Deren.Wu, km.lin, robin.chiu, ch.yeh, posh.sun,
Eric.Liang, Stella.Chang, evelyn.tsai, Ryder.Lee, Shayne.Chen,
linux-wireless, linux-mediatek
From: Sean Wang <sean.wang@mediatek.com>
>from: Deren Wu <deren.wu@mediatek.com>
>
>For non-mmio devices, should set fc values to proper txwi config
>
>Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
>Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
>Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
>Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Tested-by: Sean Wang <sean.wang@mediatek.com>
>---
> drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++--- drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>index d17558349a17..e403f0225b77 100644
>--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>@@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> __le16 fc = hdr->frame_control;
> u8 fc_type, fc_stype;
> u32 val;
>+ bool is_mmio = mt76_is_mmio(&dev->mt76);
>
> if (ieee80211_is_action(fc) &&
> mgmt->u.action.category == WLAN_CATEGORY_BACK && @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> txwi[3] |= cpu_to_le32(val);
> }
>
>- val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
>- FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
>- txwi[7] |= cpu_to_le32(val);
>+ if (is_mmio) {
>+ val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
>+ FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
>+ txwi[7] |= cpu_to_le32(val);
>+ } else {
>+ val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
>+ FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
>+ txwi[8] |= cpu_to_le32(val);
>+ }
> }
>
> void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi, diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
>index 544a1c33126a..12e1cf8abe6e 100644
>--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
>+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
>@@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
> #define MT_TXD7_HW_AMSDU BIT(10)
> #define MT_TXD7_TX_TIME GENMASK(9, 0)
>
>+#define MT_TXD8_L_TYPE GENMASK(5, 4)
>+#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
>+
> #define MT_TX_RATE_STBC BIT(13)
> #define MT_TX_RATE_NSS GENMASK(12, 10)
> #define MT_TX_RATE_MODE GENMASK(9, 6)
>--
>2.18.0
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
@ 2022-02-08 19:18 ` sean.wang
0 siblings, 0 replies; 8+ messages in thread
From: sean.wang @ 2022-02-08 19:18 UTC (permalink / raw)
To: deren.wu
Cc: lorenzo.bianconi, nbd, sean.wang, Soul.Huang, YN.Chen, Leon.Yen,
Eric-SY.Chang, Deren.Wu, km.lin, robin.chiu, ch.yeh, posh.sun,
Eric.Liang, Stella.Chang, evelyn.tsai, Ryder.Lee, Shayne.Chen,
linux-wireless, linux-mediatek
From: Sean Wang <sean.wang@mediatek.com>
>from: Deren Wu <deren.wu@mediatek.com>
>
>For non-mmio devices, should set fc values to proper txwi config
>
>Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
>Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
>Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
>Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Tested-by: Sean Wang <sean.wang@mediatek.com>
>---
> drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++--- drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>index d17558349a17..e403f0225b77 100644
>--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
>@@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> __le16 fc = hdr->frame_control;
> u8 fc_type, fc_stype;
> u32 val;
>+ bool is_mmio = mt76_is_mmio(&dev->mt76);
>
> if (ieee80211_is_action(fc) &&
> mgmt->u.action.category == WLAN_CATEGORY_BACK && @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> txwi[3] |= cpu_to_le32(val);
> }
>
>- val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
>- FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
>- txwi[7] |= cpu_to_le32(val);
>+ if (is_mmio) {
>+ val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
>+ FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
>+ txwi[7] |= cpu_to_le32(val);
>+ } else {
>+ val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
>+ FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
>+ txwi[8] |= cpu_to_le32(val);
>+ }
> }
>
> void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi, diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
>index 544a1c33126a..12e1cf8abe6e 100644
>--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
>+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
>@@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
> #define MT_TXD7_HW_AMSDU BIT(10)
> #define MT_TXD7_TX_TIME GENMASK(9, 0)
>
>+#define MT_TXD8_L_TYPE GENMASK(5, 4)
>+#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
>+
> #define MT_TX_RATE_STBC BIT(13)
> #define MT_TX_RATE_NSS GENMASK(12, 10)
> #define MT_TX_RATE_MODE GENMASK(9, 6)
>--
>2.18.0
>
>
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
2022-02-08 23:34 ` Lorenzo Bianconi
@ 2022-02-08 23:35 ` Lorenzo Bianconi
-1 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2022-02-08 23:35 UTC (permalink / raw)
To: Deren Wu
Cc: Felix Fietkau, Sean Wang, Soul Huang, YN Chen, Leon Yen,
Eric-SY Chang, KM Lin, Robin Chiu, CH Yeh, Posh Sun, Eric Liang,
Stella Chang, Evelyn Tsai, Ryder Lee, Shayne Chen,
linux-wireless, linux-mediatek
[-- Attachment #1: Type: text/plain, Size: 2641 bytes --]
> >
> > For non-mmio devices, should set fc values to proper txwi config
> >
> > Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
> > Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
> > Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
> > Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> > ---
> > drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++---
> > drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
> > 2 files changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> > index d17558349a17..e403f0225b77 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> > @@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> > __le16 fc = hdr->frame_control;
> > u8 fc_type, fc_stype;
> > u32 val;
> > + bool is_mmio = mt76_is_mmio(&dev->mt76);
> >
> > if (ieee80211_is_action(fc) &&
> > mgmt->u.action.category == WLAN_CATEGORY_BACK &&
> > @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> > txwi[3] |= cpu_to_le32(val);
> > }
> >
> > - val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> > - FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> > - txwi[7] |= cpu_to_le32(val);
> > + if (is_mmio) {
>
> Nit: we do need is_mmio variable since it is used just here.
s/do need/do not need/
>
> Regards,
> Lorenzo
>
> > + val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> > + FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> > + txwi[7] |= cpu_to_le32(val);
> > + } else {
> > + val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
> > + FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
> > + txwi[8] |= cpu_to_le32(val);
> > + }
> > }
> >
> > void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> > index 544a1c33126a..12e1cf8abe6e 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> > @@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
> > #define MT_TXD7_HW_AMSDU BIT(10)
> > #define MT_TXD7_TX_TIME GENMASK(9, 0)
> >
> > +#define MT_TXD8_L_TYPE GENMASK(5, 4)
> > +#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
> > +
> > #define MT_TX_RATE_STBC BIT(13)
> > #define MT_TX_RATE_NSS GENMASK(12, 10)
> > #define MT_TX_RATE_MODE GENMASK(9, 6)
> > --
> > 2.18.0
> >
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
@ 2022-02-08 23:35 ` Lorenzo Bianconi
0 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2022-02-08 23:35 UTC (permalink / raw)
To: Deren Wu
Cc: Felix Fietkau, Sean Wang, Soul Huang, YN Chen, Leon Yen,
Eric-SY Chang, KM Lin, Robin Chiu, CH Yeh, Posh Sun, Eric Liang,
Stella Chang, Evelyn Tsai, Ryder Lee, Shayne Chen,
linux-wireless, linux-mediatek
[-- Attachment #1.1: Type: text/plain, Size: 2641 bytes --]
> >
> > For non-mmio devices, should set fc values to proper txwi config
> >
> > Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
> > Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
> > Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
> > Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> > ---
> > drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++---
> > drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
> > 2 files changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> > index d17558349a17..e403f0225b77 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> > @@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> > __le16 fc = hdr->frame_control;
> > u8 fc_type, fc_stype;
> > u32 val;
> > + bool is_mmio = mt76_is_mmio(&dev->mt76);
> >
> > if (ieee80211_is_action(fc) &&
> > mgmt->u.action.category == WLAN_CATEGORY_BACK &&
> > @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> > txwi[3] |= cpu_to_le32(val);
> > }
> >
> > - val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> > - FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> > - txwi[7] |= cpu_to_le32(val);
> > + if (is_mmio) {
>
> Nit: we do need is_mmio variable since it is used just here.
s/do need/do not need/
>
> Regards,
> Lorenzo
>
> > + val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> > + FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> > + txwi[7] |= cpu_to_le32(val);
> > + } else {
> > + val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
> > + FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
> > + txwi[8] |= cpu_to_le32(val);
> > + }
> > }
> >
> > void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> > index 544a1c33126a..12e1cf8abe6e 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> > @@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
> > #define MT_TXD7_HW_AMSDU BIT(10)
> > #define MT_TXD7_TX_TIME GENMASK(9, 0)
> >
> > +#define MT_TXD8_L_TYPE GENMASK(5, 4)
> > +#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
> > +
> > #define MT_TX_RATE_STBC BIT(13)
> > #define MT_TX_RATE_NSS GENMASK(12, 10)
> > #define MT_TX_RATE_MODE GENMASK(9, 6)
> > --
> > 2.18.0
> >
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
2022-02-08 15:34 ` Deren Wu
@ 2022-02-08 23:34 ` Lorenzo Bianconi
-1 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2022-02-08 23:34 UTC (permalink / raw)
To: Deren Wu
Cc: Felix Fietkau, Sean Wang, Soul Huang, YN Chen, Leon Yen,
Eric-SY Chang, KM Lin, Robin Chiu, CH Yeh, Posh Sun, Eric Liang,
Stella Chang, Evelyn Tsai, Ryder Lee, Shayne Chen,
linux-wireless, linux-mediatek
[-- Attachment #1: Type: text/plain, Size: 2519 bytes --]
> From: Deren Wu <deren.wu@mediatek.com>
>
> For non-mmio devices, should set fc values to proper txwi config
>
> Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
> Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
> Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
> Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++---
> drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> index d17558349a17..e403f0225b77 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> @@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> __le16 fc = hdr->frame_control;
> u8 fc_type, fc_stype;
> u32 val;
> + bool is_mmio = mt76_is_mmio(&dev->mt76);
>
> if (ieee80211_is_action(fc) &&
> mgmt->u.action.category == WLAN_CATEGORY_BACK &&
> @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> txwi[3] |= cpu_to_le32(val);
> }
>
> - val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> - FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> - txwi[7] |= cpu_to_le32(val);
> + if (is_mmio) {
Nit: we do need is_mmio variable since it is used just here.
Regards,
Lorenzo
> + val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> + FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> + txwi[7] |= cpu_to_le32(val);
> + } else {
> + val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
> + FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
> + txwi[8] |= cpu_to_le32(val);
> + }
> }
>
> void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> index 544a1c33126a..12e1cf8abe6e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> @@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
> #define MT_TXD7_HW_AMSDU BIT(10)
> #define MT_TXD7_TX_TIME GENMASK(9, 0)
>
> +#define MT_TXD8_L_TYPE GENMASK(5, 4)
> +#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
> +
> #define MT_TX_RATE_STBC BIT(13)
> #define MT_TX_RATE_NSS GENMASK(12, 10)
> #define MT_TX_RATE_MODE GENMASK(9, 6)
> --
> 2.18.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
@ 2022-02-08 23:34 ` Lorenzo Bianconi
0 siblings, 0 replies; 8+ messages in thread
From: Lorenzo Bianconi @ 2022-02-08 23:34 UTC (permalink / raw)
To: Deren Wu
Cc: Felix Fietkau, Sean Wang, Soul Huang, YN Chen, Leon Yen,
Eric-SY Chang, KM Lin, Robin Chiu, CH Yeh, Posh Sun, Eric Liang,
Stella Chang, Evelyn Tsai, Ryder Lee, Shayne Chen,
linux-wireless, linux-mediatek
[-- Attachment #1.1: Type: text/plain, Size: 2519 bytes --]
> From: Deren Wu <deren.wu@mediatek.com>
>
> For non-mmio devices, should set fc values to proper txwi config
>
> Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
> Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
> Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
> Signed-off-by: Deren Wu <deren.wu@mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++---
> drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> index d17558349a17..e403f0225b77 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
> @@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> __le16 fc = hdr->frame_control;
> u8 fc_type, fc_stype;
> u32 val;
> + bool is_mmio = mt76_is_mmio(&dev->mt76);
>
> if (ieee80211_is_action(fc) &&
> mgmt->u.action.category == WLAN_CATEGORY_BACK &&
> @@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
> txwi[3] |= cpu_to_le32(val);
> }
>
> - val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> - FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> - txwi[7] |= cpu_to_le32(val);
> + if (is_mmio) {
Nit: we do need is_mmio variable since it is used just here.
Regards,
Lorenzo
> + val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
> + FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
> + txwi[7] |= cpu_to_le32(val);
> + } else {
> + val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
> + FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
> + txwi[8] |= cpu_to_le32(val);
> + }
> }
>
> void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> index 544a1c33126a..12e1cf8abe6e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
> @@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
> #define MT_TXD7_HW_AMSDU BIT(10)
> #define MT_TXD7_TX_TIME GENMASK(9, 0)
>
> +#define MT_TXD8_L_TYPE GENMASK(5, 4)
> +#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
> +
> #define MT_TX_RATE_STBC BIT(13)
> #define MT_TX_RATE_NSS GENMASK(12, 10)
> #define MT_TX_RATE_MODE GENMASK(9, 6)
> --
> 2.18.0
>
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 170 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
@ 2022-02-08 15:34 ` Deren Wu
0 siblings, 0 replies; 8+ messages in thread
From: Deren Wu @ 2022-02-08 15:34 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi
Cc: Sean Wang, Soul Huang, YN Chen, Leon Yen, Eric-SY Chang,
Deren Wu, KM Lin, Robin Chiu, CH Yeh, Posh Sun, Eric Liang,
Stella Chang, Evelyn Tsai, Ryder Lee, Shayne Chen,
linux-wireless, linux-mediatek, Deren Wu
From: Deren Wu <deren.wu@mediatek.com>
For non-mmio devices, should set fc values to proper txwi config
Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++---
drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index d17558349a17..e403f0225b77 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
__le16 fc = hdr->frame_control;
u8 fc_type, fc_stype;
u32 val;
+ bool is_mmio = mt76_is_mmio(&dev->mt76);
if (ieee80211_is_action(fc) &&
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
@@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
txwi[3] |= cpu_to_le32(val);
}
- val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
- FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
- txwi[7] |= cpu_to_le32(val);
+ if (is_mmio) {
+ val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
+ FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
+ txwi[7] |= cpu_to_le32(val);
+ } else {
+ val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
+ FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
+ txwi[8] |= cpu_to_le32(val);
+ }
}
void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
index 544a1c33126a..12e1cf8abe6e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
@@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
#define MT_TXD7_HW_AMSDU BIT(10)
#define MT_TXD7_TX_TIME GENMASK(9, 0)
+#define MT_TXD8_L_TYPE GENMASK(5, 4)
+#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
+
#define MT_TX_RATE_STBC BIT(13)
#define MT_TX_RATE_NSS GENMASK(12, 10)
#define MT_TX_RATE_MODE GENMASK(9, 6)
--
2.18.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts
@ 2022-02-08 15:34 ` Deren Wu
0 siblings, 0 replies; 8+ messages in thread
From: Deren Wu @ 2022-02-08 15:34 UTC (permalink / raw)
To: Felix Fietkau, Lorenzo Bianconi
Cc: Sean Wang, Soul Huang, YN Chen, Leon Yen, Eric-SY Chang,
Deren Wu, KM Lin, Robin Chiu, CH Yeh, Posh Sun, Eric Liang,
Stella Chang, Evelyn Tsai, Ryder Lee, Shayne Chen,
linux-wireless, linux-mediatek, Deren Wu
From: Deren Wu <deren.wu@mediatek.com>
For non-mmio devices, should set fc values to proper txwi config
Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support")
Co-developed-by: Leon Yen <Leon.Yen@mediatek.com>
Signed-off-by: Leon Yen <Leon.Yen@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
---
drivers/net/wireless/mediatek/mt76/mt7921/mac.c | 13 ++++++++++---
drivers/net/wireless/mediatek/mt76/mt7921/mac.h | 3 +++
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
index d17558349a17..e403f0225b77 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.c
@@ -852,6 +852,7 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
__le16 fc = hdr->frame_control;
u8 fc_type, fc_stype;
u32 val;
+ bool is_mmio = mt76_is_mmio(&dev->mt76);
if (ieee80211_is_action(fc) &&
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
@@ -912,9 +913,15 @@ mt7921_mac_write_txwi_80211(struct mt7921_dev *dev, __le32 *txwi,
txwi[3] |= cpu_to_le32(val);
}
- val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
- FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
- txwi[7] |= cpu_to_le32(val);
+ if (is_mmio) {
+ val = FIELD_PREP(MT_TXD7_TYPE, fc_type) |
+ FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype);
+ txwi[7] |= cpu_to_le32(val);
+ } else {
+ val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) |
+ FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype);
+ txwi[8] |= cpu_to_le32(val);
+ }
}
void mt7921_mac_write_txwi(struct mt7921_dev *dev, __le32 *txwi,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
index 544a1c33126a..12e1cf8abe6e 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mac.h
@@ -284,6 +284,9 @@ enum tx_mcu_port_q_idx {
#define MT_TXD7_HW_AMSDU BIT(10)
#define MT_TXD7_TX_TIME GENMASK(9, 0)
+#define MT_TXD8_L_TYPE GENMASK(5, 4)
+#define MT_TXD8_L_SUB_TYPE GENMASK(3, 0)
+
#define MT_TX_RATE_STBC BIT(13)
#define MT_TX_RATE_NSS GENMASK(12, 10)
#define MT_TX_RATE_MODE GENMASK(9, 6)
--
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-02-08 23:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <33dd8e4b7f7f72d191e8eca88b33b32dbf2595d2.1644313224.git.deren.wu@mediatek.comk--annotate>
2022-02-08 19:18 ` [PATCH] mt76: mt7921s: fix missing fc type/sub-type for 802.11 pkts sean.wang
2022-02-08 19:18 ` sean.wang
2022-02-08 15:34 Deren Wu
2022-02-08 15:34 ` Deren Wu
2022-02-08 23:34 ` Lorenzo Bianconi
2022-02-08 23:34 ` Lorenzo Bianconi
2022-02-08 23:35 ` Lorenzo Bianconi
2022-02-08 23:35 ` Lorenzo Bianconi
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.