From 851d1d800731898927c9eff7b9e1b87c1f98cadf Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 20 Jan 2012 13:55:26 +0100 Subject: [PATCH] --- yaml --- r: 290340 b: refs/heads/master c: 4c0c0b75e0c35ddb8f61c06bcbffede63ab4f4a2 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/net/cfg80211.h | 14 ++++++++++++++ trunk/net/wireless/core.h | 5 ----- trunk/net/wireless/scan.c | 12 ++++++++++++ 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index e3ae18424b28..2eabb043c7cd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 95de817b9034d50860319f6033ec85d25024694c +refs/heads/master: 4c0c0b75e0c35ddb8f61c06bcbffede63ab4f4a2 diff --git a/trunk/include/net/cfg80211.h b/trunk/include/net/cfg80211.h index 6cfecb02a34b..229edc526cf5 100644 --- a/trunk/include/net/cfg80211.h +++ b/trunk/include/net/cfg80211.h @@ -2719,6 +2719,20 @@ struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy, 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); /** diff --git a/trunk/net/wireless/core.h b/trunk/net/wireless/core.h index 2b454caf4395..3ac2dd00d714 100644 --- a/trunk/net/wireless/core.h +++ b/trunk/net/wireless/core.h @@ -144,11 +144,6 @@ static inline struct cfg80211_internal_bss *bss_from_pub(struct cfg80211_bss *pu 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); diff --git a/trunk/net/wireless/scan.c b/trunk/net/wireless/scan.c index 31119e32e092..afde7e5f0010 100644 --- a/trunk/net/wireless/scan.c +++ b/trunk/net/wireless/scan.c @@ -861,6 +861,18 @@ cfg80211_inform_bss_frame(struct wiphy *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;