From patchwork Mon Apr 14 14:03:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 3988 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=178.209.62.157; helo=s3.neomailbox.net; envelope-from=antonio@meshcoding.com; receiver=b.a.t.m.a.n@lists.open-mesh.org Received: from s3.neomailbox.net (s3.neomailbox.net [178.209.62.157]) by open-mesh.org (Postfix) with ESMTPS id EA21B600A53 for ; Mon, 14 Apr 2014 16:04:05 +0200 (CEST) From: Antonio Quartulli To: Johannes Berg Date: Mon, 14 Apr 2014 16:03:24 +0200 Message-Id: <1397484205-20905-6-git-send-email-antonio@meshcoding.com> In-Reply-To: <1397484205-20905-1-git-send-email-antonio@meshcoding.com> References: <1397484205-20905-1-git-send-email-antonio@meshcoding.com> Cc: devel@lists.open80211s.org, Felix Fietkau , b.a.t.m.a.n@lists.open-mesh.org, linux-wireless@vger.kernel.org, Antonio Quartulli Subject: [B.A.T.M.A.N.] [PATCH 6/7] mac80211: minstrel_ht - implement get_expected_throughput() API X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2014 14:04:06 -0000 From: Antonio Quartulli Cc: Felix Fietkau Signed-off-by: Antonio Quartulli --- net/mac80211/rc80211_minstrel_ht.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/net/mac80211/rc80211_minstrel_ht.c b/net/mac80211/rc80211_minstrel_ht.c index bccaf85..480f657 100644 --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c @@ -1031,6 +1031,24 @@ minstrel_ht_free(void *priv) mac80211_minstrel.free(priv); } +static u32 +minstrel_ht_get_expected_throughput(void *priv, void *priv_sta, + struct ieee80211_supported_band *sband) +{ + struct minstrel_ht_sta_priv *msp = priv_sta; + struct minstrel_ht_sta *mi = &msp->ht; + int i, j; + + if (!msp->is_ht) + return mac80211_minstrel.get_expected_throughput(priv, priv_sta, + sband); + + i = mi->max_tp_rate / MCS_GROUP_RATES; + j = mi->max_tp_rate % MCS_GROUP_RATES; + + return mi->groups[i].rates[j].cur_tp; +} + static const struct rate_control_ops mac80211_minstrel_ht = { .name = "minstrel_ht", .tx_status = minstrel_ht_tx_status, @@ -1045,6 +1063,7 @@ static const struct rate_control_ops mac80211_minstrel_ht = { .add_sta_debugfs = minstrel_ht_add_sta_debugfs, .remove_sta_debugfs = minstrel_ht_remove_sta_debugfs, #endif + .get_expected_throughput = minstrel_ht_get_expected_throughput, };