Search Linux Wireless

[PATCH 3/3] mac80211: implement cfg80211_ops::get_max_tp() API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Implement the get_max_tp() API function by asking the
rate control algorithm for the maximum estimated throughput

Signed-off-by: Antonio Quartulli <antonio@xxxxxxxxxxxxx>
---
 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,
 };
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux