linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cfg80211: add get_max_tp() API
@ 2013-04-04 19:57 Antonio Quartulli
  2013-04-04 19:57 ` [PATCH 2/3] mac80211: add rate_control_ops::get_max_tp() and implement it Antonio Quartulli
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Antonio Quartulli @ 2013-04-04 19:57 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Antonio Quartulli

This new API is aimed to let other modules in the kernel
fetch the maximum throughput value towards a peer over
a given VIF.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
 include/net/cfg80211.h | 20 ++++++++++++++++++++
 net/wireless/core.c    | 11 +++++++++++
 2 files changed, 31 insertions(+)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 57870b6..5019f67 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2002,6 +2002,9 @@ struct cfg80211_update_ft_ies_params {
  * @update_ft_ies: Provide updated Fast BSS Transition information to the
  *	driver. If the SME is in the driver/firmware, this information can be
  *	used in building Authentication and Reassociation Request frames.
+ *
+ * @get_max_tp: Get the maximum throughput estimated by the rate control
+ *	algorithm towards a given peer
  */
 struct cfg80211_ops {
 	int	(*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2231,6 +2234,9 @@ struct cfg80211_ops {
 					 struct cfg80211_chan_def *chandef);
 	int	(*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
 				 struct cfg80211_update_ft_ies_params *ftie);
+
+	int	(*get_max_tp)(struct wireless_dev *wdev, const u8 *peer,
+			      u32 *tp);
 };
 
 /*
@@ -4126,6 +4132,20 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
 				   struct cfg80211_wowlan_wakeup *wakeup,
 				   gfp_t gfp);
 
+/**
+ * cfg80211_get_max_tp - get the maximum estimated throughput towards a peer
+ * @wdev: the wireless device which the peer is connected to
+ * @peer: MAC address of the peer
+ * @tp: output buffer. Will contain the throughput value
+ *
+ * This functions queries the underlaying driver and gets the maximum
+ * estimated throughput towards the given peer. The result is then stored in the
+ * variable pointed by tp
+ *
+ * Return 0 on success or a negative error code otherwise
+ */
+int cfg80211_get_max_tp(struct wireless_dev *wdev, u8 *peer, u32 *tp);
+
 /* Logging, debugging and troubleshooting/diagnostic helpers. */
 
 /* wiphy_printk helpers, similar to dev_printk */
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 92e3fd4..ae86515 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -854,6 +854,17 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
 	wdev->beacon_interval = 0;
 }
 
+int cfg80211_get_max_tp(struct wireless_dev *wdev, u8 *peer, u32 *tp)
+{
+	struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
+
+	if (!rdev->ops->get_max_tp)
+		return -EOPNOTSUPP;
+
+	return rdev->ops->get_max_tp(wdev, peer, tp);
+}
+EXPORT_SYMBOL(cfg80211_get_max_tp);
+
 static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
 					 unsigned long state,
 					 void *ndev)
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-04-12 14:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-04 19:57 [PATCH 1/3] cfg80211: add get_max_tp() API Antonio Quartulli
2013-04-04 19:57 ` [PATCH 2/3] mac80211: add rate_control_ops::get_max_tp() and implement it Antonio Quartulli
2013-04-04 19:57 ` [PATCH 3/3] mac80211: implement cfg80211_ops::get_max_tp() API Antonio Quartulli
2013-04-05  8:21 ` [PATCH 1/3] cfg80211: add get_max_tp() API Helmut Schaa
2013-04-05  8:39   ` Antonio Quartulli
2013-04-05 13:20     ` Johannes Berg
2013-04-06  7:33       ` Antonio Quartulli
2013-04-09 10:25         ` Johannes Berg
2013-04-09 11:34           ` Antonio Quartulli
2013-04-11  9:56             ` Johannes Berg
2013-04-11  9:57               ` Johannes Berg
2013-04-12 14:10                 ` Antonio Quartulli

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).