@@ -689,40 +689,6 @@ s8 iwl_mld_get_emlsr_rssi_thresh(struct iwl_mld *mld,
689
689
#undef RSSI_THRESHOLD
690
690
}
691
691
692
- #define IWL_MLD_BT_COEX_DISABLE_EMLSR_RSSI_THRESH -69
693
- #define IWL_MLD_BT_COEX_ENABLE_EMLSR_RSSI_THRESH -63
694
- #define IWL_MLD_BT_COEX_WIFI_LOSS_THRESH 7
695
-
696
- static bool
697
- iwl_mld_bt_allows_emlsr (struct iwl_mld * mld , struct ieee80211_bss_conf * link ,
698
- bool check_entry )
699
- {
700
- int bt_penalty , rssi_thresh ;
701
- s32 link_rssi ;
702
-
703
- if (WARN_ON_ONCE (!link -> bss ))
704
- return false;
705
-
706
- link_rssi = MBM_TO_DBM (link -> bss -> signal );
707
- rssi_thresh = check_entry ?
708
- IWL_MLD_BT_COEX_ENABLE_EMLSR_RSSI_THRESH :
709
- IWL_MLD_BT_COEX_DISABLE_EMLSR_RSSI_THRESH ;
710
- /* No valid RSSI - force to take low rssi */
711
- if (!link_rssi )
712
- link_rssi = rssi_thresh - 1 ;
713
-
714
- if (link_rssi > rssi_thresh )
715
- bt_penalty = max (mld -> last_bt_notif .wifi_loss_mid_high_rssi [PHY_BAND_24 ][0 ],
716
- mld -> last_bt_notif .wifi_loss_mid_high_rssi [PHY_BAND_24 ][1 ]);
717
- else
718
- bt_penalty = max (mld -> last_bt_notif .wifi_loss_low_rssi [PHY_BAND_24 ][0 ],
719
- mld -> last_bt_notif .wifi_loss_low_rssi [PHY_BAND_24 ][1 ]);
720
-
721
- IWL_DEBUG_EHT (mld , "BT penalty for link-id %0X is %d\n" ,
722
- link -> link_id , bt_penalty );
723
- return bt_penalty < IWL_MLD_BT_COEX_WIFI_LOSS_THRESH ;
724
- }
725
-
726
692
static u32
727
693
iwl_mld_emlsr_disallowed_with_link (struct iwl_mld * mld ,
728
694
struct ieee80211_vif * vif ,
@@ -737,8 +703,7 @@ iwl_mld_emlsr_disallowed_with_link(struct iwl_mld *mld,
737
703
if (WARN_ON_ONCE (!conf ))
738
704
return IWL_MLD_EMLSR_EXIT_INVALID ;
739
705
740
- if (link -> chandef -> chan -> band == NL80211_BAND_2GHZ &&
741
- !iwl_mld_bt_allows_emlsr (mld , conf , true))
706
+ if (link -> chandef -> chan -> band == NL80211_BAND_2GHZ && mld -> bt_is_active )
742
707
ret |= IWL_MLD_EMLSR_EXIT_BT_COEX ;
743
708
744
709
if (link -> signal <
@@ -1076,41 +1041,30 @@ static void iwl_mld_emlsr_check_bt_iter(void *_data, u8 *mac,
1076
1041
struct ieee80211_vif * vif )
1077
1042
{
1078
1043
struct iwl_mld_vif * mld_vif = iwl_mld_vif_from_mac80211 (vif );
1079
- const struct iwl_bt_coex_profile_notif zero_notif = {};
1080
1044
struct iwl_mld * mld = mld_vif -> mld ;
1081
1045
struct ieee80211_bss_conf * link ;
1082
1046
unsigned int link_id ;
1083
- const struct iwl_bt_coex_profile_notif * notif = & mld -> last_bt_notif ;
1084
1047
1085
1048
if (!iwl_mld_vif_has_emlsr_cap (vif ))
1086
1049
return ;
1087
1050
1088
- /* zeroed structure means that BT is OFF */
1089
- if (!memcmp (notif , & zero_notif , sizeof (* notif ))) {
1051
+ if (!mld -> bt_is_active ) {
1090
1052
iwl_mld_retry_emlsr (mld , vif );
1091
1053
return ;
1092
1054
}
1093
1055
1094
- for_each_vif_active_link (vif , link , link_id ) {
1095
- bool emlsr_active , emlsr_allowed ;
1056
+ /* BT is turned ON but we are not in EMLSR, nothing to do */
1057
+ if (!iwl_mld_emlsr_active (vif ))
1058
+ return ;
1096
1059
1097
- if (WARN_ON (!link -> chanreq .oper .chan ))
1098
- continue ;
1060
+ /* In EMLSR and BT is turned ON */
1099
1061
1100
- if (link -> chanreq .oper .chan -> band != NL80211_BAND_2GHZ )
1062
+ for_each_vif_active_link (vif , link , link_id ) {
1063
+ if (WARN_ON (!link -> chanreq .oper .chan ))
1101
1064
continue ;
1102
1065
1103
- emlsr_active = iwl_mld_emlsr_active (vif );
1104
- emlsr_allowed = iwl_mld_bt_allows_emlsr (mld , link ,
1105
- !emlsr_active );
1106
- if (emlsr_allowed && !emlsr_active ) {
1107
- iwl_mld_retry_emlsr (mld , vif );
1108
- return ;
1109
- }
1110
-
1111
- if (!emlsr_allowed && emlsr_active ) {
1112
- iwl_mld_exit_emlsr (mld , vif ,
1113
- IWL_MLD_EMLSR_EXIT_BT_COEX ,
1066
+ if (link -> chanreq .oper .chan -> band == NL80211_BAND_2GHZ ) {
1067
+ iwl_mld_exit_emlsr (mld , vif , IWL_MLD_EMLSR_EXIT_BT_COEX ,
1114
1068
iwl_mld_get_primary_link (vif ));
1115
1069
return ;
1116
1070
}
0 commit comments