Lines Matching refs:mvm
92 struct iwl_mvm *mvm; member
230 void iwl_mvm_mac_ctxt_recalc_tsf_id(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_recalc_tsf_id() argument
235 .mvm = mvm, in iwl_mvm_mac_ctxt_recalc_tsf_id()
243 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_recalc_tsf_id()
253 int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_mac_ctxt_init() argument
257 .mvm = mvm, in iwl_mvm_mac_ctxt_init()
267 lockdep_assert_held(&mvm->mutex); in iwl_mvm_mac_ctxt_init()
298 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_init()
315 if (WARN_ON_ONCE(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) in iwl_mvm_mac_ctxt_init()
321 IWL_ERR(mvm, "Failed to init MAC context - no free ID!\n"); in iwl_mvm_mac_ctxt_init()
332 IWL_ERR(mvm, "Failed to init MAC context - no free TSF!\n"); in iwl_mvm_mac_ctxt_init()
370 static void iwl_mvm_ack_rates(struct iwl_mvm *mvm, in iwl_mvm_ack_rates() argument
383 sband = mvm->hw->wiphy->bands[band]; in iwl_mvm_ack_rates()
456 static void iwl_mvm_mac_ctxt_set_ht_flags(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_set_ht_flags() argument
466 IWL_DEBUG_RATE(mvm, "protection mode set to %d\n", protection_mode); in iwl_mvm_mac_ctxt_set_ht_flags()
484 IWL_ERR(mvm, "Illegal protection mode %d\n", in iwl_mvm_mac_ctxt_set_ht_flags()
490 static void iwl_mvm_mac_ctxt_cmd_common(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_common() argument
542 iwl_mvm_ack_rates(mvm, vif, chanctx ? chanctx->def.chan->band in iwl_mvm_mac_ctxt_cmd_common()
560 u8 txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, i); in iwl_mvm_mac_ctxt_cmd_common()
579 IWL_DEBUG_RATE(mvm, "use_cts_prot %d, ht_operation_mode %d\n", in iwl_mvm_mac_ctxt_cmd_common()
585 iwl_mvm_mac_ctxt_set_ht_flags(mvm, vif, cmd); in iwl_mvm_mac_ctxt_cmd_common()
588 static int iwl_mvm_mac_ctxt_send_cmd(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_cmd() argument
591 int ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, 0, in iwl_mvm_mac_ctxt_send_cmd()
594 IWL_ERR(mvm, "Failed to send MAC context (action:%d): %d\n", in iwl_mvm_mac_ctxt_send_cmd()
599 static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_sta() argument
610 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, bssid_override, action); in iwl_mvm_mac_ctxt_cmd_sta()
657 IWL_DEBUG_INFO(mvm, "DTIM TBTT is 0x%llx/0x%x, offset %d\n", in iwl_mvm_mac_ctxt_cmd_sta()
673 sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]); in iwl_mvm_mac_ctxt_cmd_sta()
699 ctxt_sta->listen_interval = cpu_to_le32(mvm->hw->conf.listen_interval); in iwl_mvm_mac_ctxt_cmd_sta()
712 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_sta()
715 static int iwl_mvm_mac_ctxt_cmd_listener(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_listener() argument
720 u32 tfd_queue_msk = BIT(mvm->snif_queue); in iwl_mvm_mac_ctxt_cmd_listener()
725 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_listener()
733 ieee80211_hw_set(mvm->hw, RX_INCLUDES_FCS); in iwl_mvm_mac_ctxt_cmd_listener()
736 ret = iwl_mvm_allocate_int_sta(mvm, &mvm->snif_sta, tfd_queue_msk, in iwl_mvm_mac_ctxt_cmd_listener()
741 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_listener()
744 static int iwl_mvm_mac_ctxt_cmd_ibss(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_ibss() argument
753 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_ibss()
765 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_ibss()
782 static int iwl_mvm_mac_ctxt_cmd_p2p_device(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_p2p_device() argument
791 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_p2p_device()
805 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_cmd_p2p_device()
809 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_p2p_device()
812 void iwl_mvm_mac_ctxt_set_tim(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_set_tim() argument
833 IWL_WARN(mvm, "Unable to find TIM Element in beacon\n"); in iwl_mvm_mac_ctxt_set_tim()
867 static void iwl_mvm_mac_ctxt_set_tx(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_set_tx() argument
885 iwl_mvm_bt_coex_tx_prio(mvm, (void *)beacon->data, info, 0) << in iwl_mvm_mac_ctxt_set_tx()
889 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_ctxt_set_tx()
891 iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx); in iwl_mvm_mac_ctxt_set_tx()
894 cpu_to_le32(BIT(mvm->mgmt_last_antenna_idx) << in iwl_mvm_mac_ctxt_set_tx()
905 int iwl_mvm_mac_ctxt_send_beacon_cmd(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_beacon_cmd() argument
921 return iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_send_beacon_cmd()
924 static int iwl_mvm_mac_ctxt_send_beacon_v6(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_beacon_v6() argument
931 iwl_mvm_mac_ctxt_set_tx(mvm, vif, beacon, &beacon_cmd.tx); in iwl_mvm_mac_ctxt_send_beacon_v6()
936 iwl_mvm_mac_ctxt_set_tim(mvm, &beacon_cmd.tim_idx, in iwl_mvm_mac_ctxt_send_beacon_v6()
940 return iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd, in iwl_mvm_mac_ctxt_send_beacon_v6()
944 static int iwl_mvm_mac_ctxt_send_beacon_v7(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_beacon_v7() argument
951 iwl_mvm_mac_ctxt_set_tx(mvm, vif, beacon, &beacon_cmd.tx); in iwl_mvm_mac_ctxt_send_beacon_v7()
956 iwl_mvm_mac_ctxt_set_tim(mvm, &beacon_cmd.tim_idx, in iwl_mvm_mac_ctxt_send_beacon_v7()
969 return iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd, in iwl_mvm_mac_ctxt_send_beacon_v7()
973 static int iwl_mvm_mac_ctxt_send_beacon_v9(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_beacon_v9() argument
993 iwl_mvm_mac_ctxt_set_tim(mvm, &beacon_cmd.tim_idx, in iwl_mvm_mac_ctxt_send_beacon_v9()
1006 return iwl_mvm_mac_ctxt_send_beacon_cmd(mvm, beacon, &beacon_cmd, in iwl_mvm_mac_ctxt_send_beacon_v9()
1010 int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_beacon() argument
1020 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_mac_ctxt_send_beacon()
1022 return iwl_mvm_mac_ctxt_send_beacon_v6(mvm, vif, beacon); in iwl_mvm_mac_ctxt_send_beacon()
1024 if (fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_mac_ctxt_send_beacon()
1026 return iwl_mvm_mac_ctxt_send_beacon_v9(mvm, vif, beacon); in iwl_mvm_mac_ctxt_send_beacon()
1028 return iwl_mvm_mac_ctxt_send_beacon_v7(mvm, vif, beacon); in iwl_mvm_mac_ctxt_send_beacon()
1032 int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_beacon_changed() argument
1041 beacon = ieee80211_beacon_get_template(mvm->hw, vif, NULL); in iwl_mvm_mac_ctxt_beacon_changed()
1046 if (mvm->beacon_inject_active) in iwl_mvm_mac_ctxt_beacon_changed()
1050 ret = iwl_mvm_mac_ctxt_send_beacon(mvm, vif, beacon); in iwl_mvm_mac_ctxt_beacon_changed()
1056 struct iwl_mvm *mvm; member
1082 static void iwl_mvm_mac_ctxt_cmd_fill_ap(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_fill_ap() argument
1090 .mvm = mvm, in iwl_mvm_mac_ctxt_cmd_fill_ap()
1105 if (mvmvif->ap_assoc_sta_count || !mvm->drop_bcn_ap_mode) { in iwl_mvm_mac_ctxt_cmd_fill_ap()
1107 IWL_DEBUG_HC(mvm, "Asking FW to pass beacons\n"); in iwl_mvm_mac_ctxt_cmd_fill_ap()
1109 IWL_DEBUG_HC(mvm, "No need to receive beacons\n"); in iwl_mvm_mac_ctxt_cmd_fill_ap()
1116 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_mac_ctxt_cmd_fill_ap()
1132 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_cmd_fill_ap()
1141 mvmvif->ap_beacon_time = iwl_mvm_get_systime(mvm); in iwl_mvm_mac_ctxt_cmd_fill_ap()
1152 static int iwl_mvm_mac_ctxt_cmd_ap(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_ap() argument
1161 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_ap()
1164 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd, &cmd.ap, in iwl_mvm_mac_ctxt_cmd_ap()
1167 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_ap()
1170 static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_go() argument
1180 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_go()
1183 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd, &cmd.go.ap, in iwl_mvm_mac_ctxt_cmd_go()
1192 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_go()
1195 static int iwl_mvm_mac_ctx_send(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_mac_ctx_send() argument
1201 return iwl_mvm_mac_ctxt_cmd_sta(mvm, vif, action, in iwl_mvm_mac_ctx_send()
1207 return iwl_mvm_mac_ctxt_cmd_ap(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1209 return iwl_mvm_mac_ctxt_cmd_go(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1212 return iwl_mvm_mac_ctxt_cmd_listener(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1214 return iwl_mvm_mac_ctxt_cmd_p2p_device(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1216 return iwl_mvm_mac_ctxt_cmd_ibss(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1224 int iwl_mvm_mac_ctxt_add(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_mac_ctxt_add() argument
1233 ret = iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_ADD, in iwl_mvm_mac_ctxt_add()
1239 iwl_mvm_set_last_nonqos_seq(mvm, vif); in iwl_mvm_mac_ctxt_add()
1245 int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_mac_ctxt_changed() argument
1254 return iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_MODIFY, in iwl_mvm_mac_ctxt_changed()
1258 int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_mac_ctxt_remove() argument
1274 ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, 0, in iwl_mvm_mac_ctxt_remove()
1277 IWL_ERR(mvm, "Failed to remove MAC context: %d\n", ret); in iwl_mvm_mac_ctxt_remove()
1284 __clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, mvm->hw->flags); in iwl_mvm_mac_ctxt_remove()
1285 iwl_mvm_dealloc_snif_sta(mvm); in iwl_mvm_mac_ctxt_remove()
1291 static void iwl_mvm_csa_count_down(struct iwl_mvm *mvm, in iwl_mvm_csa_count_down() argument
1307 iwl_mvm_mac_ctxt_beacon_changed(mvm, csa_vif); in iwl_mvm_csa_count_down()
1316 iwl_mvm_schedule_csa_period(mvm, csa_vif, in iwl_mvm_csa_count_down()
1324 RCU_INIT_POINTER(mvm->csa_vif, NULL); in iwl_mvm_csa_count_down()
1328 void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_beacon_notif() argument
1339 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rx_beacon_notif()
1341 mvm->ap_last_beacon_gp2 = le32_to_cpu(beacon->gp2); in iwl_mvm_rx_beacon_notif()
1343 if (!iwl_mvm_is_short_beacon_notif_supported(mvm)) { in iwl_mvm_rx_beacon_notif()
1347 mvm->ibss_manager = beacon_v5->ibss_mgr_status != 0; in iwl_mvm_rx_beacon_notif()
1348 agg_status = iwl_mvm_get_agg_status(mvm, beacon_notify_hdr); in iwl_mvm_rx_beacon_notif()
1350 IWL_DEBUG_RX(mvm, in iwl_mvm_rx_beacon_notif()
1354 mvm->ap_last_beacon_gp2, in iwl_mvm_rx_beacon_notif()
1357 mvm->ibss_manager = beacon->ibss_mgr_status != 0; in iwl_mvm_rx_beacon_notif()
1359 IWL_DEBUG_RX(mvm, in iwl_mvm_rx_beacon_notif()
1362 mvm->ap_last_beacon_gp2); in iwl_mvm_rx_beacon_notif()
1365 csa_vif = rcu_dereference_protected(mvm->csa_vif, in iwl_mvm_rx_beacon_notif()
1366 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rx_beacon_notif()
1368 iwl_mvm_csa_count_down(mvm, csa_vif, mvm->ap_last_beacon_gp2, in iwl_mvm_rx_beacon_notif()
1371 tx_blocked_vif = rcu_dereference_protected(mvm->csa_tx_blocked_vif, in iwl_mvm_rx_beacon_notif()
1372 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rx_beacon_notif()
1382 if (!mvm->csa_tx_block_bcn_timeout) in iwl_mvm_rx_beacon_notif()
1383 mvm->csa_tx_block_bcn_timeout = in iwl_mvm_rx_beacon_notif()
1386 mvm->csa_tx_block_bcn_timeout--; in iwl_mvm_rx_beacon_notif()
1389 if (mvm->csa_tx_block_bcn_timeout == 0) { in iwl_mvm_rx_beacon_notif()
1390 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, false); in iwl_mvm_rx_beacon_notif()
1391 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); in iwl_mvm_rx_beacon_notif()
1396 void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_missed_beacons_notif() argument
1408 IWL_DEBUG_INFO(mvm, in iwl_mvm_rx_missed_beacons_notif()
1418 vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, true); in iwl_mvm_rx_missed_beacons_notif()
1430 iwl_mvm_connection_loss(mvm, vif, "missed beacons"); in iwl_mvm_rx_missed_beacons_notif()
1434 iwl_dbg_tlv_time_point(&mvm->fwrt, in iwl_mvm_rx_missed_beacons_notif()
1437 trigger = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), in iwl_mvm_rx_missed_beacons_notif()
1451 iwl_fw_dbg_collect_trig(&mvm->fwrt, trigger, NULL); in iwl_mvm_rx_missed_beacons_notif()
1457 void iwl_mvm_rx_stored_beacon_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_stored_beacon_notif() argument
1471 IWL_ERR(mvm, "alloc_skb failed\n"); in iwl_mvm_rx_stored_beacon_notif()
1493 ieee80211_rx_napi(mvm->hw, NULL, skb, NULL); in iwl_mvm_rx_stored_beacon_notif()
1496 void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, in iwl_mvm_probe_resp_data_notif() argument
1510 IWL_DEBUG_INFO(mvm, "Probe response data notif: noa %d, csa %d\n", in iwl_mvm_probe_resp_data_notif()
1513 vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, false); in iwl_mvm_probe_resp_data_notif()
1538 lockdep_is_held(&mvmvif->mvm->mutex)); in iwl_mvm_probe_resp_data_notif()
1549 void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm, in iwl_mvm_channel_switch_noa_notif() argument
1569 vif = rcu_dereference(mvm->vif_id_to_mac[mac_id]); in iwl_mvm_channel_switch_noa_notif()
1574 csa_vif = rcu_dereference(mvm->csa_vif); in iwl_mvm_channel_switch_noa_notif()
1585 IWL_DEBUG_INFO(mvm, "Channel Switch Started Notification\n"); in iwl_mvm_channel_switch_noa_notif()
1587 schedule_delayed_work(&mvm->cs_tx_unblock_dwork, in iwl_mvm_channel_switch_noa_notif()
1595 RCU_INIT_POINTER(mvm->csa_vif, NULL); in iwl_mvm_channel_switch_noa_notif()
1598 if (!fw_has_capa(&mvm->fw->ucode_capa, in iwl_mvm_channel_switch_noa_notif()
1600 iwl_mvm_csa_client_absent(mvm, vif); in iwl_mvm_channel_switch_noa_notif()