Lines Matching refs:mvm

361 iwl_get_coex_type(struct iwl_mvm *mvm, const struct ieee80211_vif *vif)  in iwl_get_coex_type()  argument
388 if (mvm->cfg->bt_shared_single_ant) { in iwl_get_coex_type()
394 primary_ch_phy_id = le32_to_cpu(mvm->last_bt_ci_cmd.primary_ch_phy_id); in iwl_get_coex_type()
396 le32_to_cpu(mvm->last_bt_ci_cmd.secondary_ch_phy_id); in iwl_get_coex_type()
399 ret = le32_to_cpu(mvm->last_bt_notif.primary_ch_lut); in iwl_get_coex_type()
401 ret = le32_to_cpu(mvm->last_bt_notif.secondary_ch_lut); in iwl_get_coex_type()
409 int iwl_send_bt_init_conf(struct iwl_mvm *mvm) in iwl_send_bt_init_conf() argument
414 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_BT_COEX_SPLIT)) in iwl_send_bt_init_conf()
415 return iwl_send_bt_init_conf_old(mvm); in iwl_send_bt_init_conf()
417 lockdep_assert_held(&mvm->mutex); in iwl_send_bt_init_conf()
419 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) { in iwl_send_bt_init_conf()
420 switch (mvm->bt_force_ant_mode) { in iwl_send_bt_init_conf()
443 if (iwl_mvm_bt_is_plcr_supported(mvm)) in iwl_send_bt_init_conf()
455 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); in iwl_send_bt_init_conf()
456 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); in iwl_send_bt_init_conf()
458 return iwl_mvm_send_cmd_pdu(mvm, BT_CONFIG, 0, sizeof(bt_cmd), &bt_cmd); in iwl_send_bt_init_conf()
461 static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id, in iwl_mvm_bt_coex_reduced_txp() argument
469 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); in iwl_mvm_bt_coex_reduced_txp()
482 IWL_DEBUG_COEX(mvm, "%sable reduced Tx Power for sta %d\n", in iwl_mvm_bt_coex_reduced_txp()
488 ret = iwl_mvm_send_cmd_pdu(mvm, BT_COEX_UPDATE_REDUCED_TXP, CMD_ASYNC, in iwl_mvm_bt_coex_reduced_txp()
496 struct iwl_mvm *mvm; member
503 void iwl_mvm_bt_coex_enable_rssi_event(struct iwl_mvm *mvm, in iwl_mvm_bt_coex_enable_rssi_event() argument
522 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_bt_notif_iterator() local
529 lockdep_assert_held(&mvm->mutex); in iwl_mvm_bt_notif_iterator()
549 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_BT_COEX, in iwl_mvm_bt_notif_iterator()
551 iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, in iwl_mvm_bt_notif_iterator()
553 iwl_mvm_bt_coex_enable_rssi_event(mvm, vif, false, 0); in iwl_mvm_bt_notif_iterator()
569 IWL_COEX_IS_RRC_ON(mvm->last_bt_notif.ttc_rrc_status, in iwl_mvm_bt_notif_iterator()
573 IWL_DEBUG_COEX(data->mvm, in iwl_mvm_bt_notif_iterator()
578 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_BT_COEX, in iwl_mvm_bt_notif_iterator()
627 if (iwl_get_coex_type(mvm, vif) == BT_COEX_LOOSE_LUT || in iwl_mvm_bt_notif_iterator()
628 mvm->cfg->bt_shared_single_ant || !vif->bss_conf.assoc || in iwl_mvm_bt_notif_iterator()
629 le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) == BT_OFF) { in iwl_mvm_bt_notif_iterator()
630 iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, false); in iwl_mvm_bt_notif_iterator()
631 iwl_mvm_bt_coex_enable_rssi_event(mvm, vif, false, 0); in iwl_mvm_bt_notif_iterator()
642 if (iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, true)) in iwl_mvm_bt_notif_iterator()
643 IWL_ERR(mvm, "Couldn't send BT_CONFIG cmd\n"); in iwl_mvm_bt_notif_iterator()
645 if (iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, false)) in iwl_mvm_bt_notif_iterator()
646 IWL_ERR(mvm, "Couldn't send BT_CONFIG cmd\n"); in iwl_mvm_bt_notif_iterator()
650 iwl_mvm_bt_coex_enable_rssi_event(mvm, vif, true, ave_rssi); in iwl_mvm_bt_notif_iterator()
653 static void iwl_mvm_bt_coex_notif_handle(struct iwl_mvm *mvm) in iwl_mvm_bt_coex_notif_handle() argument
656 .mvm = mvm, in iwl_mvm_bt_coex_notif_handle()
657 .notif = &mvm->last_bt_notif, in iwl_mvm_bt_coex_notif_handle()
663 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) in iwl_mvm_bt_coex_notif_handle()
668 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_bt_coex_notif_handle()
720 if (memcmp(&cmd, &mvm->last_bt_ci_cmd, sizeof(cmd))) { in iwl_mvm_bt_coex_notif_handle()
721 if (iwl_mvm_send_cmd_pdu(mvm, BT_COEX_CI, 0, in iwl_mvm_bt_coex_notif_handle()
723 IWL_ERR(mvm, "Failed to send BT_CI cmd\n"); in iwl_mvm_bt_coex_notif_handle()
724 memcpy(&mvm->last_bt_ci_cmd, &cmd, sizeof(cmd)); in iwl_mvm_bt_coex_notif_handle()
728 void iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_bt_coex_notif() argument
734 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_rx_bt_coex_notif()
736 iwl_mvm_rx_bt_coex_notif_old(mvm, rxb); in iwl_mvm_rx_bt_coex_notif()
740 IWL_DEBUG_COEX(mvm, "BT Coex Notification received\n"); in iwl_mvm_rx_bt_coex_notif()
741 IWL_DEBUG_COEX(mvm, "\tBT ci compliance %d\n", notif->bt_ci_compliance); in iwl_mvm_rx_bt_coex_notif()
742 IWL_DEBUG_COEX(mvm, "\tBT primary_ch_lut %d\n", in iwl_mvm_rx_bt_coex_notif()
744 IWL_DEBUG_COEX(mvm, "\tBT secondary_ch_lut %d\n", in iwl_mvm_rx_bt_coex_notif()
746 IWL_DEBUG_COEX(mvm, "\tBT activity grading %d\n", in iwl_mvm_rx_bt_coex_notif()
750 memcpy(&mvm->last_bt_notif, notif, sizeof(mvm->last_bt_notif)); in iwl_mvm_rx_bt_coex_notif()
752 iwl_mvm_bt_coex_notif_handle(mvm); in iwl_mvm_rx_bt_coex_notif()
755 void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_bt_rssi_event() argument
761 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_bt_rssi_event()
763 iwl_mvm_bt_rssi_event_old(mvm, vif, rssi_event); in iwl_mvm_bt_rssi_event()
767 lockdep_assert_held(&mvm->mutex); in iwl_mvm_bt_rssi_event()
770 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) in iwl_mvm_bt_rssi_event()
781 if (le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) == BT_OFF) in iwl_mvm_bt_rssi_event()
784 IWL_DEBUG_COEX(mvm, "RSSI for %pM is now %s\n", vif->bss_conf.bssid, in iwl_mvm_bt_rssi_event()
791 if (rssi_event == RSSI_EVENT_LOW || mvm->cfg->bt_shared_single_ant || in iwl_mvm_bt_rssi_event()
792 iwl_get_coex_type(mvm, vif) == BT_COEX_LOOSE_LUT) in iwl_mvm_bt_rssi_event()
793 ret = iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, in iwl_mvm_bt_rssi_event()
796 ret = iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, true); in iwl_mvm_bt_rssi_event()
799 IWL_ERR(mvm, "couldn't send BT_CONFIG HCMD upon RSSI event\n"); in iwl_mvm_bt_rssi_event()
805 u16 iwl_mvm_coex_agg_time_limit(struct iwl_mvm *mvm, in iwl_mvm_coex_agg_time_limit() argument
813 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_BT_COEX_SPLIT)) in iwl_mvm_coex_agg_time_limit()
814 return iwl_mvm_coex_agg_time_limit_old(mvm, sta); in iwl_mvm_coex_agg_time_limit()
816 if (IWL_COEX_IS_TTC_ON(mvm->last_bt_notif.ttc_rrc_status, phy_ctxt->id)) in iwl_mvm_coex_agg_time_limit()
819 if (le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) < in iwl_mvm_coex_agg_time_limit()
823 lut_type = iwl_get_coex_type(mvm, mvmsta->vif); in iwl_mvm_coex_agg_time_limit()
832 bool iwl_mvm_bt_coex_is_mimo_allowed(struct iwl_mvm *mvm, in iwl_mvm_bt_coex_is_mimo_allowed() argument
840 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_BT_COEX_SPLIT)) in iwl_mvm_bt_coex_is_mimo_allowed()
841 return iwl_mvm_bt_coex_is_mimo_allowed_old(mvm, sta); in iwl_mvm_bt_coex_is_mimo_allowed()
843 if (IWL_COEX_IS_TTC_ON(mvm->last_bt_notif.ttc_rrc_status, phy_ctxt->id)) in iwl_mvm_bt_coex_is_mimo_allowed()
846 if (le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) < in iwl_mvm_bt_coex_is_mimo_allowed()
857 lut_type = iwl_get_coex_type(mvm, mvmsta->vif); in iwl_mvm_bt_coex_is_mimo_allowed()
861 bool iwl_mvm_bt_coex_is_ant_avail(struct iwl_mvm *mvm, u8 ant) in iwl_mvm_bt_coex_is_ant_avail() argument
864 if (mvm->cfg->bt_shared_single_ant) in iwl_mvm_bt_coex_is_ant_avail()
867 if (ant & mvm->cfg->non_shared_ant) in iwl_mvm_bt_coex_is_ant_avail()
870 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_BT_COEX_SPLIT)) in iwl_mvm_bt_coex_is_ant_avail()
871 return iwl_mvm_bt_coex_is_shared_ant_avail_old(mvm); in iwl_mvm_bt_coex_is_ant_avail()
873 return le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) < in iwl_mvm_bt_coex_is_ant_avail()
877 bool iwl_mvm_bt_coex_is_shared_ant_avail(struct iwl_mvm *mvm) in iwl_mvm_bt_coex_is_shared_ant_avail() argument
880 if (mvm->cfg->bt_shared_single_ant) in iwl_mvm_bt_coex_is_shared_ant_avail()
883 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_BT_COEX_SPLIT)) in iwl_mvm_bt_coex_is_shared_ant_avail()
884 return iwl_mvm_bt_coex_is_shared_ant_avail_old(mvm); in iwl_mvm_bt_coex_is_shared_ant_avail()
886 return le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) < BT_HIGH_TRAFFIC; in iwl_mvm_bt_coex_is_shared_ant_avail()
889 bool iwl_mvm_bt_coex_is_tpc_allowed(struct iwl_mvm *mvm, in iwl_mvm_bt_coex_is_tpc_allowed() argument
892 u32 bt_activity = le32_to_cpu(mvm->last_bt_notif.bt_activity_grading); in iwl_mvm_bt_coex_is_tpc_allowed()
894 if (!fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_BT_COEX_SPLIT)) in iwl_mvm_bt_coex_is_tpc_allowed()
895 return iwl_mvm_bt_coex_is_tpc_allowed_old(mvm, band); in iwl_mvm_bt_coex_is_tpc_allowed()
903 u8 iwl_mvm_bt_coex_tx_prio(struct iwl_mvm *mvm, struct ieee80211_hdr *hdr, in iwl_mvm_bt_coex_tx_prio() argument
911 if (unlikely(mvm->bt_tx_prio)) in iwl_mvm_bt_coex_tx_prio()
912 return mvm->bt_tx_prio - 1; in iwl_mvm_bt_coex_tx_prio()
935 void iwl_mvm_bt_coex_vif_change(struct iwl_mvm *mvm) in iwl_mvm_bt_coex_vif_change() argument
937 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_bt_coex_vif_change()
939 iwl_mvm_bt_coex_vif_change_old(mvm); in iwl_mvm_bt_coex_vif_change()
943 iwl_mvm_bt_coex_notif_handle(mvm); in iwl_mvm_bt_coex_vif_change()
946 void iwl_mvm_rx_ant_coupling_notif(struct iwl_mvm *mvm, in iwl_mvm_rx_ant_coupling_notif() argument
955 if (!fw_has_api(&mvm->fw->ucode_capa, in iwl_mvm_rx_ant_coupling_notif()
957 iwl_mvm_rx_ant_coupling_notif_old(mvm, rxb); in iwl_mvm_rx_ant_coupling_notif()
961 if (!iwl_mvm_bt_is_plcr_supported(mvm)) in iwl_mvm_rx_ant_coupling_notif()
964 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rx_ant_coupling_notif()
967 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) in iwl_mvm_rx_ant_coupling_notif()
970 if (ant_isolation == mvm->last_ant_isol) in iwl_mvm_rx_ant_coupling_notif()
984 IWL_DEBUG_COEX(mvm, "Antenna isolation=%d in range [%d,%d[, lut=%d\n", in iwl_mvm_rx_ant_coupling_notif()
987 mvm->last_ant_isol = ant_isolation; in iwl_mvm_rx_ant_coupling_notif()
989 if (mvm->last_corun_lut == lut) in iwl_mvm_rx_ant_coupling_notif()
992 mvm->last_corun_lut = lut; in iwl_mvm_rx_ant_coupling_notif()
1001 if (iwl_mvm_send_cmd_pdu(mvm, BT_COEX_UPDATE_CORUN_LUT, 0, in iwl_mvm_rx_ant_coupling_notif()
1003 IWL_ERR(mvm, in iwl_mvm_rx_ant_coupling_notif()