linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Olav Haugan <ohaugan@codeaurora.org>
To: johannes@sipsolutions.net, linux-wireless@vger.kernel.org
Cc: davem@davemloft.net, kvalo@codeaurora.org,
	ath9k-devel@qca.qualcomm.com,
	Olav Haugan <ohaugan@codeaurora.org>
Subject: [PATCH 1/2] mac80211: add support to set_coalesce
Date: Sat, 24 Oct 2015 11:50:51 -0700	[thread overview]
Message-ID: <1445712652-19327-1-git-send-email-ohaugan@codeaurora.org> (raw)

Add ops in mac80211 and corresponding driver calls.
Add trace event for set_coalesce.

Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
---
 include/net/mac80211.h    |  4 ++++
 net/mac80211/cfg.c        |  9 +++++++++
 net/mac80211/driver-ops.h | 12 ++++++++++++
 net/mac80211/trace.h      |  5 +++++
 4 files changed, 30 insertions(+)

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index bfc5694..8bd7ccb 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3232,6 +3232,8 @@ enum ieee80211_reconfig_type {
  *	the function call.
  *
  * @wake_tx_queue: Called when new packets have been added to the queue.
+ *
+ * @set_coalesce: Set coalesce parameters.
  */
 struct ieee80211_ops {
 	void (*tx)(struct ieee80211_hw *hw,
@@ -3467,6 +3469,8 @@ struct ieee80211_ops {
 
 	void (*wake_tx_queue)(struct ieee80211_hw *hw,
 			      struct ieee80211_txq *txq);
+	int (*set_coalesce)(struct ieee80211_hw *hw,
+			    struct cfg80211_coalesce *coalesce);
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7a77a14..affd8ab 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3810,6 +3810,14 @@ static int ieee80211_del_tx_ts(struct wiphy *wiphy, struct net_device *dev,
 	return -ENOENT;
 }
 
+static int ieee80211_set_coalesce(struct wiphy *wiphy,
+				  struct cfg80211_coalesce *coalesce)
+{
+	struct ieee80211_local *local = wiphy_priv(wiphy);
+
+	return drv_set_coalesce(local, coalesce);
+}
+
 const struct cfg80211_ops mac80211_config_ops = {
 	.add_virtual_intf = ieee80211_add_iface,
 	.del_virtual_intf = ieee80211_del_iface,
@@ -3894,4 +3902,5 @@ const struct cfg80211_ops mac80211_config_ops = {
 	.set_ap_chanwidth = ieee80211_set_ap_chanwidth,
 	.add_tx_ts = ieee80211_add_tx_ts,
 	.del_tx_ts = ieee80211_del_tx_ts,
+	.set_coalesce = ieee80211_set_coalesce,
 };
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 02d9133..49856e1 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1355,4 +1355,16 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
 	local->ops->wake_tx_queue(&local->hw, &txq->txq);
 }
 
+static inline int drv_set_coalesce(struct ieee80211_local *local,
+				   struct cfg80211_coalesce *coalesce)
+{
+	u32 ret = 0;
+
+	trace_drv_set_coalesce(local);
+	if (local->ops->set_coalesce)
+		ret = local->ops->set_coalesce(&local->hw, coalesce);
+	trace_drv_return_u32(local, ret);
+	return ret;
+}
+
 #endif /* __MAC80211_DRIVER_OPS */
diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h
index 6f14591..ff1173b 100644
--- a/net/mac80211/trace.h
+++ b/net/mac80211/trace.h
@@ -1655,6 +1655,11 @@ TRACE_EVENT(drv_get_expected_throughput,
 	)
 );
 
+DEFINE_EVENT(local_only_evt, drv_set_coalesce,
+	     TP_PROTO(struct ieee80211_local *local),
+	     TP_ARGS(local)
+);
+
 /*
  * Tracing for API calls that drivers call.
  */
-- 
2.6.1


             reply	other threads:[~2015-10-24 18:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-24 18:50 Olav Haugan [this message]
2015-10-24 18:50 ` [PATCH 2/2] ath9k: implement set_coalesce callback Olav Haugan
2015-10-30 10:00   ` Johannes Berg
2015-11-23  4:12     ` Olav Haugan
2015-11-23  8:52       ` Johannes Berg
2015-10-30  9:59 ` [PATCH 1/2] mac80211: add support to set_coalesce Johannes Berg
2015-11-23  4:02   ` Olav Haugan
  -- strict thread matches above, loose matches on Subject: below --
2015-10-24 18:49 Olav Haugan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445712652-19327-1-git-send-email-ohaugan@codeaurora.org \
    --to=ohaugan@codeaurora.org \
    --cc=ath9k-devel@qca.qualcomm.com \
    --cc=davem@davemloft.net \
    --cc=johannes@sipsolutions.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).