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

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

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/mld/ap.c
Extension
.c
Size
10604 bytes
Lines
408
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->ap_early_keys[i]) {
			link->ap_early_keys[i] = key;
			return 0;
		}
	}

	return -ENOSPC;
}

static void iwl_mld_stop_beacon(struct iwl_mld *mld, struct ieee80211_vif *vif,
				struct ieee80211_bss_conf *link)
{
	struct iwl_mld_link *mld_link = iwl_mld_link_from_mac80211(link);
	struct iwl_mac_beacon_cmd cmd = {};
	int cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, BEACON_TEMPLATE_CMD, 14);

	if (WARN_ON(!mld_link))
		return;

	if (cmd_ver < 15)
		return;

	/* leave byte_cnt 0 */
	cmd.link_id = cpu_to_le32(mld_link->fw_id);

	iwl_mld_send_cmd_pdu(mld, BEACON_TEMPLATE_CMD, &cmd);
}

void
iwl_mld_link_info_changed_ap_ibss(struct iwl_mld *mld,
				  struct ieee80211_vif *vif,
				  struct ieee80211_bss_conf *link,
				  u64 changes)
{
	u32 link_changes = 0;

	if (changes & BSS_CHANGED_ERP_SLOT)
		link_changes |= LINK_CONTEXT_MODIFY_RATES_INFO;

	if (changes & (BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_HT))
		link_changes |= LINK_CONTEXT_MODIFY_PROTECT_FLAGS;

	if (changes & (BSS_CHANGED_QOS | BSS_CHANGED_BANDWIDTH))
		link_changes |= LINK_CONTEXT_MODIFY_QOS_PARAMS;

	if (changes & BSS_CHANGED_HE_BSS_COLOR)
		link_changes |= LINK_CONTEXT_MODIFY_HE_PARAMS;

	if (link_changes)
		iwl_mld_change_link_in_fw(mld, link, link_changes);

	if (changes & BSS_CHANGED_BEACON) {
		WARN_ON(!link->enable_beacon);
		iwl_mld_update_beacon_template(mld, vif, link);
	}

	/* Enabling beacons was already covered above */
	if ((changes & BSS_CHANGED_BEACON_ENABLED) && !link->enable_beacon)
		iwl_mld_stop_beacon(mld, vif, link);
}

static int iwl_mld_send_ap_early_keys(struct iwl_mld *mld,
				      struct ieee80211_vif *vif,
				      struct ieee80211_bss_conf *link)
{
	struct iwl_mld_link *mld_link = iwl_mld_link_from_mac80211(link);
	int ret = 0;

	if (WARN_ON(!link))
		return -EINVAL;

	for (int i = 0; i < ARRAY_SIZE(mld_link->ap_early_keys); i++) {
		struct ieee80211_key_conf *key = mld_link->ap_early_keys[i];

		if (!key)
			continue;

		mld_link->ap_early_keys[i] = NULL;

		ret = iwl_mld_add_key(mld, vif, NULL, key);
		if (ret)
			break;
	}
	return ret;
}

int iwl_mld_start_ap_ibss(struct ieee80211_hw *hw,
			  struct ieee80211_vif *vif,
			  struct ieee80211_bss_conf *link)
{

Annotation

Implementation Notes