Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136188
b: refs/heads/master
c: a08c1c1
h: refs/heads/master
v: v3
  • Loading branch information
Kalle Valo authored and John W. Linville committed Mar 28, 2009
1 parent 3ca07a4 commit 3aede72
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9050bdd8589c373e01e41ddbd9a192de2ff01ef0
refs/heads/master: a08c1c1ac0c26229ca1ca45d554b209a56edc8be
18 changes: 18 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ enum cfg80211_signal_type {
* is no guarantee that these are well-formed!)
* @len_information_elements: total length of the information elements
* @signal: signal strength value (type depends on the wiphy's signal_type)
* @hold: BSS should not expire
* @free_priv: function pointer to free private data
* @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
*/
Expand Down Expand Up @@ -940,4 +941,21 @@ void cfg80211_send_rx_deauth(struct net_device *dev, const u8 *buf,
void cfg80211_send_rx_disassoc(struct net_device *dev, const u8 *buf,
size_t len);

/**
* cfg80211_hold_bss - exclude bss from expiration
* @bss: bss which should not expire
*
* In a case when the BSS is not updated but it shouldn't expire this
* function can be used to mark the BSS to be excluded from expiration.
*/
void cfg80211_hold_bss(struct cfg80211_bss *bss);

/**
* cfg80211_unhold_bss - remove expiration exception from the BSS
* @bss: bss which can expire again
*
* This function marks the BSS to be expirable again.
*/
void cfg80211_unhold_bss(struct cfg80211_bss *bss);

#endif /* __NET_CFG80211_H */
2 changes: 2 additions & 0 deletions trunk/net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ struct cfg80211_internal_bss {
struct rb_node rbn;
unsigned long ts;
struct kref ref;
bool hold;

/* must be last because of priv member */
struct cfg80211_bss pub;
};
Expand Down
27 changes: 26 additions & 1 deletion trunk/net/wireless/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ void cfg80211_bss_expire(struct cfg80211_registered_device *dev)
bool expired = false;

list_for_each_entry_safe(bss, tmp, &dev->bss_list, list) {
if (!time_after(jiffies, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE))
if (bss->hold ||
!time_after(jiffies, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE))
continue;
list_del(&bss->list);
rb_erase(&bss->rbn, &dev->bss_tree);
Expand Down Expand Up @@ -471,6 +472,30 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *pub)
}
EXPORT_SYMBOL(cfg80211_unlink_bss);

void cfg80211_hold_bss(struct cfg80211_bss *pub)
{
struct cfg80211_internal_bss *bss;

if (!pub)
return;

bss = container_of(pub, struct cfg80211_internal_bss, pub);
bss->hold = true;
}
EXPORT_SYMBOL(cfg80211_hold_bss);

void cfg80211_unhold_bss(struct cfg80211_bss *pub)
{
struct cfg80211_internal_bss *bss;

if (!pub)
return;

bss = container_of(pub, struct cfg80211_internal_bss, pub);
bss->hold = false;
}
EXPORT_SYMBOL(cfg80211_unhold_bss);

#ifdef CONFIG_WIRELESS_EXT
int cfg80211_wext_siwscan(struct net_device *dev,
struct iw_request_info *info,
Expand Down

0 comments on commit 3aede72

Please sign in to comment.