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

wifi: iwlwifi: support link command version 2

parent dd273e8a
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -446,6 +446,7 @@ enum iwl_link_ctx_flags {
 * @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.
 *	Relevant only for eSR.
 * @reserved1: in version 2, listen_lmac became reserved
 * @cck_rates: basic rates available for CCK
 * @ofdm_rates: basic rates available for OFDM
 * @cck_short_preamble: 1 for enabling short preamble, 0 otherwise
@@ -471,10 +472,10 @@ enum iwl_link_ctx_flags {
 * @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
 * @spec_link_id: link_id as the AP knows it
 * @reserved: alignment
 * @reserved2: alignment
 * @ibss_bssid_addr: bssid for ibss
 * @reserved_for_ibss_bssid_addr: reserved
 * @reserved1: reserved for future use
 * @reserved3: reserved for future use
 */
struct iwl_link_config_cmd {
	__le32 action;
@@ -485,7 +486,10 @@ struct iwl_link_config_cmd {
	__le16 reserved_for_local_link_addr;
	__le32 modify_mask;
	__le32 active;
	union {
		__le32 listen_lmac;
		__le32 reserved1;
	};
	__le32 cck_rates;
	__le32 ofdm_rates;
	__le32 cck_short_preamble;
@@ -511,11 +515,13 @@ struct iwl_link_config_cmd {
	u8 bssid_index;
	u8 bss_color;
	u8 spec_link_id;
	u8 reserved;
	u8 reserved2;
	u8 ibss_bssid_addr[6];
	__le16 reserved_for_ibss_bssid_addr;
	__le32 reserved1[8];
} __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1 */
	__le32 reserved3[8];
} __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
 * at most two active links for each vif.
+8 −2
Original line number Diff line number Diff line
@@ -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;
	struct iwl_mvm_vif_link_info *link_info = mvmvif->link[link_id];
	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))
		return -EINVAL;
@@ -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)
		memcpy(cmd.ibss_bssid_addr, link_conf->bssid, ETH_ALEN);

	if (cmd_ver < 2)
		cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac);

	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,
	struct iwl_link_config_cmd cmd = {};
	u32 ht_flag, flags = 0, flags_mask = 0;
	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 ||
			 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,
	cmd.flags = cpu_to_le32(flags);
	cmd.flags_mask = cpu_to_le32(flags_mask);
	cmd.spec_link_id = link_conf->link_id;
	if (cmd_ver < 2)
		cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac);

	ret = iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_MODIFY);