From: Ryder Lee <ryder.lee@mediatek.com> To: Felix Fietkau <nbd@nbd.name>, Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Cc: Shayne Chen <shayne.chen@mediatek.com>, YF Luo <yf.luo@mediatek.com>, Yiwei Chung <yiwei.chung@mediatek.com>, Chih-Min Chen <chih-min.chen@mediatek.com>, Evelyn Tsai <evelyn.tsai@mediatek.com>, Sean Wang <sean.wang@mediatek.com>, <linux-wireless@vger.kernel.org>, <linux-mediatek@lists.infradead.org>, Ryder Lee <ryder.lee@mediatek.com> Subject: [PATCH 14/16] mt76: mt7915: add .sta_statistics support Date: Fri, 10 Apr 2020 16:54:51 +0800 [thread overview] Message-ID: <8e434a52755b926cc88cd0aebce59772e82e2793.1586507878.git.ryder.lee@mediatek.com> (raw) In-Reply-To: <cover.1586507878.git.ryder.lee@mediatek.com> Add useful debug counters since this generation uses struct rate_info to report HE tx rate. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> --- .../net/wireless/mediatek/mt76/mt7915/main.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index 801c93aa0bd8..00a22fc46b0c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -700,6 +700,31 @@ mt7915_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant) return 0; } +static void mt7915_sta_statistics(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct station_info *sinfo) +{ + struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; + struct mt7915_sta_stats *stats = &msta->stats; + + if (!stats->tx_rate.legacy && !stats->tx_rate.flags) + return; + + if (stats->tx_rate.legacy) { + sinfo->txrate.legacy = stats->tx_rate.legacy; + } else { + sinfo->txrate.mcs = stats->tx_rate.mcs; + sinfo->txrate.nss = stats->tx_rate.nss; + sinfo->txrate.bw = stats->tx_rate.bw; + sinfo->txrate.he_gi = stats->tx_rate.he_gi; + sinfo->txrate.he_dcm = stats->tx_rate.he_dcm; + sinfo->txrate.he_ru_alloc = stats->tx_rate.he_ru_alloc; + } + sinfo->txrate.flags = stats->tx_rate.flags; + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); +} + static void mt7915_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -748,6 +773,7 @@ const struct ieee80211_ops mt7915_ops = { .get_antenna = mt76_get_antenna, .set_antenna = mt7915_set_antenna, .set_coverage_class = mt7915_set_coverage_class, + .sta_statistics = mt7915_sta_statistics, #ifdef CONFIG_MAC80211_DEBUGFS .sta_add_debugfs = mt7915_sta_add_debugfs, #endif -- 2.18.0
WARNING: multiple messages have this Message-ID (diff)
From: Ryder Lee <ryder.lee@mediatek.com> To: Felix Fietkau <nbd@nbd.name>, Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Cc: YF Luo <yf.luo@mediatek.com>, Evelyn Tsai <evelyn.tsai@mediatek.com>, linux-wireless@vger.kernel.org, Sean Wang <sean.wang@mediatek.com>, Chih-Min Chen <chih-min.chen@mediatek.com>, Ryder Lee <ryder.lee@mediatek.com>, Yiwei Chung <yiwei.chung@mediatek.com>, linux-mediatek@lists.infradead.org, Shayne Chen <shayne.chen@mediatek.com> Subject: [PATCH 14/16] mt76: mt7915: add .sta_statistics support Date: Fri, 10 Apr 2020 16:54:51 +0800 [thread overview] Message-ID: <8e434a52755b926cc88cd0aebce59772e82e2793.1586507878.git.ryder.lee@mediatek.com> (raw) In-Reply-To: <cover.1586507878.git.ryder.lee@mediatek.com> Add useful debug counters since this generation uses struct rate_info to report HE tx rate. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> --- .../net/wireless/mediatek/mt76/mt7915/main.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index 801c93aa0bd8..00a22fc46b0c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -700,6 +700,31 @@ mt7915_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant) return 0; } +static void mt7915_sta_statistics(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_sta *sta, + struct station_info *sinfo) +{ + struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; + struct mt7915_sta_stats *stats = &msta->stats; + + if (!stats->tx_rate.legacy && !stats->tx_rate.flags) + return; + + if (stats->tx_rate.legacy) { + sinfo->txrate.legacy = stats->tx_rate.legacy; + } else { + sinfo->txrate.mcs = stats->tx_rate.mcs; + sinfo->txrate.nss = stats->tx_rate.nss; + sinfo->txrate.bw = stats->tx_rate.bw; + sinfo->txrate.he_gi = stats->tx_rate.he_gi; + sinfo->txrate.he_dcm = stats->tx_rate.he_dcm; + sinfo->txrate.he_ru_alloc = stats->tx_rate.he_ru_alloc; + } + sinfo->txrate.flags = stats->tx_rate.flags; + sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_BITRATE); +} + static void mt7915_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -748,6 +773,7 @@ const struct ieee80211_ops mt7915_ops = { .get_antenna = mt76_get_antenna, .set_antenna = mt7915_set_antenna, .set_coverage_class = mt7915_set_coverage_class, + .sta_statistics = mt7915_sta_statistics, #ifdef CONFIG_MAC80211_DEBUGFS .sta_add_debugfs = mt7915_sta_add_debugfs, #endif -- 2.18.0 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2020-04-10 8:55 UTC|newest] Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-10 8:54 [PATCH 00/16] Add MediaTek IEEE 802.11ax devices - MT7915E Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 01/16] mt76: avoid rx reorder buffer overflow Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 02/16] mt76: add support for HE RX rate reporting Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 03/16] mt76: add Rx stats support for radiotap Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 04/16] mt76: adjust wcid size to support new 802.11ax generation Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 05/16] mt76: add HE phy modes and hardware queue Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 06/16] mt76: add mac80211 driver for MT7915 PCIe-based chipsets Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-14 6:37 ` Kalle Valo 2020-04-14 6:37 ` Kalle Valo 2020-04-14 9:05 ` Ryder Lee 2020-04-14 9:05 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 07/16] mt76: mt7915: implement HE per-rate tx power support Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 08/16] mt76: mt7915: add offloading Tx AMSDU support Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-14 6:44 ` Kalle Valo 2020-04-14 6:44 ` Kalle Valo 2020-04-14 9:59 ` Ryder Lee 2020-04-14 9:59 ` Ryder Lee 2020-04-14 10:05 ` Kalle Valo 2020-04-14 10:05 ` Kalle Valo 2020-04-10 8:54 ` [PATCH 09/16] mt76: mt7915: register HE capabilities for each interface Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 10/16] mt76: mt7915: add HE bss_conf support for interfaces Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 11/16] mt76: mt7915: add HE capabilities support for peers Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 12/16] mt76: mt7915: add Rx radiotap header support Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 13/16] mt76: mt7915: add .sta_add_debugfs support Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` Ryder Lee [this message] 2020-04-10 8:54 ` [PATCH 14/16] mt76: mt7915: add .sta_statistics support Ryder Lee 2020-04-10 8:54 ` [PATCH 15/16] mt76: mt7915: set peer Tx fixed rate through debugfs Ryder Lee 2020-04-10 8:54 ` Ryder Lee 2020-04-10 8:54 ` [PATCH 16/16] mt76: mt7915: enable firmware module debug support Ryder Lee 2020-04-10 8:54 ` Ryder Lee
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=8e434a52755b926cc88cd0aebce59772e82e2793.1586507878.git.ryder.lee@mediatek.com \ --to=ryder.lee@mediatek.com \ --cc=chih-min.chen@mediatek.com \ --cc=evelyn.tsai@mediatek.com \ --cc=linux-mediatek@lists.infradead.org \ --cc=linux-wireless@vger.kernel.org \ --cc=lorenzo.bianconi@redhat.com \ --cc=nbd@nbd.name \ --cc=sean.wang@mediatek.com \ --cc=shayne.chen@mediatek.com \ --cc=yf.luo@mediatek.com \ --cc=yiwei.chung@mediatek.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.