From: Antonio Quartulli <antonio@meshcoding.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org,
Antonio Quartulli <antonio@open-mesh.com>
Subject: [RFC 2/5] mac80211: export minstrel best rate information in set_sta_info()
Date: Tue, 21 Jan 2014 12:09:48 +0100 [thread overview]
Message-ID: <1390302591-3352-3-git-send-email-antonio@meshcoding.com> (raw)
In-Reply-To: <1390302591-3352-1-git-send-email-antonio@meshcoding.com>
From: Antonio Quartulli <antonio@open-mesh.com>
Add the get_minstrel_best_rate() RC API in order to retrieve
the rate having the highest throughput. If the RC algorithm
implements such API, then fill the related field in
station_info when dumping a station.
This API is supposed to be implemented by Minstrel only.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
include/net/mac80211.h | 15 +++++++++++++++
net/mac80211/cfg.c | 15 +++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index df1004b..9ed56f8 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -4452,6 +4452,17 @@ struct ieee80211_tx_rate_control {
bool bss;
};
+/**
+ * struct ieee80211_minstrel_rate_info - rate information extracted from
+ * the Minstrel RC algorithm
+ * @rate: the reported bitrate
+ * @prob: probability of success of rate computed by Minstrel
+ */
+struct ieee80211_minstrel_rate_info {
+ struct ieee80211_tx_rate rate;
+ u32 prob;
+};
+
struct rate_control_ops {
struct module *module;
const char *name;
@@ -4478,6 +4489,10 @@ struct rate_control_ops {
void (*add_sta_debugfs)(void *priv, void *priv_sta,
struct dentry *dir);
void (*remove_sta_debugfs)(void *priv, void *priv_sta);
+
+ void (*get_minstrel_best_rate)
+ (void *priv, void *priv_sta,
+ struct ieee80211_minstrel_rate_info *info);
};
static inline int rate_supported(struct ieee80211_sta *sta,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 032081c..c0d394c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -463,6 +463,9 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
{
struct ieee80211_sub_if_data *sdata = sta->sdata;
struct ieee80211_local *local = sdata->local;
+ struct ieee80211_minstrel_rate_info info;
+ struct rate_control_ref *ref = local->rate_ctrl;
+ struct rate_info rinfo;
struct timespec uptime;
u64 packets = 0;
int i, ac;
@@ -578,6 +581,18 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_ASSOCIATED);
if (test_sta_flag(sta, WLAN_STA_TDLS_PEER))
sinfo->sta_flags.set |= BIT(NL80211_STA_FLAG_TDLS_PEER);
+
+ if (!ref->ops->get_minstrel_best_rate)
+ return;
+
+ sinfo->filled |= STATION_INFO_MINSTREL_BEST_RATE;
+
+ ref->ops->get_minstrel_best_rate(ref->priv, sta->rate_ctrl_priv, &info);
+
+ sta_set_rate_info_tx(sta, &info.rate, &rinfo);
+
+ sinfo->minstrel_best_rate.bitrate = cfg80211_calculate_bitrate(&rinfo);
+ sinfo->minstrel_best_rate.prob = info.prob;
}
static const char ieee80211_gstrings_sta_stats[][ETH_GSTRING_LEN] = {
--
1.8.5.3
next prev parent reply other threads:[~2014-01-21 11:11 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-21 11:09 [RFC 0/5] Export Minstrel best API information via get_station() Antonio Quartulli
2014-01-21 11:09 ` [RFC 1/5] cfg80211: export minstrel best rate information through get_station() Antonio Quartulli
2014-01-21 16:00 ` Johannes Berg
2014-01-21 16:09 ` Antonio Quartulli
2014-01-21 16:18 ` Johannes Berg
2014-01-21 16:32 ` Antonio Quartulli
2014-01-22 14:41 ` Antonio Quartulli
2014-01-22 14:43 ` Johannes Berg
2014-01-22 18:32 ` Thomas Hühn
2014-01-22 18:44 ` Antonio Quartulli
2014-01-21 11:09 ` Antonio Quartulli [this message]
2014-01-21 16:01 ` [RFC 2/5] mac80211: export minstrel best rate information in set_sta_info() Johannes Berg
2014-01-21 11:09 ` [RFC 3/5] mac80211: minstrel - implement get_minstrel_best_rate() API Antonio Quartulli
2014-01-21 11:09 ` [RFC 4/5] mac80211: minstrel_ht " Antonio Quartulli
2014-01-21 11:09 ` [RFC 5/5] cfg80211: implement cfg80211_get_station Antonio Quartulli
2014-01-21 16:03 ` Johannes Berg
2014-01-21 16:07 ` Antonio Quartulli
2014-01-21 13:52 ` [RFC 0/5] Export Minstrel best API information via get_station() Thomas Hühn
2014-01-21 15:28 ` Antonio Quartulli
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=1390302591-3352-3-git-send-email-antonio@meshcoding.com \
--to=antonio@meshcoding.com \
--cc=antonio@open-mesh.com \
--cc=johannes@sipsolutions.net \
--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;
as well as URLs for NNTP newsgroup(s).