Commit 49f1132c authored by Ryder Lee's avatar Ryder Lee Committed by Felix Fietkau

mt76: mt7615: add 4 WMM sets support

Hardware supports 4 sets of WMM that should be put to good use.
And fix incorrect queue mapping in mt7615_conf_tx().
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 5e814e71
...@@ -314,7 +314,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, ...@@ -314,7 +314,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct ieee80211_vif *vif = info->control.vif; struct ieee80211_vif *vif = info->control.vif;
int tx_count = 8; int tx_count = 8;
u8 fc_type, fc_stype, p_fmt, q_idx, omac_idx = 0; u8 fc_type, fc_stype, p_fmt, q_idx, omac_idx = 0, wmm_idx = 0;
__le16 fc = hdr->frame_control; __le16 fc = hdr->frame_control;
u16 seqno = 0; u16 seqno = 0;
u32 val; u32 val;
...@@ -323,6 +323,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, ...@@ -323,6 +323,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv; struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
omac_idx = mvif->omac_idx; omac_idx = mvif->omac_idx;
wmm_idx = mvif->wmm_idx;
} }
if (sta) { if (sta) {
...@@ -335,7 +336,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, ...@@ -335,7 +336,7 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4; fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4;
if (ieee80211_is_data(fc) || ieee80211_is_bufferable_mmpdu(fc)) { if (ieee80211_is_data(fc) || ieee80211_is_bufferable_mmpdu(fc)) {
q_idx = skb_get_queue_mapping(skb); q_idx = skb_get_queue_mapping(skb) + wmm_idx * MT7615_MAX_WMM_SETS;
p_fmt = MT_TX_TYPE_CT; p_fmt = MT_TX_TYPE_CT;
} else if (ieee80211_is_beacon(fc)) { } else if (ieee80211_is_beacon(fc)) {
q_idx = MT_LMAC_BCN0; q_idx = MT_LMAC_BCN0;
......
...@@ -85,9 +85,9 @@ static int mt7615_add_interface(struct ieee80211_hw *hw, ...@@ -85,9 +85,9 @@ static int mt7615_add_interface(struct ieee80211_hw *hw,
} }
mvif->omac_idx = idx; mvif->omac_idx = idx;
/* TODO: DBDC support. Use band 0 and wmm 0 for now */ /* TODO: DBDC support. Use band 0 for now */
mvif->band_idx = 0; mvif->band_idx = 0;
mvif->wmm_idx = 0; mvif->wmm_idx = mvif->idx % MT7615_MAX_WMM_SETS;
ret = mt7615_mcu_set_dev_info(dev, vif, 1); ret = mt7615_mcu_set_dev_info(dev, vif, 1);
if (ret) if (ret)
...@@ -239,16 +239,12 @@ static int ...@@ -239,16 +239,12 @@ static int
mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, mt7615_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue,
const struct ieee80211_tx_queue_params *params) const struct ieee80211_tx_queue_params *params)
{ {
struct mt7615_vif *mvif = (struct mt7615_vif *)vif->drv_priv;
struct mt7615_dev *dev = hw->priv; struct mt7615_dev *dev = hw->priv;
static const u8 wmm_queue_map[] = {
[IEEE80211_AC_BK] = 0,
[IEEE80211_AC_BE] = 1,
[IEEE80211_AC_VI] = 2,
[IEEE80211_AC_VO] = 3,
};
/* TODO: hw wmm_set 1~3 */ queue += mvif->wmm_idx * MT7615_MAX_WMM_SETS;
return mt7615_mcu_set_wmm(dev, wmm_queue_map[queue], params);
return mt7615_mcu_set_wmm(dev, queue, params);
} }
static void mt7615_configure_filter(struct ieee80211_hw *hw, static void mt7615_configure_filter(struct ieee80211_hw *hw,
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "regs.h" #include "regs.h"
#define MT7615_MAX_INTERFACES 4 #define MT7615_MAX_INTERFACES 4
#define MT7615_MAX_WMM_SETS 4
#define MT7615_WTBL_SIZE 128 #define MT7615_WTBL_SIZE 128
#define MT7615_WTBL_RESERVED (MT7615_WTBL_SIZE - 1) #define MT7615_WTBL_RESERVED (MT7615_WTBL_SIZE - 1)
#define MT7615_WTBL_STA (MT7615_WTBL_RESERVED - \ #define MT7615_WTBL_STA (MT7615_WTBL_RESERVED - \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment