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

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c
Extension
.c
Size
8453 bytes
Lines
307
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (link_conf->eht_support) {
			if (cmd_ver == 2)
				cmd->wifi_gen_v2.eht_support = cpu_to_le32(1);
			else
				cmd->wifi_gen.eht_support = 1;
			break;
		}
	}
	rcu_read_unlock();
}

static int iwl_mvm_mld_mac_ctxt_send_cmd(struct iwl_mvm *mvm,
					 struct iwl_mac_config_cmd_v3 *cmd)
{
	int ret = iwl_mvm_send_cmd_pdu(mvm,
				       WIDE_ID(MAC_CONF_GROUP, MAC_CONFIG_CMD),
				       0, sizeof(*cmd), cmd);
	if (ret)
		IWL_ERR(mvm, "Failed to send MAC_CONFIG_CMD (action:%d): %d\n",
			le32_to_cpu(cmd->action), ret);
	return ret;
}

static int iwl_mvm_mld_mac_ctxt_cmd_sta(struct iwl_mvm *mvm,
					struct ieee80211_vif *vif,
					u32 action, bool force_assoc_off)
{
	struct iwl_mac_config_cmd_v3 cmd = {};

	WARN_ON(vif->type != NL80211_IFTYPE_STATION);

	/* Fill the common data for all mac context types */
	iwl_mvm_mld_mac_ctxt_cmd_common(mvm, vif, &cmd, action);

	/*
	 * We always want to hear MCAST frames, if we're not authorized yet,
	 * we'll drop them.
	 */
	cmd.filter_flags |= cpu_to_le32(MAC_CFG_FILTER_ACCEPT_GRP);

	if (vif->p2p)
		cmd.client.ctwin =
			iwl_mvm_mac_ctxt_cmd_p2p_sta_get_oppps_ctwin(mvm, vif);

	if (vif->cfg.assoc && !force_assoc_off) {
		struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);

		cmd.client.is_assoc = 1;

		if (!mvmvif->authorized &&
		    fw_has_capa(&mvm->fw->ucode_capa,
				IWL_UCODE_TLV_CAPA_COEX_HIGH_PRIO))
			cmd.client.data_policy |=
				cpu_to_le16(COEX_HIGH_PRIORITY_ENABLE);

	} else {
		cmd.client.is_assoc = 0;

		/* Allow beacons to pass through as long as we are not
		 * associated, or we do not have dtim period information.
		 */
		cmd.filter_flags |= cpu_to_le32(MAC_CFG_FILTER_ACCEPT_BEACON);
	}

	cmd.client.assoc_id = cpu_to_le16(vif->cfg.aid);

	if (vif->probe_req_reg && vif->cfg.assoc && vif->p2p)
		cmd.filter_flags |= cpu_to_le32(MAC_CFG_FILTER_ACCEPT_PROBE_REQ);

	if (vif->bss_conf.he_support && !iwlwifi_mod_params.disable_11ax)
		cmd.client.data_policy |=
			cpu_to_le16(iwl_mvm_mac_ctxt_cmd_sta_get_twt_policy(mvm, vif));

	return iwl_mvm_mld_mac_ctxt_send_cmd(mvm, &cmd);
}

static int iwl_mvm_mld_mac_ctxt_cmd_listener(struct iwl_mvm *mvm,
					     struct ieee80211_vif *vif,
					     u32 action)
{
	struct iwl_mac_config_cmd_v3 cmd = {};

	WARN_ON(vif->type != NL80211_IFTYPE_MONITOR);

	iwl_mvm_mld_mac_ctxt_cmd_common(mvm, vif, &cmd, action);

	cmd.filter_flags = cpu_to_le32(MAC_CFG_FILTER_PROMISC |
				       MAC_CFG_FILTER_ACCEPT_CONTROL_AND_MGMT |
				       MAC_CFG_FILTER_ACCEPT_BEACON |
				       MAC_CFG_FILTER_ACCEPT_PROBE_REQ |

Annotation

Implementation Notes