Lines Matching refs:bss
302 struct ieee80211_sta_bss *bss; in ieee80211_authenticate() local
304 bss = ieee80211_bss_get(wpa_s, wpa_s->bssid); in ieee80211_authenticate()
305 if (bss && bss->mdie_len >= 2 + sizeof(*mdie)) in ieee80211_authenticate()
306 mdie = (struct rsn_mdie *) (bss->mdie + 2); in ieee80211_authenticate()
331 struct ieee80211_sta_bss *bss; in ieee80211_send_assoc() local
359 bss = ieee80211_bss_get(wpa_s, wpa_s->bssid); in ieee80211_send_assoc()
360 if (bss) { in ieee80211_send_assoc()
361 if (bss->capability & WLAN_CAPABILITY_PRIVACY) in ieee80211_send_assoc()
363 if (bss->wmm_ie) { in ieee80211_send_assoc()
432 bss && bss->mdie && in ieee80211_send_assoc()
433 bss->mdie_len >= 2 + sizeof(struct rsn_mdie) && in ieee80211_send_assoc()
434 bss->mdie[1] >= sizeof(struct rsn_mdie)) { in ieee80211_send_assoc()
439 os_memcpy(pos, bss->mdie + 2, MOBILITY_DOMAIN_ID_LEN); in ieee80211_send_assoc()
539 struct ieee80211_sta_bss *bss; in ieee80211_privacy_mismatch() local
546 bss = ieee80211_bss_get(wpa_s, wpa_s->bssid); in ieee80211_privacy_mismatch()
547 if (bss == NULL) in ieee80211_privacy_mismatch()
551 !!(bss->capability & WLAN_CAPABILITY_PRIVACY)) in ieee80211_privacy_mismatch()
1190 struct ieee80211_sta_bss *bss) in __ieee80211_bss_hash_add() argument
1192 bss->hnext = wpa_s->mlme.sta_bss_hash[STA_HASH(bss->bssid)]; in __ieee80211_bss_hash_add()
1193 wpa_s->mlme.sta_bss_hash[STA_HASH(bss->bssid)] = bss; in __ieee80211_bss_hash_add()
1199 struct ieee80211_sta_bss *bss) in __ieee80211_bss_hash_del() argument
1202 b = wpa_s->mlme.sta_bss_hash[STA_HASH(bss->bssid)]; in __ieee80211_bss_hash_del()
1204 if (b == bss) { in __ieee80211_bss_hash_del()
1206 wpa_s->mlme.sta_bss_hash[STA_HASH(bss->bssid)] in __ieee80211_bss_hash_del()
1207 = bss->hnext; in __ieee80211_bss_hash_del()
1209 prev->hnext = bss->hnext; in __ieee80211_bss_hash_del()
1222 struct ieee80211_sta_bss *bss; in ieee80211_bss_add() local
1224 bss = os_zalloc(sizeof(*bss)); in ieee80211_bss_add()
1225 if (bss == NULL) in ieee80211_bss_add()
1227 os_memcpy(bss->bssid, bssid, ETH_ALEN); in ieee80211_bss_add()
1230 bss->next = wpa_s->mlme.sta_bss_list; in ieee80211_bss_add()
1231 wpa_s->mlme.sta_bss_list = bss; in ieee80211_bss_add()
1232 __ieee80211_bss_hash_add(wpa_s, bss); in ieee80211_bss_add()
1233 return bss; in ieee80211_bss_add()
1240 struct ieee80211_sta_bss *bss; in ieee80211_bss_get() local
1242 bss = wpa_s->mlme.sta_bss_hash[STA_HASH(bssid)]; in ieee80211_bss_get()
1243 while (bss) { in ieee80211_bss_get()
1244 if (os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0) in ieee80211_bss_get()
1246 bss = bss->hnext; in ieee80211_bss_get()
1248 return bss; in ieee80211_bss_get()
1253 struct ieee80211_sta_bss *bss) in ieee80211_bss_free() argument
1255 __ieee80211_bss_hash_del(wpa_s, bss); in ieee80211_bss_free()
1256 os_free(bss->ie); in ieee80211_bss_free()
1257 os_free(bss->wpa_ie); in ieee80211_bss_free()
1258 os_free(bss->rsn_ie); in ieee80211_bss_free()
1259 os_free(bss->wmm_ie); in ieee80211_bss_free()
1260 os_free(bss->mdie); in ieee80211_bss_free()
1261 os_free(bss); in ieee80211_bss_free()
1267 struct ieee80211_sta_bss *bss, *prev; in ieee80211_bss_list_deinit() local
1269 bss = wpa_s->mlme.sta_bss_list; in ieee80211_bss_list_deinit()
1271 while (bss) { in ieee80211_bss_list_deinit()
1272 prev = bss; in ieee80211_bss_list_deinit()
1273 bss = bss->next; in ieee80211_bss_list_deinit()
1288 struct ieee80211_sta_bss *bss; in ieee80211_bss_info() local
1403 bss = ieee80211_bss_get(wpa_s, mgmt->bssid); in ieee80211_bss_info()
1404 if (bss == NULL) { in ieee80211_bss_info()
1405 bss = ieee80211_bss_add(wpa_s, mgmt->bssid); in ieee80211_bss_info()
1406 if (bss == NULL) in ieee80211_bss_info()
1412 list_move_tail(&bss->list, &local->sta_bss_list); in ieee80211_bss_info()
1417 if (bss->probe_resp && beacon) { in ieee80211_bss_info()
1422 bss->beacon_int = le_to_host16(mgmt->u.beacon.beacon_int); in ieee80211_bss_info()
1423 bss->capability = le_to_host16(mgmt->u.beacon.capab_info); in ieee80211_bss_info()
1425 if (bss->ie == NULL || bss->ie_len < ie_len) { in ieee80211_bss_info()
1426 os_free(bss->ie); in ieee80211_bss_info()
1427 bss->ie = os_malloc(ie_len); in ieee80211_bss_info()
1429 if (bss->ie) { in ieee80211_bss_info()
1430 os_memcpy(bss->ie, ie_pos, ie_len); in ieee80211_bss_info()
1431 bss->ie_len = ie_len; in ieee80211_bss_info()
1435 os_memcpy(bss->ssid, elems.ssid, elems.ssid_len); in ieee80211_bss_info()
1436 bss->ssid_len = elems.ssid_len; in ieee80211_bss_info()
1439 bss->supp_rates_len = 0; in ieee80211_bss_info()
1441 clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; in ieee80211_bss_info()
1444 os_memcpy(&bss->supp_rates[bss->supp_rates_len], in ieee80211_bss_info()
1446 bss->supp_rates_len += clen; in ieee80211_bss_info()
1449 clen = IEEE80211_MAX_SUPP_RATES - bss->supp_rates_len; in ieee80211_bss_info()
1452 os_memcpy(&bss->supp_rates[bss->supp_rates_len], in ieee80211_bss_info()
1454 bss->supp_rates_len += clen; in ieee80211_bss_info()
1458 (bss->wpa_ie == NULL || bss->wpa_ie_len != elems.wpa_ie_len || in ieee80211_bss_info()
1459 os_memcmp(bss->wpa_ie, elems.wpa_ie, elems.wpa_ie_len))) { in ieee80211_bss_info()
1460 os_free(bss->wpa_ie); in ieee80211_bss_info()
1461 bss->wpa_ie = os_malloc(elems.wpa_ie_len + 2); in ieee80211_bss_info()
1462 if (bss->wpa_ie) { in ieee80211_bss_info()
1463 os_memcpy(bss->wpa_ie, elems.wpa_ie - 2, in ieee80211_bss_info()
1465 bss->wpa_ie_len = elems.wpa_ie_len + 2; in ieee80211_bss_info()
1467 bss->wpa_ie_len = 0; in ieee80211_bss_info()
1468 } else if (!elems.wpa_ie && bss->wpa_ie) { in ieee80211_bss_info()
1469 os_free(bss->wpa_ie); in ieee80211_bss_info()
1470 bss->wpa_ie = NULL; in ieee80211_bss_info()
1471 bss->wpa_ie_len = 0; in ieee80211_bss_info()
1475 (bss->rsn_ie == NULL || bss->rsn_ie_len != elems.rsn_ie_len || in ieee80211_bss_info()
1476 os_memcmp(bss->rsn_ie, elems.rsn_ie, elems.rsn_ie_len))) { in ieee80211_bss_info()
1477 os_free(bss->rsn_ie); in ieee80211_bss_info()
1478 bss->rsn_ie = os_malloc(elems.rsn_ie_len + 2); in ieee80211_bss_info()
1479 if (bss->rsn_ie) { in ieee80211_bss_info()
1480 os_memcpy(bss->rsn_ie, elems.rsn_ie - 2, in ieee80211_bss_info()
1482 bss->rsn_ie_len = elems.rsn_ie_len + 2; in ieee80211_bss_info()
1484 bss->rsn_ie_len = 0; in ieee80211_bss_info()
1485 } else if (!elems.rsn_ie && bss->rsn_ie) { in ieee80211_bss_info()
1486 os_free(bss->rsn_ie); in ieee80211_bss_info()
1487 bss->rsn_ie = NULL; in ieee80211_bss_info()
1488 bss->rsn_ie_len = 0; in ieee80211_bss_info()
1492 (bss->wmm_ie == NULL || bss->wmm_ie_len != elems.wmm_len || in ieee80211_bss_info()
1493 os_memcmp(bss->wmm_ie, elems.wmm, elems.wmm_len))) { in ieee80211_bss_info()
1494 os_free(bss->wmm_ie); in ieee80211_bss_info()
1495 bss->wmm_ie = os_malloc(elems.wmm_len + 2); in ieee80211_bss_info()
1496 if (bss->wmm_ie) { in ieee80211_bss_info()
1497 os_memcpy(bss->wmm_ie, elems.wmm - 2, in ieee80211_bss_info()
1499 bss->wmm_ie_len = elems.wmm_len + 2; in ieee80211_bss_info()
1501 bss->wmm_ie_len = 0; in ieee80211_bss_info()
1502 } else if (!elems.wmm && bss->wmm_ie) { in ieee80211_bss_info()
1503 os_free(bss->wmm_ie); in ieee80211_bss_info()
1504 bss->wmm_ie = NULL; in ieee80211_bss_info()
1505 bss->wmm_ie_len = 0; in ieee80211_bss_info()
1510 (bss->mdie == NULL || bss->mdie_len != elems.mdie_len || in ieee80211_bss_info()
1511 os_memcmp(bss->mdie, elems.mdie, elems.mdie_len))) { in ieee80211_bss_info()
1512 os_free(bss->mdie); in ieee80211_bss_info()
1513 bss->mdie = os_malloc(elems.mdie_len + 2); in ieee80211_bss_info()
1514 if (bss->mdie) { in ieee80211_bss_info()
1515 os_memcpy(bss->mdie, elems.mdie - 2, in ieee80211_bss_info()
1517 bss->mdie_len = elems.mdie_len + 2; in ieee80211_bss_info()
1519 bss->mdie_len = 0; in ieee80211_bss_info()
1520 } else if (!elems.mdie && bss->mdie) { in ieee80211_bss_info()
1521 os_free(bss->mdie); in ieee80211_bss_info()
1522 bss->mdie = NULL; in ieee80211_bss_info()
1523 bss->mdie_len = 0; in ieee80211_bss_info()
1527 bss->hw_mode = wpa_s->mlme.phymode; in ieee80211_bss_info()
1528 bss->channel = channel; in ieee80211_bss_info()
1529 bss->freq = wpa_s->mlme.freq; in ieee80211_bss_info()
1540 bss->freq = freq_list[channel - 1]; in ieee80211_bss_info()
1542 bss->timestamp = timestamp; in ieee80211_bss_info()
1543 os_get_time(&bss->last_update); in ieee80211_bss_info()
1544 bss->rssi = rx_status->ssi; in ieee80211_bss_info()
1546 bss->probe_resp++; in ieee80211_bss_info()
2058 struct ieee80211_sta_bss *bss) in ieee80211_sta_join_ibss() argument
2079 os_memcpy(wpa_s->bssid, bss->bssid, ETH_ALEN); in ieee80211_sta_join_ibss()
2082 local->conf.beacon_int = bss->beacon_int >= 10 ? bss->beacon_int : 10; in ieee80211_sta_join_ibss()
2084 sdata->drop_unencrypted = bss->capability & in ieee80211_sta_join_ibss()
2090 rq.m = bss->freq * 100000; in ieee80211_sta_join_ibss()
2123 mgmt->u.beacon.capab_info = host_to_le16(bss->capability); in ieee80211_sta_join_ibss()
2131 rates = bss->supp_rates_len; in ieee80211_sta_join_ibss()
2138 os_memcpy(pos, bss->supp_rates, rates); in ieee80211_sta_join_ibss()
2144 *pos++ = bss->channel; in ieee80211_sta_join_ibss()
2154 if (bss->supp_rates_len > 8) { in ieee80211_sta_join_ibss()
2155 rates = bss->supp_rates_len - 8; in ieee80211_sta_join_ibss()
2160 os_memcpy(pos, &bss->supp_rates[8], rates); in ieee80211_sta_join_ibss()
2205 for (i = 0; i < bss->supp_rates_len; i++) { in ieee80211_sta_join_ibss()
2206 int rate = (bss->supp_rates[i] & 0x7f) * 5; in ieee80211_sta_join_ibss()
2234 struct ieee80211_sta_bss *bss;
2255 bss = ieee80211_bss_add(wpa_s, bssid);
2256 if (bss == NULL)
2262 bss->beacon_int = local->conf.beacon_int;
2263 bss->hw_mode = local->conf.phymode;
2264 bss->channel = local->conf.channel;
2265 bss->freq = local->conf.freq;
2267 os_get_time(&bss->last_update);
2268 bss->capability = host_to_le16(WLAN_CAPABILITY_IBSS);
2271 bss->capability |= host_to_le16(WLAN_CAPABILITY_PRIVACY);
2274 bss->supp_rates_len = local->num_curr_rates;
2276 pos = bss->supp_rates;
2286 return ieee80211_sta_join_ibss(wpa_s, bss);
2293 struct ieee80211_sta_bss *bss; in ieee80211_sta_find_ibss() local
2307 for (bss = wpa_s->mlme.sta_bss_list; bss; bss = bss->next) { in ieee80211_sta_find_ibss()
2308 if (wpa_s->mlme.ssid_len != bss->ssid_len || in ieee80211_sta_find_ibss()
2309 os_memcmp(wpa_s->mlme.ssid, bss->ssid, bss->ssid_len) != 0 in ieee80211_sta_find_ibss()
2310 || !(bss->capability & WLAN_CAPABILITY_IBSS)) in ieee80211_sta_find_ibss()
2314 MAC2STR(bss->bssid)); in ieee80211_sta_find_ibss()
2316 os_memcpy(bssid, bss->bssid, ETH_ALEN); in ieee80211_sta_find_ibss()
2328 (bss = ieee80211_bss_get(wpa_s, bssid))) { in ieee80211_sta_find_ibss()
2332 return ieee80211_sta_join_ibss(wpa_s, bss); in ieee80211_sta_find_ibss()
2394 struct ieee80211_sta_bss *bss; in ieee80211_sta_associate() local
2402 bss = ieee80211_bss_get(wpa_s, wpa_s->bssid); in ieee80211_sta_associate()
2403 if (bss) { in ieee80211_sta_associate()
2404 wpa_s->mlme.phymode = bss->hw_mode; in ieee80211_sta_associate()
2405 wpa_s->mlme.channel = bss->channel; in ieee80211_sta_associate()
2406 wpa_s->mlme.freq = bss->freq; in ieee80211_sta_associate()
2684 struct ieee80211_sta_bss *bss; in ieee80211_sta_get_scan_results() local
2687 for (bss = wpa_s->mlme.sta_bss_list; bss; bss = bss->next) in ieee80211_sta_get_scan_results()
2695 for (bss = wpa_s->mlme.sta_bss_list; bss; bss = bss->next) { in ieee80211_sta_get_scan_results()
2696 r = os_zalloc(sizeof(*r) + bss->ie_len); in ieee80211_sta_get_scan_results()
2699 os_memcpy(r->bssid, bss->bssid, ETH_ALEN); in ieee80211_sta_get_scan_results()
2700 r->freq = bss->freq; in ieee80211_sta_get_scan_results()
2701 r->beacon_int = bss->beacon_int; in ieee80211_sta_get_scan_results()
2702 r->caps = bss->capability; in ieee80211_sta_get_scan_results()
2703 r->level = bss->rssi; in ieee80211_sta_get_scan_results()
2704 r->tsf = bss->timestamp; in ieee80211_sta_get_scan_results()
2705 if (bss->ie) { in ieee80211_sta_get_scan_results()
2706 r->ie_len = bss->ie_len; in ieee80211_sta_get_scan_results()
2707 os_memcpy(r + 1, bss->ie, bss->ie_len); in ieee80211_sta_get_scan_results()