Lines Matching refs:mvm
105 static int iwl_send_bt_prio_tbl(struct iwl_mvm *mvm) in iwl_send_bt_prio_tbl() argument
107 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) in iwl_send_bt_prio_tbl()
110 return iwl_mvm_send_cmd_pdu(mvm, BT_COEX_PRIO_TABLE, 0, in iwl_send_bt_prio_tbl()
560 iwl_get_coex_type(struct iwl_mvm *mvm, const struct ieee80211_vif *vif) in iwl_get_coex_type() argument
586 if (mvm->cfg->bt_shared_single_ant) { in iwl_get_coex_type()
593 if (mvm->last_bt_ci_cmd_old.primary_ch_phy_id == phy_ctx_id) in iwl_get_coex_type()
594 ret = le32_to_cpu(mvm->last_bt_notif_old.primary_ch_lut); in iwl_get_coex_type()
595 else if (mvm->last_bt_ci_cmd_old.secondary_ch_phy_id == phy_ctx_id) in iwl_get_coex_type()
596 ret = le32_to_cpu(mvm->last_bt_notif_old.secondary_ch_lut); in iwl_get_coex_type()
604 int iwl_send_bt_init_conf_old(struct iwl_mvm *mvm) in iwl_send_bt_init_conf_old() argument
615 ret = iwl_send_bt_prio_tbl(mvm); in iwl_send_bt_init_conf_old()
624 lockdep_assert_held(&mvm->mutex); in iwl_send_bt_init_conf_old()
626 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) { in iwl_send_bt_init_conf_old()
627 switch (mvm->bt_force_ant_mode) { in iwl_send_bt_init_conf_old()
681 if (iwl_mvm_bt_is_plcr_supported(mvm)) { in iwl_send_bt_init_conf_old()
695 if (iwl_mvm_bt_is_rrc_supported(mvm)) in iwl_send_bt_init_conf_old()
698 if (mvm->cfg->bt_shared_single_ant) in iwl_send_bt_init_conf_old()
717 memset(&mvm->last_bt_notif_old, 0, sizeof(mvm->last_bt_notif_old)); in iwl_send_bt_init_conf_old()
718 memset(&mvm->last_bt_ci_cmd_old, 0, sizeof(mvm->last_bt_ci_cmd_old)); in iwl_send_bt_init_conf_old()
720 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_send_bt_init_conf_old()
726 static int iwl_mvm_bt_udpate_ctrl_kill_msk(struct iwl_mvm *mvm) in iwl_mvm_bt_udpate_ctrl_kill_msk() argument
728 struct iwl_bt_coex_profile_notif_old *notif = &mvm->last_bt_notif_old; in iwl_mvm_bt_udpate_ctrl_kill_msk()
741 lockdep_assert_held(&mvm->mutex); in iwl_mvm_bt_udpate_ctrl_kill_msk()
746 if (mvm->bt_ack_kill_msk[0] == ack_kill_msk && in iwl_mvm_bt_udpate_ctrl_kill_msk()
747 mvm->bt_cts_kill_msk[0] == cts_kill_msk) in iwl_mvm_bt_udpate_ctrl_kill_msk()
750 mvm->bt_ack_kill_msk[0] = ack_kill_msk; in iwl_mvm_bt_udpate_ctrl_kill_msk()
751 mvm->bt_cts_kill_msk[0] = cts_kill_msk; in iwl_mvm_bt_udpate_ctrl_kill_msk()
765 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_bt_udpate_ctrl_kill_msk()
771 static int iwl_mvm_bt_coex_reduced_txp(struct iwl_mvm *mvm, u8 sta_id, in iwl_mvm_bt_coex_reduced_txp() argument
785 mvmsta = iwl_mvm_sta_from_staid_protected(mvm, sta_id); in iwl_mvm_bt_coex_reduced_txp()
806 IWL_DEBUG_COEX(mvm, "%sable reduced Tx Power for sta %d\n", in iwl_mvm_bt_coex_reduced_txp()
811 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_bt_coex_reduced_txp()
819 struct iwl_mvm *mvm; member
826 void iwl_mvm_bt_coex_enable_rssi_event(struct iwl_mvm *mvm, in iwl_mvm_bt_coex_enable_rssi_event() argument
845 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_bt_notif_iterator() local
851 lockdep_assert_held(&mvm->mutex); in iwl_mvm_bt_notif_iterator()
873 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_BT_COEX, in iwl_mvm_bt_notif_iterator()
875 iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, in iwl_mvm_bt_notif_iterator()
877 iwl_mvm_bt_coex_enable_rssi_event(mvm, vif, false, 0); in iwl_mvm_bt_notif_iterator()
898 IWL_DEBUG_COEX(data->mvm, in iwl_mvm_bt_notif_iterator()
904 iwl_mvm_update_smps(mvm, vif, IWL_MVM_SMPS_REQ_BT_COEX, in iwl_mvm_bt_notif_iterator()
953 if (iwl_get_coex_type(mvm, vif) == BT_COEX_LOOSE_LUT || in iwl_mvm_bt_notif_iterator()
954 mvm->cfg->bt_shared_single_ant || !vif->bss_conf.assoc || in iwl_mvm_bt_notif_iterator()
956 iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, false); in iwl_mvm_bt_notif_iterator()
957 iwl_mvm_bt_coex_enable_rssi_event(mvm, vif, false, 0); in iwl_mvm_bt_notif_iterator()
968 if (iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, true)) in iwl_mvm_bt_notif_iterator()
969 IWL_ERR(mvm, "Couldn't send BT_CONFIG cmd\n"); in iwl_mvm_bt_notif_iterator()
971 if (iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, false)) in iwl_mvm_bt_notif_iterator()
972 IWL_ERR(mvm, "Couldn't send BT_CONFIG cmd\n"); in iwl_mvm_bt_notif_iterator()
976 iwl_mvm_bt_coex_enable_rssi_event(mvm, vif, true, ave_rssi); in iwl_mvm_bt_notif_iterator()
979 static void iwl_mvm_bt_coex_notif_handle(struct iwl_mvm *mvm) in iwl_mvm_bt_coex_notif_handle() argument
982 .mvm = mvm, in iwl_mvm_bt_coex_notif_handle()
983 .notif = &mvm->last_bt_notif_old, in iwl_mvm_bt_coex_notif_handle()
989 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) in iwl_mvm_bt_coex_notif_handle()
994 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_bt_coex_notif_handle()
1050 if (memcmp(&cmd, &mvm->last_bt_ci_cmd_old, sizeof(cmd))) { in iwl_mvm_bt_coex_notif_handle()
1051 if (iwl_mvm_send_cmd_pdu(mvm, BT_COEX_CI, 0, in iwl_mvm_bt_coex_notif_handle()
1053 IWL_ERR(mvm, "Failed to send BT_CI cmd\n"); in iwl_mvm_bt_coex_notif_handle()
1054 memcpy(&mvm->last_bt_ci_cmd_old, &cmd, sizeof(cmd)); in iwl_mvm_bt_coex_notif_handle()
1057 if (iwl_mvm_bt_udpate_ctrl_kill_msk(mvm)) in iwl_mvm_bt_coex_notif_handle()
1058 IWL_ERR(mvm, "Failed to update the ctrl_kill_msk\n"); in iwl_mvm_bt_coex_notif_handle()
1061 int iwl_mvm_rx_bt_coex_notif_old(struct iwl_mvm *mvm, in iwl_mvm_rx_bt_coex_notif_old() argument
1068 IWL_DEBUG_COEX(mvm, "BT Coex Notification received\n"); in iwl_mvm_rx_bt_coex_notif_old()
1069 IWL_DEBUG_COEX(mvm, "\tBT status: %s\n", in iwl_mvm_rx_bt_coex_notif_old()
1071 IWL_DEBUG_COEX(mvm, "\tBT open conn %d\n", notif->bt_open_conn); in iwl_mvm_rx_bt_coex_notif_old()
1072 IWL_DEBUG_COEX(mvm, "\tBT ci compliance %d\n", notif->bt_ci_compliance); in iwl_mvm_rx_bt_coex_notif_old()
1073 IWL_DEBUG_COEX(mvm, "\tBT primary_ch_lut %d\n", in iwl_mvm_rx_bt_coex_notif_old()
1075 IWL_DEBUG_COEX(mvm, "\tBT secondary_ch_lut %d\n", in iwl_mvm_rx_bt_coex_notif_old()
1077 IWL_DEBUG_COEX(mvm, "\tBT activity grading %d\n", in iwl_mvm_rx_bt_coex_notif_old()
1079 IWL_DEBUG_COEX(mvm, "\tBT agg traffic load %d\n", in iwl_mvm_rx_bt_coex_notif_old()
1083 memcpy(&mvm->last_bt_notif_old, notif, sizeof(mvm->last_bt_notif_old)); in iwl_mvm_rx_bt_coex_notif_old()
1085 iwl_mvm_bt_coex_notif_handle(mvm); in iwl_mvm_rx_bt_coex_notif_old()
1099 struct iwl_mvm *mvm = data->mvm; in iwl_mvm_bt_rssi_iterator() local
1120 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], in iwl_mvm_bt_rssi_iterator()
1121 lockdep_is_held(&mvm->mutex)); in iwl_mvm_bt_rssi_iterator()
1130 void iwl_mvm_bt_rssi_event_old(struct iwl_mvm *mvm, struct ieee80211_vif *vif, in iwl_mvm_bt_rssi_event_old() argument
1135 .mvm = mvm, in iwl_mvm_bt_rssi_event_old()
1139 lockdep_assert_held(&mvm->mutex); in iwl_mvm_bt_rssi_event_old()
1142 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) in iwl_mvm_bt_rssi_event_old()
1153 if (!mvm->last_bt_notif_old.bt_status) in iwl_mvm_bt_rssi_event_old()
1156 IWL_DEBUG_COEX(mvm, "RSSI for %pM is now %s\n", vif->bss_conf.bssid, in iwl_mvm_bt_rssi_event_old()
1163 if (rssi_event == RSSI_EVENT_LOW || mvm->cfg->bt_shared_single_ant || in iwl_mvm_bt_rssi_event_old()
1164 iwl_get_coex_type(mvm, vif) == BT_COEX_LOOSE_LUT) in iwl_mvm_bt_rssi_event_old()
1165 ret = iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, in iwl_mvm_bt_rssi_event_old()
1168 ret = iwl_mvm_bt_coex_reduced_txp(mvm, mvmvif->ap_sta_id, true); in iwl_mvm_bt_rssi_event_old()
1171 IWL_ERR(mvm, "couldn't send BT_CONFIG HCMD upon RSSI event\n"); in iwl_mvm_bt_rssi_event_old()
1174 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, in iwl_mvm_bt_rssi_event_old()
1177 if (iwl_mvm_bt_udpate_ctrl_kill_msk(mvm)) in iwl_mvm_bt_rssi_event_old()
1178 IWL_ERR(mvm, "Failed to update the ctrl_kill_msk\n"); in iwl_mvm_bt_rssi_event_old()
1184 u16 iwl_mvm_coex_agg_time_limit_old(struct iwl_mvm *mvm, in iwl_mvm_coex_agg_time_limit_old() argument
1190 if (le32_to_cpu(mvm->last_bt_notif_old.bt_activity_grading) < in iwl_mvm_coex_agg_time_limit_old()
1194 if (mvm->last_bt_notif_old.ttc_enabled) in iwl_mvm_coex_agg_time_limit_old()
1197 lut_type = iwl_get_coex_type(mvm, mvmsta->vif); in iwl_mvm_coex_agg_time_limit_old()
1206 bool iwl_mvm_bt_coex_is_mimo_allowed_old(struct iwl_mvm *mvm, in iwl_mvm_bt_coex_is_mimo_allowed_old() argument
1212 if (mvm->last_bt_notif_old.ttc_enabled) in iwl_mvm_bt_coex_is_mimo_allowed_old()
1215 if (le32_to_cpu(mvm->last_bt_notif_old.bt_activity_grading) < in iwl_mvm_bt_coex_is_mimo_allowed_old()
1226 lut_type = iwl_get_coex_type(mvm, mvmsta->vif); in iwl_mvm_bt_coex_is_mimo_allowed_old()
1230 bool iwl_mvm_bt_coex_is_shared_ant_avail_old(struct iwl_mvm *mvm) in iwl_mvm_bt_coex_is_shared_ant_avail_old() argument
1232 u32 ag = le32_to_cpu(mvm->last_bt_notif_old.bt_activity_grading); in iwl_mvm_bt_coex_is_shared_ant_avail_old()
1236 bool iwl_mvm_bt_coex_is_tpc_allowed_old(struct iwl_mvm *mvm, in iwl_mvm_bt_coex_is_tpc_allowed_old() argument
1240 le32_to_cpu(mvm->last_bt_notif_old.bt_activity_grading); in iwl_mvm_bt_coex_is_tpc_allowed_old()
1248 void iwl_mvm_bt_coex_vif_change_old(struct iwl_mvm *mvm) in iwl_mvm_bt_coex_vif_change_old() argument
1250 iwl_mvm_bt_coex_notif_handle(mvm); in iwl_mvm_bt_coex_vif_change_old()
1253 int iwl_mvm_rx_ant_coupling_notif_old(struct iwl_mvm *mvm, in iwl_mvm_rx_ant_coupling_notif_old() argument
1270 if (!iwl_mvm_bt_is_plcr_supported(mvm)) in iwl_mvm_rx_ant_coupling_notif_old()
1273 lockdep_assert_held(&mvm->mutex); in iwl_mvm_rx_ant_coupling_notif_old()
1276 if (unlikely(mvm->bt_force_ant_mode != BT_FORCE_ANT_DIS)) in iwl_mvm_rx_ant_coupling_notif_old()
1279 if (ant_isolation == mvm->last_ant_isol) in iwl_mvm_rx_ant_coupling_notif_old()
1293 IWL_DEBUG_COEX(mvm, "Antenna isolation=%d in range [%d,%d[, lut=%d\n", in iwl_mvm_rx_ant_coupling_notif_old()
1296 mvm->last_ant_isol = ant_isolation; in iwl_mvm_rx_ant_coupling_notif_old()
1298 if (mvm->last_corun_lut == lut) in iwl_mvm_rx_ant_coupling_notif_old()
1301 mvm->last_corun_lut = lut; in iwl_mvm_rx_ant_coupling_notif_old()
1320 ret = iwl_mvm_send_cmd(mvm, &cmd); in iwl_mvm_rx_ant_coupling_notif_old()