Lines Matching defs:ifmgd
125 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
127 if (unlikely(!ifmgd->associated))
130 if (ifmgd->probe_send_count)
131 ifmgd->probe_send_count = 0;
136 mod_timer(&ifmgd->conn_mon_timer,
156 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
240 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && he_oper &&
255 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
265 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
273 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
286 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
368 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
380 if (ifmgd->flags & IEEE80211_STA_DISABLE_HT || !ht_oper)
384 if (ifmgd->flags & IEEE80211_STA_DISABLE_VHT)
388 if (ifmgd->flags & IEEE80211_STA_DISABLE_HE ||
420 if (ifmgd->flags & IEEE80211_STA_DISABLE_80P80MHZ &&
423 if (ifmgd->flags & IEEE80211_STA_DISABLE_160MHZ &&
426 if (ifmgd->flags & IEEE80211_STA_DISABLE_40MHZ &&
436 ifmgd->bssid, chandef.chan->center_freq,
441 if (flags != (ifmgd->flags & (IEEE80211_STA_DISABLE_HT |
450 ifmgd->bssid);
486 ifmgd->bssid);
702 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
703 struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data;
795 if (ifmgd->flags & IEEE80211_STA_ENABLE_RRM)
900 !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) && assoc_data->ie_len &&
945 if (WARN_ON_ONCE((ifmgd->flags & IEEE80211_STA_DISABLE_HT) &&
946 !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)))
947 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
950 !(ifmgd->flags & IEEE80211_STA_DISABLE_HT))
1005 !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
1013 if (ifmgd->flags & IEEE80211_STA_DISABLE_HT ||
1015 ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
1016 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
1018 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
1032 qos_info = ifmgd->uapsd_queues;
1033 qos_info |= (ifmgd->uapsd_max_sp_len <<
1060 kfree(ifmgd->assoc_req_ies);
1061 ifmgd->assoc_req_ies = kmemdup(ie_start, pos - ie_start, GFP_ATOMIC);
1062 ifmgd->assoc_req_ies_len = pos - ie_start;
1096 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1113 if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL)
1154 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1164 if (!ifmgd->associated)
1220 mgd_sta = sta_info_get(sdata, ifmgd->bssid);
1238 &ifmgd->csa_connection_drop_work);
1257 &ifmgd->csa_connection_drop_work);
1261 ifmgd->csa_waiting_bcn = true;
1275 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1289 ifmgd->csa_waiting_bcn = false;
1294 ifmgd->beacon_crc_valid = false;
1301 &ifmgd->csa_connection_drop_work);
1311 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1318 &ifmgd->csa_connection_drop_work);
1320 ieee80211_queue_work(&sdata->local->hw, &ifmgd->chswitch_work);
1366 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1367 struct cfg80211_bss *cbss = ifmgd->associated;
1388 ifmgd->flags,
1389 ifmgd->associated->bssid, &csa_ie);
1402 &ifmgd->csa_connection_drop_work);
1406 if (beacon && sdata->vif.csa_active && !ifmgd->csa_waiting_bcn) {
1423 ifmgd->associated->bssid,
1430 &ifmgd->csa_connection_drop_work);
1437 if (ifmgd->csa_ignored_same_chan)
1441 ifmgd->associated->bssid);
1442 ifmgd->csa_ignored_same_chan = true;
1492 ifmgd->csa_ignored_same_chan = false;
1510 ieee80211_queue_work(&local->hw, &ifmgd->chswitch_work);
1512 mod_timer(&ifmgd->chswitch_timer,
1527 ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work);
1832 struct ieee80211_if_managed *ifmgd;
1840 ifmgd = &sdata->u.mgd;
1874 !(ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) {
1888 (ifmgd->flags & IEEE80211_STA_NULLFUNC_ACKED)) {
1889 ifmgd->flags &= ~IEEE80211_STA_NULLFUNC_ACKED;
1924 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1932 struct ieee80211_sta_tx_tspec *tx_tspec = &ifmgd->tx_tspec[ac];
1986 schedule_delayed_work(&ifmgd->tx_tspec_wk,
2021 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2039 if (ifmgd->flags & IEEE80211_STA_UAPSD_ENABLED)
2040 uapsd_queues = ifmgd->uapsd_queues;
2043 /* -1 is the initial value of ifmgd->mu_edca_last_param_set.
2048 if (count == ifmgd->wmm_last_param_set &&
2049 mu_edca_count == ifmgd->mu_edca_last_param_set)
2051 ifmgd->wmm_last_param_set = count;
2052 ifmgd->mu_edca_last_param_set = mu_edca_count;
2149 ifmgd->tx_tspec[ac].downgraded);
2151 if (!ifmgd->tx_tspec[ac].downgraded &&
2315 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2324 if (WARN_ON(!ifmgd->associated))
2329 ifmgd->associated = NULL;
2367 !ifmgd->have_beacon)
2370 ieee80211_send_deauth_disassoc(sdata, ifmgd->bssid,
2371 ifmgd->bssid, stype, reason,
2380 eth_zero_addr(ifmgd->bssid);
2392 ifmgd->p2p_noa_index = -1;
2397 memset(&ifmgd->ht_capa, 0, sizeof(ifmgd->ht_capa));
2398 memset(&ifmgd->ht_capa_mask, 0, sizeof(ifmgd->ht_capa_mask));
2399 memset(&ifmgd->vht_capa, 0, sizeof(ifmgd->vht_capa));
2400 memset(&ifmgd->vht_capa_mask, 0, sizeof(ifmgd->vht_capa_mask));
2437 ifmgd->have_beacon = false;
2439 ifmgd->flags = 0;
2444 ifmgd->csa_waiting_bcn = false;
2445 ifmgd->csa_ignored_same_chan = false;
2454 memset(ifmgd->tx_tspec, 0, sizeof(ifmgd->tx_tspec));
2455 cancel_delayed_work_sync(&ifmgd->tx_tspec_wk);
2462 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2466 if (!(ifmgd->flags & IEEE80211_STA_CONNECTION_POLL))
2485 mod_timer(&ifmgd->conn_mon_timer,
2496 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2507 tx_tspec = &ifmgd->tx_tspec[ac];
2518 schedule_delayed_work(&ifmgd->tx_tspec_wk, 0);
2530 schedule_delayed_work(&ifmgd->tx_tspec_wk, 0);
2566 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2568 u8 *dst = ifmgd->associated->bssid;
2577 if (ifmgd->probe_send_count >= unicast_limit)
2587 ifmgd->probe_send_count++;
2598 ifmgd->nullfunc_failed = false;
2599 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
2600 ifmgd->probe_send_count--;
2607 ssid = ieee80211_bss_get_ie(ifmgd->associated, WLAN_EID_SSID);
2615 ifmgd->associated->channel);
2619 ifmgd->probe_timeout = jiffies + msecs_to_jiffies(probe_wait_ms);
2620 run_again(sdata, ifmgd->probe_timeout);
2626 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2634 if (!ifmgd->associated)
2663 if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL)
2666 ifmgd->flags |= IEEE80211_STA_CONNECTION_POLL;
2677 ifmgd->probe_send_count = 0;
2687 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2698 if (ifmgd->associated)
2699 cbss = ifmgd->associated;
2700 else if (ifmgd->auth_data)
2701 cbss = ifmgd->auth_data->bss;
2702 else if (ifmgd->assoc_data)
2703 cbss = ifmgd->assoc_data->bss;
2746 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2751 if (!ifmgd->associated) {
2761 cfg80211_unlink_bss(local->hw.wiphy, ifmgd->associated);
2768 ifmgd->csa_waiting_bcn = false;
2787 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2789 if (ifmgd->associated)
2790 ifmgd->beacon_loss_count++;
2792 if (ifmgd->connection_loss) {
2794 ifmgd->bssid);
2927 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2932 ifmgd->auth_data->done = true;
2933 ifmgd->auth_data->timeout = jiffies + IEEE80211_AUTH_WAIT_ASSOC;
2934 ifmgd->auth_data->timeout_started = true;
2935 run_again(sdata, ifmgd->auth_data->timeout);
2959 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2972 if (!ifmgd->auth_data || ifmgd->auth_data->done)
2975 memcpy(bssid, ifmgd->auth_data->bss->bssid, ETH_ALEN);
2984 if (auth_alg != ifmgd->auth_data->algorithm ||
2986 auth_transaction != ifmgd->auth_data->expected_transaction) ||
2988 (auth_transaction < ifmgd->auth_data->expected_transaction ||
2991 mgmt->sa, auth_alg, ifmgd->auth_data->algorithm,
2993 ifmgd->auth_data->expected_transaction);
3006 ifmgd->auth_data->waiting = true;
3007 ifmgd->auth_data->timeout =
3009 ifmgd->auth_data->timeout_started = true;
3010 run_again(sdata, ifmgd->auth_data->timeout);
3023 switch (ifmgd->auth_data->algorithm) {
3033 if (ifmgd->auth_data->expected_transaction != 4) {
3041 ifmgd->auth_data->algorithm);
3047 if (ifmgd->auth_data->algorithm != WLAN_AUTH_SAE ||
3049 ifmgd->auth_data->expected_transaction == 2)) {
3052 } else if (ifmgd->auth_data->algorithm == WLAN_AUTH_SAE &&
3055 ifmgd->auth_data->peer_confirmed = true;
3121 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3134 if (ifmgd->associated &&
3135 ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid)) {
3136 const u8 *bssid = ifmgd->associated->bssid;
3149 if (ifmgd->assoc_data &&
3150 ether_addr_equal(mgmt->bssid, ifmgd->assoc_data->bss->bssid)) {
3151 const u8 *bssid = ifmgd->assoc_data->bss->bssid;
3169 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3177 if (!ifmgd->associated ||
3178 !ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid))
3278 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3285 struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data;
3314 ifmgd->broken_ap = false;
3320 ifmgd->broken_ap = true;
3329 ifmgd->tdls_chan_switch_prohibited =
3342 (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) &&
3344 (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT) &&
3374 !(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) {
3380 !(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) {
3386 !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) {
3392 !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) {
3404 if (!is_6ghz && !(ifmgd->flags & IEEE80211_STA_DISABLE_HT) &&
3412 if (!is_6ghz && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT) &&
3420 if (is_6ghz && !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) &&
3447 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE) &&
3457 if (elems->ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_HT))
3461 if (elems->vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
3465 if (elems->he_operation && !(ifmgd->flags & IEEE80211_STA_DISABLE_HE) &&
3565 if (ifmgd->flags & IEEE80211_STA_MFP_ENABLED) {
3576 if (!err && !(ifmgd->flags & IEEE80211_STA_CONTROL_PORT))
3599 ifmgd->wmm_last_param_set = -1;
3600 ifmgd->mu_edca_last_param_set = -1;
3602 if (ifmgd->flags & IEEE80211_STA_DISABLE_WMM) {
3616 ifmgd->flags |= IEEE80211_STA_DISABLE_WMM;
3641 if (ifmgd->use_4addr)
3661 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3662 struct ieee80211_mgd_assoc_data *assoc_data = ifmgd->assoc_data;
3763 ifmgd->assoc_req_ies, ifmgd->assoc_req_ies_len);
3793 struct ieee80211_if_managed *ifmgd;
3798 ifmgd = &sdata->u.mgd;
3825 if (ifmgd->associated &&
3826 ether_addr_equal(mgmt->bssid, ifmgd->associated->bssid))
3855 struct ieee80211_if_managed *ifmgd,
3862 if (ifmgd->flags & IEEE80211_STA_RESET_SIGNAL_AVE) {
3863 ifmgd->flags &= ~IEEE80211_STA_RESET_SIGNAL_AVE;
3864 ewma_beacon_signal_init(&ifmgd->ave_beacon_signal);
3865 ifmgd->last_cqm_event_signal = 0;
3866 ifmgd->count_beacon_signal = 1;
3867 ifmgd->last_ave_beacon_signal = 0;
3869 ifmgd->count_beacon_signal++;
3872 ewma_beacon_signal_add(&ifmgd->ave_beacon_signal, -rx_status->signal);
3874 if (ifmgd->rssi_min_thold != ifmgd->rssi_max_thold &&
3875 ifmgd->count_beacon_signal >= IEEE80211_SIGNAL_AVE_MIN_COUNT) {
3876 int sig = -ewma_beacon_signal_read(&ifmgd->ave_beacon_signal);
3877 int last_sig = ifmgd->last_ave_beacon_signal;
3886 if (sig > ifmgd->rssi_max_thold &&
3887 (last_sig <= ifmgd->rssi_min_thold || last_sig == 0)) {
3888 ifmgd->last_ave_beacon_signal = sig;
3891 } else if (sig < ifmgd->rssi_min_thold &&
3892 (last_sig >= ifmgd->rssi_max_thold ||
3894 ifmgd->last_ave_beacon_signal = sig;
3901 ifmgd->count_beacon_signal >= IEEE80211_SIGNAL_AVE_MIN_COUNT &&
3903 int sig = -ewma_beacon_signal_read(&ifmgd->ave_beacon_signal);
3904 int last_event = ifmgd->last_cqm_event_signal;
3910 ifmgd->last_cqm_event_signal = sig;
3917 ifmgd->last_cqm_event_signal = sig;
3926 ifmgd->count_beacon_signal >= IEEE80211_SIGNAL_AVE_MIN_COUNT) {
3927 int sig = -ewma_beacon_signal_read(&ifmgd->ave_beacon_signal);
3928 int last_event = ifmgd->last_cqm_event_signal;
3934 ifmgd->last_cqm_event_signal = sig;
3941 ifmgd->last_cqm_event_signal = sig;
3964 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4012 if (ifmgd->assoc_data && ifmgd->assoc_data->need_beacon &&
4013 ieee80211_rx_our_beacon(bssid, ifmgd->assoc_data->bss)) {
4017 ifmgd->assoc_data->bss->bssid);
4022 ifmgd->dtim_period = elems.dtim_period;
4023 ifmgd->have_beacon = true;
4024 ifmgd->assoc_data->need_beacon = false;
4046 ifmgd->assoc_data->timeout = jiffies;
4047 ifmgd->assoc_data->timeout_started = true;
4048 run_again(sdata, ifmgd->assoc_data->timeout);
4053 if (!ifmgd->associated ||
4054 !ieee80211_rx_our_beacon(bssid, ifmgd->associated))
4056 bssid = ifmgd->associated->bssid;
4059 ieee80211_handle_beacon_sig(sdata, ifmgd, bss_conf,
4062 if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL) {
4129 ifmgd->beacon_crc_valid = false;
4136 ifmgd->beacon_crc_valid = false;
4140 if (ifmgd->csa_waiting_bcn)
4160 if ((ncrc == ifmgd->beacon_crc && ifmgd->beacon_crc_valid) ||
4163 ifmgd->beacon_crc = ncrc;
4164 ifmgd->beacon_crc_valid = true;
4172 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_WMM) &&
4182 if (!ifmgd->have_beacon) {
4187 ifmgd->have_beacon = true;
4379 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4380 struct ieee80211_mgd_auth_data *auth_data = ifmgd->auth_data;
4507 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4511 if (ifmgd->status_received) {
4512 __le16 fc = ifmgd->status_fc;
4513 bool status_acked = ifmgd->status_acked;
4515 ifmgd->status_received = false;
4516 if (ifmgd->auth_data && ieee80211_is_auth(fc)) {
4518 if (ifmgd->auth_data->algorithm ==
4520 ifmgd->auth_data->timeout =
4524 ifmgd->auth_data->timeout =
4527 run_again(sdata, ifmgd->auth_data->timeout);
4529 ifmgd->auth_data->timeout = jiffies - 1;
4531 ifmgd->auth_data->timeout_started = true;
4532 } else if (ifmgd->assoc_data &&
4536 ifmgd->assoc_data->timeout =
4538 run_again(sdata, ifmgd->assoc_data->timeout);
4540 ifmgd->assoc_data->timeout = jiffies - 1;
4542 ifmgd->assoc_data->timeout_started = true;
4546 if (ifmgd->auth_data && ifmgd->auth_data->timeout_started &&
4547 time_after(jiffies, ifmgd->auth_data->timeout)) {
4548 if (ifmgd->auth_data->done || ifmgd->auth_data->waiting) {
4562 memcpy(bssid, ifmgd->auth_data->bss->bssid, ETH_ALEN);
4569 } else if (ifmgd->auth_data && ifmgd->auth_data->timeout_started)
4570 run_again(sdata, ifmgd->auth_data->timeout);
4572 if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started &&
4573 time_after(jiffies, ifmgd->assoc_data->timeout)) {
4574 if ((ifmgd->assoc_data->need_beacon && !ifmgd->have_beacon) ||
4576 struct cfg80211_bss *bss = ifmgd->assoc_data->bss;
4587 } else if (ifmgd->assoc_data && ifmgd->assoc_data->timeout_started)
4588 run_again(sdata, ifmgd->assoc_data->timeout);
4590 if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL &&
4591 ifmgd->associated) {
4595 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
4603 if (!ifmgd->probe_send_count)
4605 else if (ifmgd->nullfunc_failed) {
4606 if (ifmgd->probe_send_count < max_tries) {
4609 bssid, ifmgd->probe_send_count,
4620 } else if (time_is_after_jiffies(ifmgd->probe_timeout))
4621 run_again(sdata, ifmgd->probe_timeout);
4628 } else if (ifmgd->probe_send_count < max_tries) {
4632 ifmgd->probe_send_count, max_tries);
4655 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4657 if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn)
4672 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4677 if (sdata->vif.csa_active && !ifmgd->csa_waiting_bcn)
4680 sta = sta_info_get(sdata, ifmgd->bssid);
4693 mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout));
4697 ieee80211_queue_work(&local->hw, &ifmgd->monitor_work);
4724 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4729 if (ifmgd->auth_data || ifmgd->assoc_data) {
4730 const u8 *bssid = ifmgd->auth_data ?
4731 ifmgd->auth_data->bss->bssid :
4732 ifmgd->assoc_data->bss->bssid;
4743 if (ifmgd->assoc_data)
4745 if (ifmgd->auth_data)
4768 if (ifmgd->associated && !sdata->local->wowlan) {
4775 memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
4784 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4787 if (!ifmgd->associated) {
4796 ifmgd->associated->bssid,
4809 struct ieee80211_if_managed *ifmgd;
4811 ifmgd = &sdata->u.mgd;
4812 INIT_WORK(&ifmgd->monitor_work, ieee80211_sta_monitor_work);
4813 INIT_WORK(&ifmgd->chswitch_work, ieee80211_chswitch_work);
4814 INIT_WORK(&ifmgd->beacon_connection_loss_work,
4816 INIT_WORK(&ifmgd->csa_connection_drop_work,
4818 INIT_WORK(&ifmgd->request_smps_work, ieee80211_request_smps_mgd_work);
4819 INIT_DELAYED_WORK(&ifmgd->tdls_peer_del_work,
4821 timer_setup(&ifmgd->timer, ieee80211_sta_timer, 0);
4822 timer_setup(&ifmgd->bcn_mon_timer, ieee80211_sta_bcn_mon_timer, 0);
4823 timer_setup(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer, 0);
4824 timer_setup(&ifmgd->chswitch_timer, ieee80211_chswitch_timer, 0);
4825 INIT_DELAYED_WORK(&ifmgd->tx_tspec_wk,
4828 ifmgd->flags = 0;
4829 ifmgd->powersave = sdata->wdev.ps;
4830 ifmgd->uapsd_queues = sdata->local->hw.uapsd_queues;
4831 ifmgd->uapsd_max_sp_len = sdata->local->hw.uapsd_max_sp_len;
4832 ifmgd->p2p_noa_index = -1;
4835 ifmgd->req_smps = IEEE80211_SMPS_AUTOMATIC;
4837 ifmgd->req_smps = IEEE80211_SMPS_OFF;
4840 spin_lock_init(&ifmgd->teardown_lock);
4841 ifmgd->teardown_skb = NULL;
4842 ifmgd->orig_teardown_skb = NULL;
4862 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4868 if (ifmgd->flags & IEEE80211_STA_DISABLE_HT)
4881 if (ifmgd->flags & IEEE80211_STA_DISABLE_VHT)
4969 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
4986 ifmgd->flags &= ~(IEEE80211_STA_DISABLE_40MHZ |
4992 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
4993 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
4994 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
4998 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
4999 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5003 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5007 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && !is_6ghz) {
5019 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5024 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT) && !is_6ghz) {
5035 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5036 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5037 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5042 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5047 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE)) {
5061 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5076 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5090 ifmgd->flags |= ieee80211_determine_chantype(sdata, sband,
5102 if (ifmgd->flags & IEEE80211_STA_DISABLE_HE && is_6ghz) {
5125 ifmgd->flags |= ieee80211_chandef_downgrade(&chandef);
5173 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
5182 if (WARN_ON(!ifmgd->auth_data && !ifmgd->assoc_data))
5272 memcpy(ifmgd->bssid, cbss->bssid, ETH_ALEN);
5332 WARN_ON_ONCE(!ether_addr_equal(ifmgd->bssid, cbss->bssid));
5346 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
5385 if (ifmgd->assoc_data)
5412 cont_auth = ifmgd->auth_data && req->bss == ifmgd->auth_data->bss;
5430 if (ifmgd->auth_data) {
5433 ifmgd->auth_data->peer_confirmed;
5439 ifmgd->auth_data = auth_data;
5450 if (ifmgd->associated) {
5455 ifmgd->associated->bssid, req->bss->bssid);
5482 eth_zero_addr(ifmgd->bssid);
5484 ifmgd->auth_data = NULL;
5498 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
5522 if (ifmgd->associated) {
5527 ifmgd->associated->bssid, req->bss->bssid);
5537 if (ifmgd->auth_data && !ifmgd->auth_data->done) {
5542 if (ifmgd->assoc_data) {
5547 if (ifmgd->auth_data) {
5551 match = ether_addr_equal(ifmgd->bssid, req->bss->bssid);
5557 ifmgd->beacon_crc_valid = false;
5573 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5574 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5575 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5585 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5586 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5587 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5592 memcpy(&ifmgd->ht_capa, &req->ht_capa, sizeof(ifmgd->ht_capa));
5593 memcpy(&ifmgd->ht_capa_mask, &req->ht_capa_mask,
5594 sizeof(ifmgd->ht_capa_mask));
5596 memcpy(&ifmgd->vht_capa, &req->vht_capa, sizeof(ifmgd->vht_capa));
5597 memcpy(&ifmgd->vht_capa_mask, &req->vht_capa_mask,
5598 sizeof(ifmgd->vht_capa_mask));
5600 memcpy(&ifmgd->s1g_capa, &req->s1g_capa, sizeof(ifmgd->s1g_capa));
5601 memcpy(&ifmgd->s1g_capa_mask, &req->s1g_capa_mask,
5602 sizeof(ifmgd->s1g_capa_mask));
5626 if (ifmgd->req_smps == IEEE80211_SMPS_AUTOMATIC) {
5627 if (ifmgd->powersave)
5632 sdata->smps_mode = ifmgd->req_smps;
5644 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5650 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT |
5662 ifmgd->flags |= IEEE80211_STA_UAPSD_ENABLED;
5665 ifmgd->flags &= ~IEEE80211_STA_UAPSD_ENABLED;
5672 ifmgd->mfp = IEEE80211_MFP_REQUIRED;
5673 ifmgd->flags |= IEEE80211_STA_MFP_ENABLED;
5675 ifmgd->mfp = IEEE80211_MFP_DISABLED;
5676 ifmgd->flags &= ~IEEE80211_STA_MFP_ENABLED;
5680 ifmgd->flags |= IEEE80211_STA_ENABLE_RRM;
5682 ifmgd->flags &= ~IEEE80211_STA_ENABLE_RRM;
5685 ifmgd->flags |= IEEE80211_STA_CONTROL_PORT;
5687 ifmgd->flags &= ~IEEE80211_STA_CONTROL_PORT;
5699 ifmgd->assoc_data = assoc_data;
5700 ifmgd->dtim_period = 0;
5701 ifmgd->have_beacon = false;
5704 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) {
5714 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_40MHZ) &&
5719 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT) &&
5725 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5726 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5727 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5731 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5747 ifmgd->bssid);
5756 &ifmgd->dtim_period);
5758 ifmgd->have_beacon = true;
5807 eth_zero_addr(ifmgd->bssid);
5809 ifmgd->assoc_data = NULL;
5818 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
5822 if (ifmgd->auth_data &&
5823 ether_addr_equal(ifmgd->auth_data->bss->bssid, req->bssid)) {
5842 if (ifmgd->assoc_data &&
5843 ether_addr_equal(ifmgd->assoc_data->bss->bssid, req->bssid)) {
5861 if (ifmgd->associated &&
5862 ether_addr_equal(ifmgd->associated->bssid, req->bssid)) {
5882 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
5892 if (ifmgd->associated != req->bss)
5912 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
5919 cancel_work_sync(&ifmgd->monitor_work);
5920 cancel_work_sync(&ifmgd->beacon_connection_loss_work);
5921 cancel_work_sync(&ifmgd->request_smps_work);
5922 cancel_work_sync(&ifmgd->csa_connection_drop_work);
5923 cancel_work_sync(&ifmgd->chswitch_work);
5924 cancel_delayed_work_sync(&ifmgd->tdls_peer_del_work);
5927 if (ifmgd->assoc_data) {
5928 struct cfg80211_bss *bss = ifmgd->assoc_data->bss;
5932 if (ifmgd->auth_data)
5934 spin_lock_bh(&ifmgd->teardown_lock);
5935 if (ifmgd->teardown_skb) {
5936 kfree_skb(ifmgd->teardown_skb);
5937 ifmgd->teardown_skb = NULL;
5938 ifmgd->orig_teardown_skb = NULL;
5940 kfree(ifmgd->assoc_req_ies);
5941 ifmgd->assoc_req_ies = NULL;
5942 ifmgd->assoc_req_ies_len = 0;
5943 spin_unlock_bh(&ifmgd->teardown_lock);
5944 del_timer_sync(&ifmgd->timer);