Lines Matching refs:mvm
82 struct iwl_mvm *mvm; member
244 unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, in iwl_mvm_get_used_hw_queues() argument
252 BIT(mvm->aux_queue) | in iwl_mvm_get_used_hw_queues()
256 lockdep_assert_held(&mvm->mutex); in iwl_mvm_get_used_hw_queues()
260 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_get_used_hw_queues()
264 ieee80211_iterate_stations_atomic(mvm->hw, in iwl_mvm_get_used_hw_queues()
272 for_each_set_bit(sta_id, mvm->sta_drained, IWL_MVM_STATION_COUNT) in iwl_mvm_get_used_hw_queues()
273 data.used_hw_queues |= mvm->tfd_drained[sta_id]; in iwl_mvm_get_used_hw_queues()
302 void iwl_mvm_mac_ctxt_recalc_tsf_id(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_recalc_tsf_id() argument
307 .mvm = mvm, in iwl_mvm_mac_ctxt_recalc_tsf_id()
315 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_recalc_tsf_id()
325 static int iwl_mvm_mac_ctxt_allocate_resources(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_allocate_resources() argument
330 .mvm = mvm, in iwl_mvm_mac_ctxt_allocate_resources()
371 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_allocate_resources()
374 used_hw_queues = iwl_mvm_get_used_hw_queues(mvm, vif); in iwl_mvm_mac_ctxt_allocate_resources()
390 if (WARN_ON_ONCE(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) in iwl_mvm_mac_ctxt_allocate_resources()
396 IWL_ERR(mvm, "Failed to init MAC context - no free ID!\n"); in iwl_mvm_mac_ctxt_allocate_resources()
407 IWL_ERR(mvm, "Failed to init MAC context - no free TSF!\n"); in iwl_mvm_mac_ctxt_allocate_resources()
428 mvm->first_agg_queue); in iwl_mvm_mac_ctxt_allocate_resources()
430 if (queue >= mvm->first_agg_queue) { in iwl_mvm_mac_ctxt_allocate_resources()
431 IWL_ERR(mvm, "Failed to allocate queue\n"); in iwl_mvm_mac_ctxt_allocate_resources()
443 mvm->first_agg_queue); in iwl_mvm_mac_ctxt_allocate_resources()
445 if (queue >= mvm->first_agg_queue) { in iwl_mvm_mac_ctxt_allocate_resources()
446 IWL_ERR(mvm, "Failed to allocate cab queue\n"); in iwl_mvm_mac_ctxt_allocate_resources()
471 int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_mac_ctxt_init() argument
474 iwl_mvm_get_wd_timeout(mvm, vif, false, false); in iwl_mvm_mac_ctxt_init()
478 lockdep_assert_held(&mvm->mutex); in iwl_mvm_mac_ctxt_init()
480 ret = iwl_mvm_mac_ctxt_allocate_resources(mvm, vif); in iwl_mvm_mac_ctxt_init()
486 iwl_mvm_enable_ac_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE, in iwl_mvm_mac_ctxt_init()
490 iwl_mvm_enable_ac_txq(mvm, vif->cab_queue, in iwl_mvm_mac_ctxt_init()
495 iwl_mvm_enable_ac_txq(mvm, vif->hw_queue[ac], in iwl_mvm_mac_ctxt_init()
504 void iwl_mvm_mac_ctxt_release(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_mac_ctxt_release() argument
508 lockdep_assert_held(&mvm->mutex); in iwl_mvm_mac_ctxt_release()
512 iwl_mvm_disable_txq(mvm, IWL_MVM_OFFCHANNEL_QUEUE, 0); in iwl_mvm_mac_ctxt_release()
515 iwl_mvm_disable_txq(mvm, vif->cab_queue, 0); in iwl_mvm_mac_ctxt_release()
519 iwl_mvm_disable_txq(mvm, vif->hw_queue[ac], 0); in iwl_mvm_mac_ctxt_release()
523 static void iwl_mvm_ack_rates(struct iwl_mvm *mvm, in iwl_mvm_ack_rates() argument
536 sband = mvm->hw->wiphy->bands[band]; in iwl_mvm_ack_rates()
609 static void iwl_mvm_mac_ctxt_set_ht_flags(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_set_ht_flags() argument
619 IWL_DEBUG_RATE(mvm, "protection mode set to %d\n", protection_mode); in iwl_mvm_mac_ctxt_set_ht_flags()
637 IWL_ERR(mvm, "Illegal protection mode %d\n", in iwl_mvm_mac_ctxt_set_ht_flags()
643 static void iwl_mvm_mac_ctxt_cmd_common(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_common() argument
695 iwl_mvm_ack_rates(mvm, vif, chanctx ? chanctx->def.chan->band in iwl_mvm_mac_ctxt_cmd_common()
734 IWL_DEBUG_RATE(mvm, "use_cts_prot %d, ht_operation_mode %d\n", in iwl_mvm_mac_ctxt_cmd_common()
740 iwl_mvm_mac_ctxt_set_ht_flags(mvm, vif, cmd); in iwl_mvm_mac_ctxt_cmd_common()
745 static int iwl_mvm_mac_ctxt_send_cmd(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_cmd() argument
748 int ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, 0, in iwl_mvm_mac_ctxt_send_cmd()
751 IWL_ERR(mvm, "Failed to send MAC context (action:%d): %d\n", in iwl_mvm_mac_ctxt_send_cmd()
756 static int iwl_mvm_mac_ctxt_cmd_sta(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_sta() argument
767 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, bssid_override, action); in iwl_mvm_mac_ctxt_cmd_sta()
810 IWL_DEBUG_INFO(mvm, "DTIM TBTT is 0x%llx/0x%x, offset %d\n", in iwl_mvm_mac_ctxt_cmd_sta()
834 ctxt_sta->listen_interval = cpu_to_le32(mvm->hw->conf.listen_interval); in iwl_mvm_mac_ctxt_cmd_sta()
837 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_sta()
840 static int iwl_mvm_mac_ctxt_cmd_listener(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_listener() argument
848 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_listener()
855 mvm->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS; in iwl_mvm_mac_ctxt_cmd_listener()
857 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_listener()
860 static int iwl_mvm_mac_ctxt_cmd_ibss(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_ibss() argument
869 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_ibss()
882 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_ibss()
899 static int iwl_mvm_mac_ctxt_cmd_p2p_device(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_p2p_device() argument
908 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_p2p_device()
924 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_cmd_p2p_device()
928 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_p2p_device()
931 static void iwl_mvm_mac_ctxt_set_tim(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_set_tim() argument
952 IWL_WARN(mvm, "Unable to find TIM Element in beacon\n"); in iwl_mvm_mac_ctxt_set_tim()
956 static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_send_beacon() argument
986 iwl_mvm_bt_coex_tx_prio(mvm, (void *)beacon->data, info, 0) << in iwl_mvm_mac_ctxt_send_beacon()
990 mvm->mgmt_last_antenna_idx = in iwl_mvm_mac_ctxt_send_beacon()
991 iwl_mvm_next_antenna(mvm, iwl_mvm_get_valid_tx_ant(mvm), in iwl_mvm_mac_ctxt_send_beacon()
992 mvm->mgmt_last_antenna_idx); in iwl_mvm_mac_ctxt_send_beacon()
995 cpu_to_le32(BIT(mvm->mgmt_last_antenna_idx) << in iwl_mvm_mac_ctxt_send_beacon()
1009 iwl_mvm_mac_ctxt_set_tim(mvm, &beacon_cmd, in iwl_mvm_mac_ctxt_send_beacon()
1021 return iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_send_beacon()
1025 int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_beacon_changed() argument
1034 beacon = ieee80211_beacon_get_template(mvm->hw, vif, NULL); in iwl_mvm_mac_ctxt_beacon_changed()
1038 ret = iwl_mvm_mac_ctxt_send_beacon(mvm, vif, beacon); in iwl_mvm_mac_ctxt_beacon_changed()
1044 struct iwl_mvm *mvm; member
1070 static void iwl_mvm_mac_ctxt_cmd_fill_ap(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_fill_ap() argument
1077 .mvm = mvm, in iwl_mvm_mac_ctxt_cmd_fill_ap()
1105 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, in iwl_mvm_mac_ctxt_cmd_fill_ap()
1115 iwl_read_prph(mvm->trans, in iwl_mvm_mac_ctxt_cmd_fill_ap()
1127 static int iwl_mvm_mac_ctxt_cmd_ap(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_ap() argument
1136 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_ap()
1146 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.ap, in iwl_mvm_mac_ctxt_cmd_ap()
1149 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_ap()
1152 static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm, in iwl_mvm_mac_ctxt_cmd_go() argument
1162 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); in iwl_mvm_mac_ctxt_cmd_go()
1172 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.go.ap, in iwl_mvm_mac_ctxt_cmd_go()
1181 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); in iwl_mvm_mac_ctxt_cmd_go()
1184 static int iwl_mvm_mac_ctx_send(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_mac_ctx_send() argument
1190 return iwl_mvm_mac_ctxt_cmd_sta(mvm, vif, action, in iwl_mvm_mac_ctx_send()
1196 return iwl_mvm_mac_ctxt_cmd_ap(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1198 return iwl_mvm_mac_ctxt_cmd_go(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1201 return iwl_mvm_mac_ctxt_cmd_listener(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1203 return iwl_mvm_mac_ctxt_cmd_p2p_device(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1205 return iwl_mvm_mac_ctxt_cmd_ibss(mvm, vif, action); in iwl_mvm_mac_ctx_send()
1213 int iwl_mvm_mac_ctxt_add(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_mac_ctxt_add() argument
1222 ret = iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_ADD, in iwl_mvm_mac_ctxt_add()
1228 iwl_mvm_set_last_nonqos_seq(mvm, vif); in iwl_mvm_mac_ctxt_add()
1234 int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_mac_ctxt_changed() argument
1243 return iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_MODIFY, in iwl_mvm_mac_ctxt_changed()
1247 int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif) in iwl_mvm_mac_ctxt_remove() argument
1263 ret = iwl_mvm_send_cmd_pdu(mvm, MAC_CONTEXT_CMD, 0, in iwl_mvm_mac_ctxt_remove()
1266 IWL_ERR(mvm, "Failed to remove MAC context: %d\n", ret); in iwl_mvm_mac_ctxt_remove()
1273 mvm->hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; in iwl_mvm_mac_ctxt_remove()
1278 static void iwl_mvm_csa_count_down(struct iwl_mvm *mvm, in iwl_mvm_csa_count_down() argument
1294 iwl_mvm_mac_ctxt_beacon_changed(mvm, csa_vif); in iwl_mvm_csa_count_down()
1303 iwl_mvm_schedule_csa_period(mvm, csa_vif, in iwl_mvm_csa_count_down()
1311 RCU_INIT_POINTER(mvm->csa_vif, NULL); in iwl_mvm_csa_count_down()
1315 int iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_beacon_notif() argument
1326 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rx_beacon_notif()
1329 mvm->ap_last_beacon_gp2 = le32_to_cpu(beacon->gp2); in iwl_mvm_rx_beacon_notif()
1332 IWL_DEBUG_RX(mvm, in iwl_mvm_rx_beacon_notif()
1336 mvm->ap_last_beacon_gp2, in iwl_mvm_rx_beacon_notif()
1339 csa_vif = rcu_dereference_protected(mvm->csa_vif, in iwl_mvm_rx_beacon_notif()
1340 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rx_beacon_notif()
1342 iwl_mvm_csa_count_down(mvm, csa_vif, mvm->ap_last_beacon_gp2, in iwl_mvm_rx_beacon_notif()
1345 tx_blocked_vif = rcu_dereference_protected(mvm->csa_tx_blocked_vif, in iwl_mvm_rx_beacon_notif()
1346 lockdep_is_held(&mvm->mutex)); in iwl_mvm_rx_beacon_notif()
1356 if (!mvm->csa_tx_block_bcn_timeout) in iwl_mvm_rx_beacon_notif()
1357 mvm->csa_tx_block_bcn_timeout = in iwl_mvm_rx_beacon_notif()
1360 mvm->csa_tx_block_bcn_timeout--; in iwl_mvm_rx_beacon_notif()
1363 if (mvm->csa_tx_block_bcn_timeout == 0) { in iwl_mvm_rx_beacon_notif()
1364 iwl_mvm_modify_all_sta_disable_tx(mvm, mvmvif, false); in iwl_mvm_rx_beacon_notif()
1365 RCU_INIT_POINTER(mvm->csa_tx_blocked_vif, NULL); in iwl_mvm_rx_beacon_notif()
1377 struct iwl_mvm *mvm = mvmvif->mvm; in iwl_mvm_beacon_loss_iterator() local
1397 if (!iwl_fw_dbg_trigger_enabled(mvm->fw, in iwl_mvm_beacon_loss_iterator()
1401 trigger = iwl_fw_dbg_get_trigger(mvm->fw, in iwl_mvm_beacon_loss_iterator()
1410 if (!iwl_fw_dbg_trigger_check_stop(mvm, vif, trigger)) in iwl_mvm_beacon_loss_iterator()
1415 iwl_mvm_fw_dbg_collect_trig(mvm, trigger, NULL); in iwl_mvm_beacon_loss_iterator()
1418 int iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_missed_beacons_notif() argument
1425 IWL_DEBUG_INFO(mvm, in iwl_mvm_rx_missed_beacons_notif()
1433 ieee80211_iterate_active_interfaces_atomic(mvm->hw, in iwl_mvm_rx_missed_beacons_notif()