Commit dc877523 authored by Ryder Lee's avatar Ryder Lee Committed by Felix Fietkau

wifi: mt76: move move mt76_sta_stats to mt76_wcid

This is a preliminary patch for WED's TxS support.
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 00be84d6
...@@ -252,6 +252,26 @@ struct mt76_queue_ops { ...@@ -252,6 +252,26 @@ struct mt76_queue_ops {
void (*reset_q)(struct mt76_dev *dev, struct mt76_queue *q); void (*reset_q)(struct mt76_dev *dev, struct mt76_queue *q);
}; };
enum mt76_phy_type {
MT_PHY_TYPE_CCK,
MT_PHY_TYPE_OFDM,
MT_PHY_TYPE_HT,
MT_PHY_TYPE_HT_GF,
MT_PHY_TYPE_VHT,
MT_PHY_TYPE_HE_SU = 8,
MT_PHY_TYPE_HE_EXT_SU,
MT_PHY_TYPE_HE_TB,
MT_PHY_TYPE_HE_MU,
__MT_PHY_TYPE_HE_MAX,
};
struct mt76_sta_stats {
u64 tx_mode[__MT_PHY_TYPE_HE_MAX];
u64 tx_bw[4]; /* 20, 40, 80, 160 */
u64 tx_nss[4]; /* 1, 2, 3, 4 */
u64 tx_mcs[16]; /* mcs idx */
};
enum mt76_wcid_flags { enum mt76_wcid_flags {
MT_WCID_FLAG_CHECK_PS, MT_WCID_FLAG_CHECK_PS,
MT_WCID_FLAG_PS, MT_WCID_FLAG_PS,
...@@ -299,6 +319,8 @@ struct mt76_wcid { ...@@ -299,6 +319,8 @@ struct mt76_wcid {
struct list_head list; struct list_head list;
struct idr pktid; struct idr pktid;
struct mt76_sta_stats stats;
}; };
struct mt76_txq { struct mt76_txq {
...@@ -814,26 +836,6 @@ struct mt76_power_limits { ...@@ -814,26 +836,6 @@ struct mt76_power_limits {
s8 ru[7][12]; s8 ru[7][12];
}; };
enum mt76_phy_type {
MT_PHY_TYPE_CCK,
MT_PHY_TYPE_OFDM,
MT_PHY_TYPE_HT,
MT_PHY_TYPE_HT_GF,
MT_PHY_TYPE_VHT,
MT_PHY_TYPE_HE_SU = 8,
MT_PHY_TYPE_HE_EXT_SU,
MT_PHY_TYPE_HE_TB,
MT_PHY_TYPE_HE_MU,
__MT_PHY_TYPE_HE_MAX,
};
struct mt76_sta_stats {
u64 tx_mode[__MT_PHY_TYPE_HE_MAX];
u64 tx_bw[4]; /* 20, 40, 80, 160 */
u64 tx_nss[4]; /* 1, 2, 3, 4 */
u64 tx_mcs[16]; /* mcs idx */
};
struct mt76_ethtool_worker_info { struct mt76_ethtool_worker_info {
u64 *data; u64 *data;
int idx; int idx;
......
...@@ -355,8 +355,7 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi, ...@@ -355,8 +355,7 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
struct ieee80211_key_conf *key, int pid, struct ieee80211_key_conf *key, int pid,
enum mt76_txq_id qid, u32 changed); enum mt76_txq_id qid, u32 changed);
bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid, bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid,
int pid, __le32 *txs_data, int pid, __le32 *txs_data);
struct mt76_sta_stats *stats);
void mt76_connac2_mac_decode_he_radiotap(struct mt76_dev *dev, void mt76_connac2_mac_decode_he_radiotap(struct mt76_dev *dev,
struct sk_buff *skb, struct sk_buff *skb,
__le32 *rxv, u32 mode); __le32 *rxv, u32 mode);
......
...@@ -551,9 +551,9 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi, ...@@ -551,9 +551,9 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
EXPORT_SYMBOL_GPL(mt76_connac2_mac_write_txwi); EXPORT_SYMBOL_GPL(mt76_connac2_mac_write_txwi);
bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid, bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid,
int pid, __le32 *txs_data, int pid, __le32 *txs_data)
struct mt76_sta_stats *stats)
{ {
struct mt76_sta_stats *stats = &wcid->stats;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct mt76_phy *mphy; struct mt76_phy *mphy;
struct ieee80211_tx_info *info; struct ieee80211_tx_info *info;
......
...@@ -1015,8 +1015,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data) ...@@ -1015,8 +1015,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
msta = container_of(wcid, struct mt7915_sta, wcid); msta = container_of(wcid, struct mt7915_sta, wcid);
mt76_connac2_mac_add_txs_skb(&dev->mt76, wcid, pid, txs_data, mt76_connac2_mac_add_txs_skb(&dev->mt76, wcid, pid, txs_data);
&msta->stats);
if (!wcid->sta) if (!wcid->sta)
goto out; goto out;
......
...@@ -1224,7 +1224,7 @@ static void mt7915_ethtool_worker(void *wi_data, struct ieee80211_sta *sta) ...@@ -1224,7 +1224,7 @@ static void mt7915_ethtool_worker(void *wi_data, struct ieee80211_sta *sta)
if (msta->vif->mt76.idx != wi->idx) if (msta->vif->mt76.idx != wi->idx)
return; return;
mt76_ethtool_worker(wi, &msta->stats); mt76_ethtool_worker(wi, &msta->wcid.stats);
} }
static static
......
...@@ -127,8 +127,6 @@ struct mt7915_sta { ...@@ -127,8 +127,6 @@ struct mt7915_sta {
unsigned long jiffies; unsigned long jiffies;
unsigned long ampdu_state; unsigned long ampdu_state;
struct mt76_sta_stats stats;
struct mt76_connac_sta_key_conf bip; struct mt76_connac_sta_key_conf bip;
struct { struct {
......
...@@ -538,8 +538,7 @@ void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data) ...@@ -538,8 +538,7 @@ void mt7921_mac_add_txs(struct mt7921_dev *dev, void *data)
msta = container_of(wcid, struct mt7921_sta, wcid); msta = container_of(wcid, struct mt7921_sta, wcid);
mt76_connac2_mac_add_txs_skb(&dev->mt76, wcid, pid, txs_data, mt76_connac2_mac_add_txs_skb(&dev->mt76, wcid, pid, txs_data);
&msta->stats);
if (!wcid->sta) if (!wcid->sta)
goto out; goto out;
......
...@@ -1045,7 +1045,7 @@ mt7921_ethtool_worker(void *wi_data, struct ieee80211_sta *sta) ...@@ -1045,7 +1045,7 @@ mt7921_ethtool_worker(void *wi_data, struct ieee80211_sta *sta)
if (msta->vif->mt76.idx != wi->idx) if (msta->vif->mt76.idx != wi->idx)
return; return;
mt76_ethtool_worker(wi, &msta->stats); mt76_ethtool_worker(wi, &msta->wcid.stats);
} }
static static
......
...@@ -100,7 +100,6 @@ struct mt7921_sta { ...@@ -100,7 +100,6 @@ struct mt7921_sta {
unsigned long last_txs; unsigned long last_txs;
unsigned long ampdu_state; unsigned long ampdu_state;
struct mt76_sta_stats stats;
struct mt76_connac_sta_key_conf bip; struct mt76_connac_sta_key_conf bip;
}; };
......
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