Lines Matching defs:bss

118 static void bss_free(struct cfg80211_internal_bss *bss)
122 if (WARN_ON(atomic_read(&bss->hold)))
125 ies = (void *)rcu_access_pointer(bss->pub.beacon_ies);
126 if (ies && !bss->pub.hidden_beacon_bss)
128 ies = (void *)rcu_access_pointer(bss->pub.proberesp_ies);
136 if (!list_empty(&bss->hidden_list))
137 list_del(&bss->hidden_list);
139 kfree(bss);
143 struct cfg80211_internal_bss *bss)
147 bss->refcount++;
149 if (bss->pub.hidden_beacon_bss)
150 bss_from_pub(bss->pub.hidden_beacon_bss)->refcount++;
152 if (bss->pub.transmitted_bss)
153 bss_from_pub(bss->pub.transmitted_bss)->refcount++;
157 struct cfg80211_internal_bss *bss)
161 if (bss->pub.hidden_beacon_bss) {
164 hbss = bss_from_pub(bss->pub.hidden_beacon_bss);
170 if (bss->pub.transmitted_bss) {
173 tbss = bss_from_pub(bss->pub.transmitted_bss);
179 bss->refcount--;
180 if (bss->refcount == 0)
181 bss_free(bss);
185 struct cfg80211_internal_bss *bss)
189 if (!list_empty(&bss->hidden_list)) {
194 if (!bss->pub.hidden_beacon_bss)
200 list_del_init(&bss->hidden_list);
203 list_del_init(&bss->list);
204 list_del_init(&bss->pub.nontrans_list);
205 rb_erase(&bss->rbn, &rdev->bss_tree);
208 "rdev bss entries[%d]/list[empty:%d] corruption\n",
210 bss_ref_put(rdev, bss);
445 struct cfg80211_bss *bss = NULL;
455 list_for_each_entry(bss, &trans_bss->nontrans_list, nontrans_list) {
456 if (is_bss(bss, nontrans_bss->bssid, ssid_elem->data,
482 struct cfg80211_internal_bss *bss, *tmp;
487 list_for_each_entry_safe(bss, tmp, &rdev->bss_list, list) {
488 if (atomic_read(&bss->hold))
490 if (!time_after(expire_time, bss->ts))
493 if (__cfg80211_unlink_bss(rdev, bss))
503 struct cfg80211_internal_bss *bss, *oldest = NULL;
508 list_for_each_entry(bss, &rdev->bss_list, list) {
509 if (atomic_read(&bss->hold))
512 if (!list_empty(&bss->hidden_list) &&
513 !bss->pub.hidden_beacon_bss)
516 if (oldest && time_before(oldest->ts, bss->ts))
518 oldest = bss;
697 /* TBTT info must include bss param + BSSID +
1279 struct cfg80211_internal_bss *bss;
1283 list_for_each_entry(bss, &rdev->bss_list, list)
1284 bss->ts -= age_jiffies;
1500 /* Returned bss is reference counted and must be cleaned up appropriately. */
1509 struct cfg80211_internal_bss *bss, *res = NULL;
1518 list_for_each_entry(bss, &rdev->bss_list, list) {
1519 if (!cfg80211_bss_type_match(bss->pub.capability,
1520 bss->pub.channel->band, bss_type))
1523 bss_privacy = (bss->pub.capability & WLAN_CAPABILITY_PRIVACY);
1527 if (channel && bss->pub.channel != channel)
1529 if (!is_valid_ether_addr(bss->pub.bssid))
1532 if (time_after(now, bss->ts + IEEE80211_SCAN_RESULT_EXPIRE) &&
1533 !atomic_read(&bss->hold))
1535 if (is_bss(&bss->pub, bssid, ssid, ssid_len)) {
1536 res = bss;
1551 struct cfg80211_internal_bss *bss)
1562 cmp = cmp_bss(&bss->pub, &tbss->pub, BSS_CMP_REGULAR);
1575 rb_link_node(&bss->rbn, parent, p);
1576 rb_insert_color(&bss->rbn, &rdev->bss_tree);
1585 struct cfg80211_internal_bss *bss;
1589 bss = rb_entry(n, struct cfg80211_internal_bss, rbn);
1590 r = cmp_bss(&res->pub, &bss->pub, mode);
1593 return bss;
1607 struct cfg80211_internal_bss *bss;
1634 list_for_each_entry(bss, &rdev->bss_list, list) {
1641 if (!ether_addr_equal(bss->pub.bssid, new->pub.bssid))
1643 if (bss->pub.channel != new->pub.channel)
1645 if (bss->pub.scan_width != new->pub.scan_width)
1647 if (rcu_access_pointer(bss->pub.beacon_ies))
1649 ies = rcu_access_pointer(bss->pub.ies);
1657 if (WARN_ON_ONCE(bss->pub.hidden_beacon_bss))
1659 if (WARN_ON_ONCE(!list_empty(&bss->hidden_list)))
1660 list_del(&bss->hidden_list);
1662 list_add(&bss->hidden_list, &new->hidden_list);
1663 bss->pub.hidden_beacon_bss = &new->pub;
1664 new->refcount += bss->refcount;
1665 rcu_assign_pointer(bss->pub.beacon_ies,
1670 "rdev bss entries[%d]/list[len:%d] corruption\n",
1680 struct cfg80211_internal_bss *bss;
1683 list_for_each_entry(bss, &known->hidden_list, hidden_list) {
1686 ies = rcu_access_pointer(bss->pub.beacon_ies);
1689 rcu_assign_pointer(bss->pub.beacon_ies, new_ies);
1724 * bss is used). This can only mean that the
1772 /* Returned bss is reference counted and must be cleaned up appropriately. */
2029 /* Returned bss is reference counted and must be cleaned up appropriately. */
2135 /* this is a nontransmitting bss, we need to add it to
2136 * transmitting bss' list if it is not there
2249 struct cfg80211_bss *bss;
2340 bss = cfg80211_inform_single_bss_data(wiphy, &data, gfp);
2341 if (!bss)
2343 cfg80211_put_bss(wiphy, bss);
2593 struct cfg80211_bss *bss;
2723 bss = cfg80211_inform_single_bss_data(wiphy, &data, gfp);
2724 if (!bss)
2726 cfg80211_put_bss(wiphy, bss);
2951 /* process each non-transmitting bss */
2989 struct cfg80211_internal_bss *bss, *tmp1;
2995 bss = bss_from_pub(pub);
2998 if (list_empty(&bss->list))
3009 if (__cfg80211_unlink_bss(rdev, bss))
3019 struct cfg80211_bss *bss,
3024 struct cfg80211_internal_bss *bss;
3028 list_for_each_entry(bss, &rdev->bss_list, list) {
3029 if (!chandef || cfg80211_is_sub_chan(chandef, bss->pub.channel,
3031 iter(wiphy, &bss->pub, iter_data);
3046 struct cfg80211_internal_bss *bss;
3059 /* use transmitting bss */
3065 list_for_each_entry(bss, &rdev->bss_list, list) {
3066 if (!cfg80211_bss_type_match(bss->pub.capability,
3067 bss->pub.channel->band,
3071 if (bss == cbss)
3074 if (!cmp_bss(&bss->pub, &cbss->pub, BSS_CMP_REGULAR)) {
3075 new = bss;
3081 /* to save time, update IEs for transmitting bss only */
3090 bss = bss_from_pub(nontrans_bss);
3091 if (__cfg80211_unlink_bss(rdev, bss))
3107 bss = bss_from_pub(nontrans_bss);
3108 bss->pub.channel = chan;
3109 rb_erase(&bss->rbn, &rdev->bss_tree);
3110 rb_insert_bss(rdev, bss);
3322 struct cfg80211_internal_bss *bss, char *current_ev,
3336 memcpy(iwe.u.ap_addr.sa_data, bss->pub.bssid, ETH_ALEN);
3344 iwe.u.freq.m = ieee80211_frequency_to_channel(bss->pub.channel->center_freq);
3353 iwe.u.freq.m = bss->pub.channel->center_freq;
3368 sig = bss->pub.signal / 100;
3379 iwe.u.qual.level = bss->pub.signal;
3381 iwe.u.qual.qual = bss->pub.signal;
3396 if (bss->pub.capability & WLAN_CAPABILITY_PRIVACY)
3407 ies = rcu_dereference(bss->pub.ies);
3537 if (bss->pub.capability & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS) ||
3543 else if (bss->pub.capability & WLAN_CAPABILITY_ESS)
3565 elapsed_jiffies_msecs(bss->ts));
3586 struct cfg80211_internal_bss *bss;
3592 list_for_each_entry(bss, &rdev->bss_list, list) {
3597 current_ev = ieee80211_bss(&rdev->wiphy, info, bss,