• Home
  • Raw
  • Download

Lines Matching refs:bss

38 static void wpa_bss_remove(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)  in wpa_bss_remove()  argument
40 dl_list_del(&bss->list); in wpa_bss_remove()
41 dl_list_del(&bss->list_id); in wpa_bss_remove()
44 " SSID '%s'", bss->id, MAC2STR(bss->bssid), in wpa_bss_remove()
45 wpa_ssid_txt(bss->ssid, bss->ssid_len)); in wpa_bss_remove()
46 wpas_notify_bss_removed(wpa_s, bss->bssid, bss->id); in wpa_bss_remove()
48 wpabuf_free(bss->anqp_venue_name); in wpa_bss_remove()
49 wpabuf_free(bss->anqp_network_auth_type); in wpa_bss_remove()
50 wpabuf_free(bss->anqp_roaming_consortium); in wpa_bss_remove()
51 wpabuf_free(bss->anqp_ip_addr_type_availability); in wpa_bss_remove()
52 wpabuf_free(bss->anqp_nai_realm); in wpa_bss_remove()
53 wpabuf_free(bss->anqp_3gpp); in wpa_bss_remove()
54 wpabuf_free(bss->anqp_domain_name); in wpa_bss_remove()
56 os_free(bss); in wpa_bss_remove()
63 struct wpa_bss *bss; in wpa_bss_get() local
64 dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_get()
65 if (os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0 && in wpa_bss_get()
66 bss->ssid_len == ssid_len && in wpa_bss_get()
67 os_memcmp(bss->ssid, ssid, ssid_len) == 0) in wpa_bss_get()
68 return bss; in wpa_bss_get()
99 static int wpa_bss_known(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) in wpa_bss_known() argument
106 if (ssid->ssid_len == bss->ssid_len && in wpa_bss_known()
107 os_memcmp(ssid->ssid, bss->ssid, ssid->ssid_len) == 0) in wpa_bss_known()
117 struct wpa_bss *bss; in wpa_bss_remove_oldest_unknown() local
119 dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_remove_oldest_unknown()
120 if (!wpa_bss_known(wpa_s, bss)) { in wpa_bss_remove_oldest_unknown()
121 wpa_bss_remove(wpa_s, bss); in wpa_bss_remove_oldest_unknown()
143 wpa_bss_remove(wpa_s, dl_list_first(&wpa_s->bss, in wpa_bss_remove_oldest()
152 struct wpa_bss *bss; in wpa_bss_add() local
154 bss = os_zalloc(sizeof(*bss) + res->ie_len + res->beacon_ie_len); in wpa_bss_add()
155 if (bss == NULL) in wpa_bss_add()
157 bss->id = wpa_s->bss_next_id++; in wpa_bss_add()
158 bss->last_update_idx = wpa_s->bss_update_idx; in wpa_bss_add()
159 wpa_bss_copy_res(bss, res); in wpa_bss_add()
160 os_memcpy(bss->ssid, ssid, ssid_len); in wpa_bss_add()
161 bss->ssid_len = ssid_len; in wpa_bss_add()
162 bss->ie_len = res->ie_len; in wpa_bss_add()
163 bss->beacon_ie_len = res->beacon_ie_len; in wpa_bss_add()
164 os_memcpy(bss + 1, res + 1, res->ie_len + res->beacon_ie_len); in wpa_bss_add()
166 dl_list_add_tail(&wpa_s->bss, &bss->list); in wpa_bss_add()
167 dl_list_add_tail(&wpa_s->bss_id, &bss->list_id); in wpa_bss_add()
171 bss->id, MAC2STR(bss->bssid), wpa_ssid_txt(ssid, ssid_len)); in wpa_bss_add()
172 wpas_notify_bss_added(wpa_s, bss->bssid, bss->id); in wpa_bss_add()
275 const struct wpa_bss *bss) in notify_bss_changes() argument
278 wpas_notify_bss_freq_changed(wpa_s, bss->id); in notify_bss_changes()
281 wpas_notify_bss_signal_changed(wpa_s, bss->id); in notify_bss_changes()
284 wpas_notify_bss_privacy_changed(wpa_s, bss->id); in notify_bss_changes()
287 wpas_notify_bss_mode_changed(wpa_s, bss->id); in notify_bss_changes()
290 wpas_notify_bss_wpaie_changed(wpa_s, bss->id); in notify_bss_changes()
293 wpas_notify_bss_rsnie_changed(wpa_s, bss->id); in notify_bss_changes()
296 wpas_notify_bss_wps_changed(wpa_s, bss->id); in notify_bss_changes()
299 wpas_notify_bss_ies_changed(wpa_s, bss->id); in notify_bss_changes()
302 wpas_notify_bss_rates_changed(wpa_s, bss->id); in notify_bss_changes()
306 static void wpa_bss_update(struct wpa_supplicant *wpa_s, struct wpa_bss *bss, in wpa_bss_update() argument
311 changes = wpa_bss_compare_res(bss, res); in wpa_bss_update()
312 bss->scan_miss_count = 0; in wpa_bss_update()
313 bss->last_update_idx = wpa_s->bss_update_idx; in wpa_bss_update()
314 wpa_bss_copy_res(bss, res); in wpa_bss_update()
316 dl_list_del(&bss->list); in wpa_bss_update()
317 if (bss->ie_len + bss->beacon_ie_len >= in wpa_bss_update()
319 os_memcpy(bss + 1, res + 1, res->ie_len + res->beacon_ie_len); in wpa_bss_update()
320 bss->ie_len = res->ie_len; in wpa_bss_update()
321 bss->beacon_ie_len = res->beacon_ie_len; in wpa_bss_update()
324 struct dl_list *prev = bss->list_id.prev; in wpa_bss_update()
325 dl_list_del(&bss->list_id); in wpa_bss_update()
326 nbss = os_realloc(bss, sizeof(*bss) + res->ie_len + in wpa_bss_update()
329 bss = nbss; in wpa_bss_update()
330 os_memcpy(bss + 1, res + 1, in wpa_bss_update()
332 bss->ie_len = res->ie_len; in wpa_bss_update()
333 bss->beacon_ie_len = res->beacon_ie_len; in wpa_bss_update()
335 dl_list_add(prev, &bss->list_id); in wpa_bss_update()
337 dl_list_add_tail(&wpa_s->bss, &bss->list); in wpa_bss_update()
339 notify_bss_changes(wpa_s, changes, bss); in wpa_bss_update()
343 static int wpa_bss_in_use(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) in wpa_bss_in_use() argument
345 return bss == wpa_s->current_bss || in wpa_bss_in_use()
346 os_memcmp(bss->bssid, wpa_s->bssid, ETH_ALEN) == 0 || in wpa_bss_in_use()
347 os_memcmp(bss->bssid, wpa_s->pending_bssid, ETH_ALEN) == 0; in wpa_bss_in_use()
363 struct wpa_bss *bss; in wpa_bss_update_scan_res() local
384 bss = wpa_bss_get(wpa_s, res->bssid, ssid + 2, ssid[1]); in wpa_bss_update_scan_res()
385 if (bss == NULL) in wpa_bss_update_scan_res()
388 wpa_bss_update(wpa_s, bss, res); in wpa_bss_update_scan_res()
392 static int wpa_bss_included_in_scan(const struct wpa_bss *bss, in wpa_bss_included_in_scan() argument
404 if (bss->freq == info->freqs[i]) { in wpa_bss_included_in_scan()
418 (s->ssid_len == bss->ssid_len && in wpa_bss_included_in_scan()
419 os_memcmp(s->ssid, bss->ssid, bss->ssid_len) == in wpa_bss_included_in_scan()
436 struct wpa_bss *bss, *n; in wpa_bss_update_end() local
441 dl_list_for_each_safe(bss, n, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_update_end()
442 if (wpa_bss_in_use(wpa_s, bss)) in wpa_bss_update_end()
444 if (!wpa_bss_included_in_scan(bss, info)) in wpa_bss_update_end()
446 if (bss->last_update_idx < wpa_s->bss_update_idx) in wpa_bss_update_end()
447 bss->scan_miss_count++; in wpa_bss_update_end()
448 if (bss->scan_miss_count >= in wpa_bss_update_end()
451 "no match in scan", bss->id); in wpa_bss_update_end()
452 wpa_bss_remove(wpa_s, bss); in wpa_bss_update_end()
460 struct wpa_bss *bss, *n; in wpa_bss_flush_by_age() local
463 if (dl_list_empty(&wpa_s->bss)) in wpa_bss_flush_by_age()
469 dl_list_for_each_safe(bss, n, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_flush_by_age()
470 if (wpa_bss_in_use(wpa_s, bss)) in wpa_bss_flush_by_age()
473 if (os_time_before(&bss->last_update, &t)) { in wpa_bss_flush_by_age()
475 "age", bss->id); in wpa_bss_flush_by_age()
476 wpa_bss_remove(wpa_s, bss); in wpa_bss_flush_by_age()
495 dl_list_init(&wpa_s->bss); in wpa_bss_init()
505 struct wpa_bss *bss, *n; in wpa_bss_flush() local
507 if (wpa_s->bss.next == NULL) in wpa_bss_flush()
510 dl_list_for_each_safe(bss, n, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_flush()
511 if (wpa_bss_in_use(wpa_s, bss)) in wpa_bss_flush()
513 wpa_bss_remove(wpa_s, bss); in wpa_bss_flush()
528 struct wpa_bss *bss; in wpa_bss_get_bssid() local
529 dl_list_for_each_reverse(bss, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_get_bssid()
530 if (os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0) in wpa_bss_get_bssid()
531 return bss; in wpa_bss_get_bssid()
541 struct wpa_bss *bss; in wpa_bss_get_p2p_dev_addr() local
542 dl_list_for_each_reverse(bss, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_get_p2p_dev_addr()
544 if (p2p_parse_dev_addr((const u8 *) (bss + 1), bss->ie_len, in wpa_bss_get_p2p_dev_addr()
547 return bss; in wpa_bss_get_p2p_dev_addr()
556 struct wpa_bss *bss; in wpa_bss_get_id() local
557 dl_list_for_each(bss, &wpa_s->bss, struct wpa_bss, list) { in wpa_bss_get_id()
558 if (bss->id == id) in wpa_bss_get_id()
559 return bss; in wpa_bss_get_id()
565 const u8 * wpa_bss_get_ie(const struct wpa_bss *bss, u8 ie) in wpa_bss_get_ie() argument
569 pos = (const u8 *) (bss + 1); in wpa_bss_get_ie()
570 end = pos + bss->ie_len; in wpa_bss_get_ie()
584 const u8 * wpa_bss_get_vendor_ie(const struct wpa_bss *bss, u32 vendor_type) in wpa_bss_get_vendor_ie() argument
588 pos = (const u8 *) (bss + 1); in wpa_bss_get_vendor_ie()
589 end = pos + bss->ie_len; in wpa_bss_get_vendor_ie()
604 struct wpabuf * wpa_bss_get_vendor_ie_multi(const struct wpa_bss *bss, in wpa_bss_get_vendor_ie_multi() argument
610 buf = wpabuf_alloc(bss->ie_len); in wpa_bss_get_vendor_ie_multi()
614 pos = (const u8 *) (bss + 1); in wpa_bss_get_vendor_ie_multi()
615 end = pos + bss->ie_len; in wpa_bss_get_vendor_ie_multi()
635 int wpa_bss_get_max_rate(const struct wpa_bss *bss) in wpa_bss_get_max_rate() argument
641 ie = wpa_bss_get_ie(bss, WLAN_EID_SUPP_RATES); in wpa_bss_get_max_rate()
647 ie = wpa_bss_get_ie(bss, WLAN_EID_EXT_SUPP_RATES); in wpa_bss_get_max_rate()
657 int wpa_bss_get_bit_rates(const struct wpa_bss *bss, u8 **rates) in wpa_bss_get_bit_rates() argument
664 ie = wpa_bss_get_ie(bss, WLAN_EID_SUPP_RATES); in wpa_bss_get_bit_rates()
665 ie2 = wpa_bss_get_ie(bss, WLAN_EID_EXT_SUPP_RATES); in wpa_bss_get_bit_rates()