cfg80211: export cfg80211_ref_bss
authorJohannes Berg <johannes.berg@intel.com>
Fri, 20 Jan 2012 12:55:26 +0000 (13:55 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 6 Feb 2012 19:50:37 +0000 (14:50 -0500)
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>
include/net/cfg80211.h
net/wireless/core.h
net/wireless/scan.c

index 6cfecb02a34bf0c9896ad6d151a4c45eee756ecc..229edc526cf5059c18954b6a6f76416b55249bb6 100644 (file)
@@ -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);
 
 /**
index 2b454caf4395ae4b8601477236708881a1957146..3ac2dd00d7149b123db51463b449a112a2d1b908 100644 (file)
@@ -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);
index 31119e32e092b6e2615a8653c768a5cd7531465b..afde7e5f001057d84f8528dbd85ebc16c08bf92b 100644 (file)
@@ -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;