Commit 4dde4ff0 authored by Shaul Triebitz's avatar Shaul Triebitz Committed by Johannes Berg

wifi: iwlwifi: support link command version 2

In version 2, listen_lmac becomes reserved.
Signed-off-by: default avatarShaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240201155157.df1890aba2fd.Icad9ba10f8bab770adc6a559b2c7bff5cccbffe9@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent dd273e8a
...@@ -446,6 +446,7 @@ enum iwl_link_ctx_flags { ...@@ -446,6 +446,7 @@ enum iwl_link_ctx_flags {
* @listen_lmac: indicates whether the link should be allocated on the Listen * @listen_lmac: indicates whether the link should be allocated on the Listen
* Lmac or on the Main Lmac. Cannot be changed on an active Link. * Lmac or on the Main Lmac. Cannot be changed on an active Link.
* Relevant only for eSR. * Relevant only for eSR.
* @reserved1: in version 2, listen_lmac became reserved
* @cck_rates: basic rates available for CCK * @cck_rates: basic rates available for CCK
* @ofdm_rates: basic rates available for OFDM * @ofdm_rates: basic rates available for OFDM
* @cck_short_preamble: 1 for enabling short preamble, 0 otherwise * @cck_short_preamble: 1 for enabling short preamble, 0 otherwise
...@@ -471,10 +472,10 @@ enum iwl_link_ctx_flags { ...@@ -471,10 +472,10 @@ enum iwl_link_ctx_flags {
* @bssid_index: index of the associated VAP * @bssid_index: index of the associated VAP
* @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
* @spec_link_id: link_id as the AP knows it * @spec_link_id: link_id as the AP knows it
* @reserved: alignment * @reserved2: alignment
* @ibss_bssid_addr: bssid for ibss * @ibss_bssid_addr: bssid for ibss
* @reserved_for_ibss_bssid_addr: reserved * @reserved_for_ibss_bssid_addr: reserved
* @reserved1: reserved for future use * @reserved3: reserved for future use
*/ */
struct iwl_link_config_cmd { struct iwl_link_config_cmd {
__le32 action; __le32 action;
...@@ -485,7 +486,10 @@ struct iwl_link_config_cmd { ...@@ -485,7 +486,10 @@ struct iwl_link_config_cmd {
__le16 reserved_for_local_link_addr; __le16 reserved_for_local_link_addr;
__le32 modify_mask; __le32 modify_mask;
__le32 active; __le32 active;
union {
__le32 listen_lmac; __le32 listen_lmac;
__le32 reserved1;
};
__le32 cck_rates; __le32 cck_rates;
__le32 ofdm_rates; __le32 ofdm_rates;
__le32 cck_short_preamble; __le32 cck_short_preamble;
...@@ -511,11 +515,13 @@ struct iwl_link_config_cmd { ...@@ -511,11 +515,13 @@ struct iwl_link_config_cmd {
u8 bssid_index; u8 bssid_index;
u8 bss_color; u8 bss_color;
u8 spec_link_id; u8 spec_link_id;
u8 reserved; u8 reserved2;
u8 ibss_bssid_addr[6]; u8 ibss_bssid_addr[6];
__le16 reserved_for_ibss_bssid_addr; __le16 reserved_for_ibss_bssid_addr;
__le32 reserved1[8]; __le32 reserved3[8];
} __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1 */ } __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1 and
* LINK_CONTEXT_CONFIG_CMD_API_S_VER_2
*/
/* Currently FW supports link ids in the range 0-3 and can have /* Currently FW supports link ids in the range 0-3 and can have
* at most two active links for each vif. * at most two active links for each vif.
......
...@@ -53,6 +53,8 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -53,6 +53,8 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
unsigned int link_id = link_conf->link_id; unsigned int link_id = link_conf->link_id;
struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id]; struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id];
struct iwl_link_config_cmd cmd = {}; struct iwl_link_config_cmd cmd = {};
unsigned int cmd_id = WIDE_ID(MAC_CONF_GROUP, LINK_CONFIG_CMD);
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 1);
if (WARN_ON_ONCE(!link_info)) if (WARN_ON_ONCE(!link_info))
return -EINVAL; return -EINVAL;
...@@ -84,6 +86,7 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -84,6 +86,7 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
if (vif->type == NL80211_IFTYPE_ADHOC && link_conf->bssid) if (vif->type == NL80211_IFTYPE_ADHOC && link_conf->bssid)
memcpy(cmd.ibss_bssid_addr, link_conf->bssid, ETH_ALEN); memcpy(cmd.ibss_bssid_addr, link_conf->bssid, ETH_ALEN);
if (cmd_ver < 2)
cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac); cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac);
return iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_ADD); return iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_ADD);
...@@ -100,6 +103,8 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -100,6 +103,8 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
struct iwl_link_config_cmd cmd = {}; struct iwl_link_config_cmd cmd = {};
u32 ht_flag, flags = 0, flags_mask = 0; u32 ht_flag, flags = 0, flags_mask = 0;
int ret; int ret;
unsigned int cmd_id = WIDE_ID(MAC_CONF_GROUP, LINK_CONFIG_CMD);
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 1);
if (WARN_ON_ONCE(!link_info || if (WARN_ON_ONCE(!link_info ||
link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID)) link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID))
...@@ -224,6 +229,7 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ...@@ -224,6 +229,7 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
cmd.flags = cpu_to_le32(flags); cmd.flags = cpu_to_le32(flags);
cmd.flags_mask = cpu_to_le32(flags_mask); cmd.flags_mask = cpu_to_le32(flags_mask);
cmd.spec_link_id = link_conf->link_id; cmd.spec_link_id = link_conf->link_id;
if (cmd_ver < 2)
cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac); cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac);
ret = iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_MODIFY); ret = iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_MODIFY);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment