From: Thomas Pedersen <thomas@cozybit.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wirelss <linux-wireless@vger.kernel.org>,
open80211s <devel@lists.open80211s.org>,
Thomas Pedersen <thomas@cozybit.com>
Subject: [PATCH 3/6] mac80211: ieee80211_queue_stopped returns reasons
Date: Mon, 8 Apr 2013 11:06:14 -0700 [thread overview]
Message-ID: <1365444377-9959-3-git-send-email-thomas@cozybit.com> (raw)
In-Reply-To: <1365444377-9959-1-git-send-email-thomas@cozybit.com>
Have ieee80211_queue_stopped() return a bitmap of enum
queue_stop_reasons while checking queue status. This is
handy when we care about the queue stop reason codes.
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
include/net/mac80211.h | 10 +++++++---
net/mac80211/util.c | 8 ++++----
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 64faf01..8bbe799 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3589,15 +3589,19 @@ void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
/**
* ieee80211_queue_stopped - test status of the queue
+ *
* @hw: pointer as obtained from ieee80211_alloc_hw().
* @queue: queue number (counted from zero).
*
* Drivers should use this function instead of netif_stop_queue.
*
- * Return: %true if the queue is stopped. %false otherwise.
+ * Return 0 if queue not stopped, or else a bitmap of
+ * queue_stop_reasons.
+ *
+ * If @queue doesn't exist, return -1UL.
+ *
*/
-
-int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue);
+unsigned long ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue);
/**
* ieee80211_stop_queues - stop all queues
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 447e665..739cddb 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -475,17 +475,17 @@ void ieee80211_stop_queues(struct ieee80211_hw *hw)
}
EXPORT_SYMBOL(ieee80211_stop_queues);
-int ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue)
+unsigned long ieee80211_queue_stopped(struct ieee80211_hw *hw, int queue)
{
struct ieee80211_local *local = hw_to_local(hw);
unsigned long flags;
- int ret;
+ unsigned long ret;
if (WARN_ON(queue >= hw->queues))
- return true;
+ return -1UL;
spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
- ret = !!local->queue_stop_reasons[queue];
+ ret = local->queue_stop_reasons[queue];
spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
return ret;
}
--
1.7.10.4
next prev parent reply other threads:[~2013-04-08 18:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 18:06 [PATCH 1/6] mac80211: unset FC retry bit in mesh fwding path Thomas Pedersen
2013-04-08 18:06 ` [PATCH 2/6] mac80211: exclude multicast frames from BA accounting Thomas Pedersen
2013-04-09 9:47 ` Johannes Berg
2013-04-10 22:15 ` Thomas Pedersen
2013-04-08 18:06 ` Thomas Pedersen [this message]
2013-04-08 18:32 ` [PATCH 3/6] mac80211: ieee80211_queue_stopped returns reasons Antonio Quartulli
2013-04-08 18:37 ` Johannes Berg
2013-04-08 19:30 ` Thomas Pedersen
2013-04-08 19:38 ` Johannes Berg
2013-04-08 19:57 ` Thomas Pedersen
2013-04-09 9:37 ` Johannes Berg
2013-04-10 17:36 ` Thomas Pedersen
2013-04-10 18:16 ` Johannes Berg
2013-04-08 18:06 ` [PATCH 4/6] mac80211: limit mesh forwarding drops Thomas Pedersen
2013-04-08 18:06 ` [PATCH 5/6] mac80211: stringify another plink state Thomas Pedersen
2013-04-09 9:48 ` Johannes Berg
2013-04-08 18:06 ` [PATCH 6/6] mac80211: avoid mesh peer rate update warning Thomas Pedersen
2013-04-09 9:38 ` Johannes Berg
2013-04-09 9:42 ` Johannes Berg
2013-04-10 17:38 ` Thomas Pedersen
[not found] ` <1782507887.154.1365455855469.JavaMail.mail@webmail12>
2013-04-08 21:27 ` [PATCH 5/6] mac80211: stringify another plink state Joe Perches
2013-04-08 22:19 ` Joe Perches
2013-04-09 9:39 ` [PATCH 1/6] mac80211: unset FC retry bit in mesh fwding path Johannes Berg
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=1365444377-9959-3-git-send-email-thomas@cozybit.com \
--to=thomas@cozybit.com \
--cc=devel@lists.open80211s.org \
--cc=johannes@sipsolutions.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.