Commit 0e3a39b5 authored by Ben Greear's avatar Ben Greear Committed by Johannes Berg

wireless: add comments about bss refcounting

Should help the next person that tries to understand
the bss refcounting logic.
Signed-off-by: default avatarBen Greear <greearb@candelatech.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 6f390908
...@@ -523,6 +523,7 @@ static int cmp_bss(struct cfg80211_bss *a, ...@@ -523,6 +523,7 @@ static int cmp_bss(struct cfg80211_bss *a,
} }
} }
/* Returned bss is reference counted and must be cleaned up appropriately. */
struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
struct ieee80211_channel *channel, struct ieee80211_channel *channel,
const u8 *bssid, const u8 *bssid,
...@@ -678,6 +679,7 @@ static bool cfg80211_combine_bsses(struct cfg80211_registered_device *dev, ...@@ -678,6 +679,7 @@ static bool cfg80211_combine_bsses(struct cfg80211_registered_device *dev,
return true; return true;
} }
/* Returned bss is reference counted and must be cleaned up appropriately. */
static struct cfg80211_internal_bss * static struct cfg80211_internal_bss *
cfg80211_bss_update(struct cfg80211_registered_device *dev, cfg80211_bss_update(struct cfg80211_registered_device *dev,
struct cfg80211_internal_bss *tmp) struct cfg80211_internal_bss *tmp)
...@@ -866,6 +868,7 @@ cfg80211_get_bss_channel(struct wiphy *wiphy, const u8 *ie, size_t ielen, ...@@ -866,6 +868,7 @@ cfg80211_get_bss_channel(struct wiphy *wiphy, const u8 *ie, size_t ielen,
return channel; return channel;
} }
/* Returned bss is reference counted and must be cleaned up appropriately. */
struct cfg80211_bss* struct cfg80211_bss*
cfg80211_inform_bss(struct wiphy *wiphy, cfg80211_inform_bss(struct wiphy *wiphy,
struct ieee80211_channel *channel, struct ieee80211_channel *channel,
...@@ -923,6 +926,7 @@ cfg80211_inform_bss(struct wiphy *wiphy, ...@@ -923,6 +926,7 @@ cfg80211_inform_bss(struct wiphy *wiphy,
} }
EXPORT_SYMBOL(cfg80211_inform_bss); EXPORT_SYMBOL(cfg80211_inform_bss);
/* Returned bss is reference counted and must be cleaned up appropriately. */
struct cfg80211_bss * struct cfg80211_bss *
cfg80211_inform_bss_frame(struct wiphy *wiphy, cfg80211_inform_bss_frame(struct wiphy *wiphy,
struct ieee80211_channel *channel, struct ieee80211_channel *channel,
......
...@@ -239,6 +239,7 @@ void cfg80211_conn_work(struct work_struct *work) ...@@ -239,6 +239,7 @@ void cfg80211_conn_work(struct work_struct *work)
rtnl_unlock(); rtnl_unlock();
} }
/* Returned bss is reference counted and must be cleaned up appropriately. */
static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev) static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
{ {
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
...@@ -699,6 +700,7 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, ...@@ -699,6 +700,7 @@ void cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
} }
EXPORT_SYMBOL(cfg80211_connect_result); EXPORT_SYMBOL(cfg80211_connect_result);
/* Consumes bss object one way or another */
void __cfg80211_roamed(struct wireless_dev *wdev, void __cfg80211_roamed(struct wireless_dev *wdev,
struct cfg80211_bss *bss, struct cfg80211_bss *bss,
const u8 *req_ie, size_t req_ie_len, const u8 *req_ie, size_t req_ie_len,
...@@ -775,6 +777,7 @@ void cfg80211_roamed(struct net_device *dev, ...@@ -775,6 +777,7 @@ void cfg80211_roamed(struct net_device *dev,
} }
EXPORT_SYMBOL(cfg80211_roamed); EXPORT_SYMBOL(cfg80211_roamed);
/* Consumes bss object one way or another */
void cfg80211_roamed_bss(struct net_device *dev, void cfg80211_roamed_bss(struct net_device *dev,
struct cfg80211_bss *bss, const u8 *req_ie, struct cfg80211_bss *bss, const u8 *req_ie,
size_t req_ie_len, const u8 *resp_ie, size_t req_ie_len, const u8 *resp_ie,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment