aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-01-20 07:55:26 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:50:37 -0500
commit4c0c0b75e0c35ddb8f61c06bcbffede63ab4f4a2 (patch)
tree5d3ee488424ac02ef06330ebff3e5de6e5058941
parent95de817b9034d50860319f6033ec85d25024694c (diff)
cfg80211: export cfg80211_ref_bss
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/cfg80211.h14
-rw-r--r--net/wireless/core.h5
-rw-r--r--net/wireless/scan.c12
3 files changed, 26 insertions, 5 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 6cfecb02a34b..229edc526cf5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -2719,6 +2719,20 @@ struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
2719 struct ieee80211_channel *channel, 2719 struct ieee80211_channel *channel,
2720 const u8 *meshid, size_t meshidlen, 2720 const u8 *meshid, size_t meshidlen,
2721 const u8 *meshcfg); 2721 const u8 *meshcfg);
2722/**
2723 * cfg80211_ref_bss - reference BSS struct
2724 * @bss: the BSS struct to reference
2725 *
2726 * Increments the refcount of the given BSS struct.
2727 */
2728void cfg80211_ref_bss(struct cfg80211_bss *bss);
2729
2730/**
2731 * cfg80211_put_bss - unref BSS struct
2732 * @bss: the BSS struct
2733 *
2734 * Decrements the refcount of the given BSS struct.
2735 */
2722void cfg80211_put_bss(struct cfg80211_bss *bss); 2736void cfg80211_put_bss(struct cfg80211_bss *bss);
2723 2737
2724/** 2738/**
diff --git a/net/wireless/core.h b/net/wireless/core.h
index 2b454caf4395..3ac2dd00d714 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -144,11 +144,6 @@ static inline struct cfg80211_internal_bss *bss_from_pub(struct cfg80211_bss *pu
144 return container_of(pub, struct cfg80211_internal_bss, pub); 144 return container_of(pub, struct cfg80211_internal_bss, pub);
145} 145}
146 146
147static inline void cfg80211_ref_bss(struct cfg80211_internal_bss *bss)
148{
149 kref_get(&bss->ref);
150}
151
152static inline void cfg80211_hold_bss(struct cfg80211_internal_bss *bss) 147static inline void cfg80211_hold_bss(struct cfg80211_internal_bss *bss)
153{ 148{
154 atomic_inc(&bss->hold); 149 atomic_inc(&bss->hold);
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 31119e32e092..afde7e5f0010 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -861,6 +861,18 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
861} 861}
862EXPORT_SYMBOL(cfg80211_inform_bss_frame); 862EXPORT_SYMBOL(cfg80211_inform_bss_frame);
863 863
864void cfg80211_ref_bss(struct cfg80211_bss *pub)
865{
866 struct cfg80211_internal_bss *bss;
867
868 if (!pub)
869 return;
870
871 bss = container_of(pub, struct cfg80211_internal_bss, pub);
872 kref_get(&bss->ref);
873}
874EXPORT_SYMBOL(cfg80211_ref_bss);
875
864void cfg80211_put_bss(struct cfg80211_bss *pub) 876void cfg80211_put_bss(struct cfg80211_bss *pub)
865{ 877{
866 struct cfg80211_internal_bss *bss; 878 struct cfg80211_internal_bss *bss;