Skip to content

Commit ae7fe56

Browse files
yedidyaBenshjmberg-intel
authored andcommitted
wifi: iwlwifi: mvm: Disable/enable EMLSR due to link's bandwidth/band
Enable EMLSR when bandwidth settings meet the criteria in both band and width, otherwise disable. Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240505091420.4e473d4f7f5c.I3adf5619b60bfba8af0cd7eae9dac947419603b6@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 8ecdc57 commit ae7fe56

4 files changed

Lines changed: 63 additions & 35 deletions

File tree

drivers/net/wireless/intel/iwlwifi/mvm/link.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,13 @@ bool iwl_mvm_mld_valid_link_pair(struct ieee80211_vif *vif,
629629
iwl_mvm_esr_disallowed_with_link(vif, b, false))
630630
return false;
631631

632+
if (a->chandef->width != b->chandef->width)
633+
return false;
634+
635+
if (!(a->chandef->chan->band == NL80211_BAND_6GHZ &&
636+
b->chandef->chan->band == NL80211_BAND_5GHZ))
637+
return false;
638+
632639
/* Per-combination considerations */
633640
return a->chandef->chan->band != b->chandef->chan->band;
634641
}

drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,25 @@ static int iwl_mvm_mld_mac_sta_state(struct ieee80211_hw *hw,
693693
&callbacks);
694694
}
695695

696+
static bool iwl_mvm_esr_bw_criteria(struct iwl_mvm *mvm,
697+
struct ieee80211_vif *vif,
698+
struct ieee80211_bss_conf *link_conf)
699+
{
700+
struct ieee80211_bss_conf *other_link;
701+
int link_id;
702+
703+
/* Exit EMLSR if links don't have equal bandwidths */
704+
for_each_vif_active_link(vif, other_link, link_id) {
705+
if (link_id == link_conf->link_id)
706+
continue;
707+
if (link_conf->chanreq.oper.width ==
708+
other_link->chanreq.oper.width)
709+
return true;
710+
}
711+
712+
return false;
713+
}
714+
696715
static void
697716
iwl_mvm_mld_link_info_changed_station(struct iwl_mvm *mvm,
698717
struct ieee80211_vif *vif,
@@ -722,6 +741,14 @@ iwl_mvm_mld_link_info_changed_station(struct iwl_mvm *mvm,
722741
link_changes |= LINK_CONTEXT_MODIFY_HE_PARAMS;
723742
}
724743

744+
if ((changes & BSS_CHANGED_BANDWIDTH) &&
745+
ieee80211_vif_link_active(vif, link_conf->link_id) &&
746+
mvmvif->esr_active &&
747+
!iwl_mvm_esr_bw_criteria(mvm, vif, link_conf))
748+
iwl_mvm_exit_esr(mvm, vif,
749+
IWL_MVM_ESR_EXIT_BANDWIDTH,
750+
iwl_mvm_get_primary_link(vif));
751+
725752
/* if associated, maybe puncturing changed - we'll check later */
726753
if (vif->cfg.assoc)
727754
link_changes |= LINK_CONTEXT_MODIFY_EHT_PARAMS;

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ struct iwl_mvm_vif_link_info {
363363
* due to low RSSI.
364364
* @IWL_MVM_ESR_EXIT_COEX: link is deactivated/not allowed for EMLSR
365365
* due to BT Coex.
366+
* @IWL_MVM_ESR_EXIT_BANDWIDTH: Bandwidths of primary and secondry links
367+
* preventing the enablement of EMLSR
366368
*/
367369
enum iwl_mvm_esr_state {
368370
IWL_MVM_ESR_BLOCKED_PREVENTION = 0x1,
@@ -372,6 +374,7 @@ enum iwl_mvm_esr_state {
372374
IWL_MVM_ESR_EXIT_MISSED_BEACON = 0x10000,
373375
IWL_MVM_ESR_EXIT_LOW_RSSI = 0x20000,
374376
IWL_MVM_ESR_EXIT_COEX = 0x40000,
377+
IWL_MVM_ESR_EXIT_BANDWIDTH = 0x80000,
375378
};
376379

377380
#define IWL_MVM_BLOCK_ESR_REASONS 0xffff

drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,15 @@ static const struct valid_link_pair_case {
241241
} valid_link_pair_cases[] = {
242242
{
243243
.desc = "HB + UHB, valid.",
244-
.chan_a = &chan_5ghz,
245-
.chan_b = &chan_6ghz,
244+
.chan_a = &chan_6ghz,
245+
.chan_b = &chan_5ghz,
246246
.valid = true,
247247
},
248248
{
249249
.desc = "LB + HB, no BT.",
250250
.chan_a = &chan_2ghz,
251251
.chan_b = &chan_5ghz,
252-
.valid = true,
252+
.valid = false,
253253
},
254254
{
255255
.desc = "LB + HB, with BT.",
@@ -273,75 +273,66 @@ static const struct valid_link_pair_case {
273273
.valid = false,
274274
},
275275
{
276-
.desc = "RSSI: LB, 20 MHz, high",
277-
.chan_a = &chan_2ghz,
276+
.desc = "RSSI: UHB, 20 MHz, high",
277+
.chan_a = &chan_6ghz,
278278
.cw_a = NL80211_CHAN_WIDTH_20,
279279
.sig_a = -66,
280280
.chan_b = &chan_5ghz,
281+
.cw_b = NL80211_CHAN_WIDTH_20,
281282
.valid = true,
282283
},
283284
{
284-
.desc = "RSSI: LB, 40 MHz, low",
285-
.chan_a = &chan_2ghz,
285+
.desc = "RSSI: UHB, 40 MHz, low",
286+
.chan_a = &chan_6ghz,
286287
.cw_a = NL80211_CHAN_WIDTH_40,
287288
.sig_a = -65,
288289
.chan_b = &chan_5ghz,
290+
.cw_b = NL80211_CHAN_WIDTH_40,
289291
.valid = false,
290292
},
291293
{
292-
.desc = "RSSI: LB, 40 MHz, high",
293-
.chan_a = &chan_2ghz,
294+
.desc = "RSSI: UHB, 40 MHz, high",
295+
.chan_a = &chan_6ghz,
294296
.cw_a = NL80211_CHAN_WIDTH_40,
295297
.sig_a = -63,
296298
.chan_b = &chan_5ghz,
299+
.cw_b = NL80211_CHAN_WIDTH_40,
297300
.valid = true,
298301
},
299302
{
300-
.desc = "RSSI: HB, 80 MHz, low",
301-
.chan_a = &chan_5ghz,
303+
.desc = "RSSI: UHB, 80 MHz, low",
304+
.chan_a = &chan_6ghz,
302305
.cw_a = NL80211_CHAN_WIDTH_80,
303306
.sig_a = -62,
304-
.chan_b = &chan_2ghz,
307+
.chan_b = &chan_5ghz,
308+
.cw_b = NL80211_CHAN_WIDTH_80,
305309
.valid = false,
306310
},
307311
{
308-
.desc = "RSSI: HB, 80 MHz, high",
309-
.chan_a = &chan_5ghz,
312+
.desc = "RSSI: UHB, 80 MHz, high",
313+
.chan_a = &chan_6ghz,
310314
.cw_a = NL80211_CHAN_WIDTH_80,
311315
.sig_a = -60,
312-
.chan_b = &chan_2ghz,
316+
.chan_b = &chan_5ghz,
317+
.cw_b = NL80211_CHAN_WIDTH_80,
313318
.valid = true,
314319
},
315320
{
316-
.desc = "RSSI: HB, 160 MHz, low",
317-
.chan_a = &chan_5ghz,
321+
.desc = "RSSI: UHB, 160 MHz, low",
322+
.chan_a = &chan_6ghz,
318323
.cw_a = NL80211_CHAN_WIDTH_160,
319324
.sig_a = -59,
320-
.chan_b = &chan_2ghz,
325+
.chan_b = &chan_5ghz,
326+
.cw_b = NL80211_CHAN_WIDTH_160,
321327
.valid = false,
322328
},
323329
{
324330
.desc = "RSSI: HB, 160 MHz, high",
325-
.chan_a = &chan_5ghz,
331+
.chan_a = &chan_6ghz,
326332
.cw_a = NL80211_CHAN_WIDTH_160,
327333
.sig_a = -5,
328-
.chan_b = &chan_2ghz,
329-
.valid = true,
330-
},
331-
{
332-
.desc = "RSSI: UHB, 320 MHz, low",
333-
.chan_a = &chan_6ghz,
334-
.cw_a = NL80211_CHAN_WIDTH_320,
335-
.sig_a = -68,
336-
.chan_b = &chan_6ghz,
337-
.valid = false,
338-
},
339-
{
340-
.desc = "RSSI: UHB, 320 MHz, high",
341-
.chan_a = &chan_6ghz,
342-
.cw_a = NL80211_CHAN_WIDTH_320,
343-
.sig_a = -66,
344334
.chan_b = &chan_5ghz,
335+
.cw_b = NL80211_CHAN_WIDTH_160,
345336
.valid = true,
346337
},
347338
};

0 commit comments

Comments
 (0)