Skip to content

Commit df6146a

Browse files
yedidyaBenshMiriam-Rachel
authored andcommitted
wifi: iwlwifi: Add a new version for mac config command
Add a new version of mac configuration command which includes UHR support indication. Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com> Link: https://patch.msgid.link/20250506194102.3407967-5-miriam.rachel.korenblit@intel.com Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
1 parent a1346ce commit df6146a

File tree

3 files changed

+100
-31
lines changed

3 files changed

+100
-31
lines changed

drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,42 @@ enum iwl_mac_config_filter_flags {
310310
MAC_CFG_FILTER_ACCEPT_PROBE_REQ = BIT(5),
311311
}; /* MAC_FILTER_FLAGS_MASK_E_VER_1 */
312312

313+
/**
314+
* struct iwl_mac_wifi_gen_support_v2 - parameters of iwl_mac_config_cmd
315+
* with support up to eht as in version 2 of the command
316+
*
317+
* @he_support: does this MAC support HE
318+
* @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
319+
* @eht_support: does this MAC support EHT. Requires he_support
320+
*/
321+
struct iwl_mac_wifi_gen_support_v2 {
322+
__le16 he_support;
323+
__le16 he_ap_support;
324+
__le32 eht_support;
325+
} __packed;
326+
327+
/**
328+
* struct iwl_mac_wifi_gen_support - parameters of iwl_mac_config_cmd
329+
* with support up to uhr as in version 3 of the command
330+
* ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
331+
*
332+
* @he_support: does this MAC support HE
333+
* @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
334+
* @eht_support: does this MAC support EHT. Requires he_support
335+
* @uhr_support: does this MAC support UHR. Requires eht_support
336+
* @reserved: reserved for alignment and to match version 2's size
337+
*/
338+
struct iwl_mac_wifi_gen_support {
339+
u8 he_support;
340+
u8 he_ap_support;
341+
u8 eht_support;
342+
u8 uhr_support;
343+
__le32 reserved;
344+
} __packed;
345+
313346
/**
314347
* struct iwl_mac_config_cmd - command structure to configure MAC contexts in
315-
* MLD API
348+
* MLD API for versions 2 and 3
316349
* ( MAC_CONTEXT_CONFIG_CMD = 0x8 )
317350
*
318351
* @id_and_color: ID and color of the MAC
@@ -321,9 +354,8 @@ enum iwl_mac_config_filter_flags {
321354
* @local_mld_addr: mld address
322355
* @reserved_for_local_mld_addr: reserved
323356
* @filter_flags: combination of &enum iwl_mac_config_filter_flags
324-
* @he_support: does this MAC support HE
325-
* @he_ap_support: HE AP enabled, "pseudo HE", no trigger frame handling
326-
* @eht_support: does this MAC support EHT. Requires he_support
357+
* @wifi_gen_v2: he/eht parameters as in cmd version 2
358+
* @wifi_gen: he/eht/uhr parameters as in cmd version 3
327359
* @nic_not_ack_enabled: mark that the NIC doesn't support receiving
328360
* ACK-enabled AGG, (i.e. both BACK and non-BACK frames in single AGG).
329361
* If the NIC is not ACK_ENABLED it may use the EOF-bit in first non-0
@@ -332,24 +364,24 @@ enum iwl_mac_config_filter_flags {
332364
* @p2p_dev: mac data for p2p device
333365
*/
334366
struct iwl_mac_config_cmd {
335-
/* COMMON_INDEX_HDR_API_S_VER_1 */
336367
__le32 id_and_color;
337368
__le32 action;
338369
/* MAC_CONTEXT_TYPE_API_E */
339370
__le32 mac_type;
340371
u8 local_mld_addr[6];
341372
__le16 reserved_for_local_mld_addr;
342373
__le32 filter_flags;
343-
__le16 he_support;
344-
__le16 he_ap_support;
345-
__le32 eht_support;
374+
union {
375+
struct iwl_mac_wifi_gen_support_v2 wifi_gen_v2;
376+
struct iwl_mac_wifi_gen_support wifi_gen;
377+
};
346378
__le32 nic_not_ack_enabled;
347379
/* MAC_CONTEXT_CONFIG_SPECIFIC_DATA_API_U_VER_2 */
348380
union {
349381
struct iwl_mac_client_data client;
350382
struct iwl_mac_p2p_dev_data p2p_dev;
351383
};
352-
} __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2 */
384+
} __packed; /* MAC_CONTEXT_CONFIG_CMD_API_S_VER_2_VER_3 */
353385

354386
/**
355387
* enum iwl_link_ctx_modify_flags - indicate to the fw what fields are being

drivers/net/wireless/intel/iwlwifi/mld/iface.c

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,24 @@ static bool iwl_mld_is_nic_ack_enabled(struct iwl_mld *mld,
103103
IEEE80211_HE_MAC_CAP2_ACK_EN);
104104
}
105105

106+
static void iwl_mld_set_he_support(struct iwl_mld *mld,
107+
struct ieee80211_vif *vif,
108+
struct iwl_mac_config_cmd *cmd,
109+
int cmd_ver)
110+
{
111+
if (vif->type == NL80211_IFTYPE_AP) {
112+
if (cmd_ver == 2)
113+
cmd->wifi_gen_v2.he_ap_support = cpu_to_le16(1);
114+
else
115+
cmd->wifi_gen.he_ap_support = 1;
116+
} else {
117+
if (cmd_ver == 2)
118+
cmd->wifi_gen_v2.he_support = cpu_to_le16(1);
119+
else
120+
cmd->wifi_gen.he_support = 1;
121+
}
122+
}
123+
106124
/* fill the common part for all interface types */
107125
static void iwl_mld_mac_cmd_fill_common(struct iwl_mld *mld,
108126
struct ieee80211_vif *vif,
@@ -112,6 +130,9 @@ static void iwl_mld_mac_cmd_fill_common(struct iwl_mld *mld,
112130
struct iwl_mld_vif *mld_vif = iwl_mld_vif_from_mac80211(vif);
113131
struct ieee80211_bss_conf *link_conf;
114132
unsigned int link_id;
133+
int cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw,
134+
WIDE_ID(MAC_CONF_GROUP,
135+
MAC_CONFIG_CMD), 0);
115136

116137
lockdep_assert_wiphy(mld->wiphy);
117138

@@ -138,23 +159,19 @@ static void iwl_mld_mac_cmd_fill_common(struct iwl_mld *mld,
138159
* and enable both when we have MLO.
139160
*/
140161
if (ieee80211_vif_is_mld(vif)) {
141-
if (vif->type == NL80211_IFTYPE_AP)
142-
cmd->he_ap_support = cpu_to_le16(1);
162+
iwl_mld_set_he_support(mld, vif, cmd, cmd_ver);
163+
if (cmd_ver == 2)
164+
cmd->wifi_gen_v2.eht_support = cpu_to_le32(1);
143165
else
144-
cmd->he_support = cpu_to_le16(1);
145-
146-
cmd->eht_support = cpu_to_le32(1);
166+
cmd->wifi_gen.eht_support = 1;
147167
return;
148168
}
149169

150170
for_each_vif_active_link(vif, link_conf, link_id) {
151171
if (!link_conf->he_support)
152172
continue;
153173

154-
if (vif->type == NL80211_IFTYPE_AP)
155-
cmd->he_ap_support = cpu_to_le16(1);
156-
else
157-
cmd->he_support = cpu_to_le16(1);
174+
iwl_mld_set_he_support(mld, vif, cmd, cmd_ver);
158175

159176
/* EHT, if supported, was already set above */
160177
break;

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

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
3-
* Copyright (C) 2022 - 2024 Intel Corporation
3+
* Copyright (C) 2022 - 2025 Intel Corporation
44
*/
55
#include "mvm.h"
66

77
static void iwl_mvm_mld_set_he_support(struct iwl_mvm *mvm,
88
struct ieee80211_vif *vif,
9-
struct iwl_mac_config_cmd *cmd)
9+
struct iwl_mac_config_cmd *cmd,
10+
int cmd_ver)
1011
{
11-
if (vif->type == NL80211_IFTYPE_AP)
12-
cmd->he_ap_support = cpu_to_le16(1);
13-
else
14-
cmd->he_support = cpu_to_le16(1);
12+
if (vif->type == NL80211_IFTYPE_AP) {
13+
if (cmd_ver == 2)
14+
cmd->wifi_gen_v2.he_ap_support = cpu_to_le16(1);
15+
else
16+
cmd->wifi_gen.he_ap_support = 1;
17+
} else {
18+
if (cmd_ver == 2)
19+
cmd->wifi_gen_v2.he_support = cpu_to_le16(1);
20+
else
21+
cmd->wifi_gen.he_support = 1;
22+
}
1523
}
1624

1725
static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
@@ -22,6 +30,12 @@ static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
2230
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
2331
struct ieee80211_bss_conf *link_conf;
2432
unsigned int link_id;
33+
int cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw,
34+
WIDE_ID(MAC_CONF_GROUP,
35+
MAC_CONFIG_CMD), 0);
36+
37+
if (WARN_ON(cmd_ver < 1 && cmd_ver > 3))
38+
return;
2539

2640
cmd->id_and_color = cpu_to_le32(mvmvif->id);
2741
cmd->action = cpu_to_le32(action);
@@ -30,8 +44,8 @@ static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
3044

3145
memcpy(cmd->local_mld_addr, vif->addr, ETH_ALEN);
3246

33-
cmd->he_support = 0;
34-
cmd->eht_support = 0;
47+
cmd->wifi_gen_v2.he_support = 0;
48+
cmd->wifi_gen_v2.eht_support = 0;
3549

3650
/* should be set by specific context type handler */
3751
cmd->filter_flags = 0;
@@ -51,8 +65,11 @@ static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
5165
* and enable both when we have MLO.
5266
*/
5367
if (ieee80211_vif_is_mld(vif)) {
54-
iwl_mvm_mld_set_he_support(mvm, vif, cmd);
55-
cmd->eht_support = cpu_to_le32(1);
68+
iwl_mvm_mld_set_he_support(mvm, vif, cmd, cmd_ver);
69+
if (cmd_ver == 2)
70+
cmd->wifi_gen_v2.eht_support = cpu_to_le32(1);
71+
else
72+
cmd->wifi_gen.eht_support = 1;
5673
return;
5774
}
5875

@@ -63,16 +80,19 @@ static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
6380
continue;
6481

6582
if (link_conf->he_support)
66-
iwl_mvm_mld_set_he_support(mvm, vif, cmd);
83+
iwl_mvm_mld_set_he_support(mvm, vif, cmd, cmd_ver);
6784

68-
/* it's not reasonable to have EHT without HE and FW API doesn't
85+
/* It's not reasonable to have EHT without HE and FW API doesn't
6986
* support it. Ignore EHT in this case.
7087
*/
7188
if (!link_conf->he_support && link_conf->eht_support)
7289
continue;
7390

7491
if (link_conf->eht_support) {
75-
cmd->eht_support = cpu_to_le32(1);
92+
if (cmd_ver == 2)
93+
cmd->wifi_gen_v2.eht_support = cpu_to_le32(1);
94+
else
95+
cmd->wifi_gen.eht_support = 1;
7696
break;
7797
}
7898
}

0 commit comments

Comments
 (0)