Search Linux Wireless

[PATCH 2/2] mac80211: add enable_dynack API

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

 



Add enable_dynack API to mac80211 in order to enable the estimation
of ack timeout (dynack). Currently dynack is supported just by ath9k

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@xxxxxxxxx>
---
 include/net/mac80211.h    |  4 ++++
 net/mac80211/cfg.c        |  8 ++++++++
 net/mac80211/driver-ops.h | 14 ++++++++++++++
 net/mac80211/trace.h      |  5 +++++
 4 files changed, 31 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9ce5cb1..723db9b 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -2840,6 +2840,8 @@ enum ieee80211_roc_type {
  * @get_expected_throughput: extract the expected throughput towards the
  *	specified station. The returned value is expressed in Kbps. It returns 0
  *	if the RC algorithm does not have proper data to provide.
+ *
+ * @enable_dynack: Enable ack timeout estimation algorithm
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3041,6 +3043,8 @@ struct ieee80211_ops {
 	int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 	void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 	u32 (*get_expected_throughput)(struct ieee80211_sta *sta);
+
+	int (*enable_dynack)(struct ieee80211_hw *hw);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 927b4ea..cb7c514 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3481,6 +3481,13 @@ static int ieee80211_set_ap_chanwidth(struct wiphy *wiphy,
 	return ret;
 }
 
+static int ieee80211_enable_dynack(struct wiphy *wiphy)
+{
+	struct ieee80211_local *local = wiphy_priv(wiphy);
+
+	return drv_enable_dynack(local);
+}
+
 const struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
@@ -3557,4 +3564,5 @@ const struct cfg80211_ops mac80211_config_ops = {
 	.channel_switch = ieee80211_channel_switch,
 	.set_qos_map = ieee80211_set_qos_map,
 	.set_ap_chanwidth = ieee80211_set_ap_chanwidth,
+	.enable_dynack = ieee80211_enable_dynack,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 1142395..5968c00 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1238,4 +1238,18 @@ static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,
 	return ret;
 }
 
+static inline int drv_enable_dynack(struct ieee80211_local *local)
+{
+	int ret = -EOPNOTSUPP;
+
+	might_sleep();
+
+	trace_drv_enable_dynack(local);
+	if (local->ops->enable_dynack)
+		ret = local->ops->enable_dynack(&local->hw);
+	trace_drv_return_int(local, ret);
+
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 02ac535..7523eee 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1623,6 +1623,11 @@ TRACE_EVENT(drv_get_expected_throughput,
 	)
 );
 
+DEFINE_EVENT(local_only_evt, drv_enable_dynack,
+	TP_PROTO(struct ieee80211_local *local),
+	TP_ARGS(local)
+);
+
 /*
  * Tracing for API calls that drivers call.
  */
-- 
1.9.1

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