From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Subject: [RFC/RFT 2/3] cfg80211: export cfg80211_ref_bss
Date: Tue, 10 Jan 2012 16:30:50 +0100 [thread overview]
Message-ID: <20120110153239.983642800@sipsolutions.net> (raw)
In-Reply-To: 20120110153048.612308160@sipsolutions.net
From: Johannes Berg <johannes.berg@intel.com>
This is needed by mac80211 to keep a reference
to a BSS alive for the auth process. Remove the
old version of cfg80211_ref_bss() since it's
not actually used.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
include/net/cfg80211.h | 14 ++++++++++++++
net/wireless/core.h | 5 -----
net/wireless/scan.c | 12 ++++++++++++
3 files changed, 26 insertions(+), 5 deletions(-)
--- a/include/net/cfg80211.h 2012-01-09 13:57:47.000000000 +0100
+++ b/include/net/cfg80211.h 2012-01-09 14:40:09.000000000 +0100
@@ -2709,6 +2709,20 @@ struct cfg80211_bss *cfg80211_get_mesh(s
struct ieee80211_channel *channel,
const u8 *meshid, size_t meshidlen,
const u8 *meshcfg);
+/**
+ * cfg80211_ref_bss - reference BSS struct
+ * @bss: the BSS struct to reference
+ *
+ * Increments the refcount of the given BSS struct.
+ */
+void cfg80211_ref_bss(struct cfg80211_bss *bss);
+
+/**
+ * cfg80211_put_bss - unref BSS struct
+ * @bss: the BSS struct
+ *
+ * Decrements the refcount of the given BSS struct.
+ */
void cfg80211_put_bss(struct cfg80211_bss *bss);
/**
--- a/net/wireless/core.h 2012-01-09 13:57:47.000000000 +0100
+++ b/net/wireless/core.h 2012-01-09 14:41:13.000000000 +0100
@@ -144,11 +144,6 @@ static inline struct cfg80211_internal_b
return container_of(pub, struct cfg80211_internal_bss, pub);
}
-static inline void cfg80211_ref_bss(struct cfg80211_internal_bss *bss)
-{
- kref_get(&bss->ref);
-}
-
static inline void cfg80211_hold_bss(struct cfg80211_internal_bss *bss)
{
atomic_inc(&bss->hold);
--- a/net/wireless/scan.c 2012-01-09 12:40:53.000000000 +0100
+++ b/net/wireless/scan.c 2012-01-09 14:40:58.000000000 +0100
@@ -861,6 +861,18 @@ cfg80211_inform_bss_frame(struct wiphy *
}
EXPORT_SYMBOL(cfg80211_inform_bss_frame);
+void cfg80211_ref_bss(struct cfg80211_bss *pub)
+{
+ struct cfg80211_internal_bss *bss;
+
+ if (!pub)
+ return;
+
+ bss = container_of(pub, struct cfg80211_internal_bss, pub);
+ kref_get(&bss->ref);
+}
+EXPORT_SYMBOL(cfg80211_ref_bss);
+
void cfg80211_put_bss(struct cfg80211_bss *pub)
{
struct cfg80211_internal_bss *bss;
next prev parent reply other threads:[~2012-01-10 15:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-10 15:30 [RFC/RFT 0/3] auth/assoc redesign Johannes Berg
2012-01-10 15:30 ` [RFC/RFT 1/3] cfg80211: stop tracking authenticated state Johannes Berg
2012-01-10 15:30 ` Johannes Berg [this message]
2012-01-10 15:30 ` [RFC/RFT 3/3] mac80211: redesign auth/assoc Johannes Berg
2012-01-10 15:34 ` [RFC/RFT 0/3] auth/assoc redesign Johannes Berg
2012-01-11 13:15 ` 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=20120110153239.983642800@sipsolutions.net \
--to=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 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).