From patchwork Thu Apr 4 19:57:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 2394701 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 60561DF25A for ; Thu, 4 Apr 2013 20:03:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763748Ab3DDUDy (ORCPT ); Thu, 4 Apr 2013 16:03:54 -0400 Received: from ht2.myhostedexchange.com ([69.50.2.38]:20962 "EHLO ht1.hostedexchange.local" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1763426Ab3DDUDy (ORCPT ); Thu, 4 Apr 2013 16:03:54 -0400 Received: from eagle4.ritirata.org (88.149.161.239) by ht2.hostedexchange.local (172.16.69.40) with Microsoft SMTP Server id 8.3.298.1; Thu, 4 Apr 2013 12:58:47 -0700 From: Antonio Quartulli To: Johannes Berg CC: , Antonio Quartulli Subject: [PATCH 3/3] mac80211: implement cfg80211_ops::get_max_tp() API Date: Thu, 4 Apr 2013 21:57:22 +0200 Message-ID: <1365105442-31876-3-git-send-email-antonio@open-mesh.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1365105442-31876-1-git-send-email-antonio@open-mesh.com> References: <1365105442-31876-1-git-send-email-antonio@open-mesh.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Implement the get_max_tp() API function by asking the rate control algorithm for the maximum estimated throughput Signed-off-by: Antonio Quartulli --- net/mac80211/cfg.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index edca2a2..2a78957 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3374,6 +3374,27 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy, return ret; } +int ieee80211_get_max_tp(struct wireless_dev *wdev, const u8 *peer, u32 *tp) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); + struct rate_control_ref *ref = sdata->local->rate_ctrl; + struct sta_info *sta; + + rcu_read_lock(); + sta = sta_info_get(sdata, peer); + rcu_read_unlock(); + + if (!sta) + return -ENOENT; + + if (!ref->ops->get_max_tp) + return -EOPNOTSUPP; + + ref->ops->get_max_tp(sta->rate_ctrl_priv, tp); + + return 0; +} + #ifdef CONFIG_PM static void ieee80211_set_wakeup(struct wiphy *wiphy, bool enabled) { @@ -3459,4 +3480,5 @@ struct cfg80211_ops mac80211_config_ops = { .get_et_strings = ieee80211_get_et_strings, .get_channel = ieee80211_cfg_get_channel, .start_radar_detection = ieee80211_start_radar_detection, + .get_max_tp = ieee80211_get_max_tp, };