drivers/net/wireless/ath/ath11k/core.c

Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath11k/core.c

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/ath/ath11k/core.c
Extension
.c
Size
70383 bytes
Lines
2800
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: exported/initcall integration point
Status
integration 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 (ret) {
			ath11k_warn(ab, "failed to set country code during resume: %d\n",
				    ret);
			return ret;
		}
	}

	ret = ath11k_dp_rx_pktlog_start(ab);
	if (ret)
		ath11k_warn(ab, "failed to start rx pktlog during resume: %d\n",
			    ret);

	return ret;
}

static int ath11k_core_resume_wow(struct ath11k_base *ab)
{
	int ret;

	ret = ath11k_hif_resume(ab);
	if (ret) {
		ath11k_warn(ab, "failed to resume hif during resume: %d\n", ret);
		return ret;
	}

	ath11k_hif_ce_irq_enable(ab);
	ath11k_hif_irq_enable(ab);

	ret = ath11k_dp_rx_pktlog_start(ab);
	if (ret) {
		ath11k_warn(ab, "failed to start rx pktlog during resume: %d\n",
			    ret);
		return ret;
	}

	ret = ath11k_wow_wakeup(ab);
	if (ret) {
		ath11k_warn(ab, "failed to wakeup wow during resume: %d\n", ret);
		return ret;
	}

	return 0;
}

int ath11k_core_resume(struct ath11k_base *ab)
{
	int ret;

	ret = ath11k_core_continue_suspend_resume(ab);
	if (ret <= 0)
		return ret;

	if (ab->actual_pm_policy == ATH11K_PM_WOW)
		return ath11k_core_resume_wow(ab);

	return ath11k_core_resume_default(ab);
}
EXPORT_SYMBOL(ath11k_core_resume);

static void ath11k_core_check_cc_code_bdfext(const struct dmi_header *hdr, void *data)
{
	struct ath11k_base *ab = data;
	const char *magic = ATH11K_SMBIOS_BDF_EXT_MAGIC;
	struct ath11k_smbios_bdf *smbios = (struct ath11k_smbios_bdf *)hdr;
	ssize_t copied;
	size_t len;
	int i;

	if (ab->qmi.target.bdf_ext[0] != '\0')
		return;

	if (hdr->type != ATH11K_SMBIOS_BDF_EXT_TYPE)
		return;

	if (hdr->length != ATH11K_SMBIOS_BDF_EXT_LENGTH) {
		ath11k_dbg(ab, ATH11K_DBG_BOOT,
			   "wrong smbios bdf ext type length (%d).\n",
			   hdr->length);
		return;
	}

	spin_lock_bh(&ab->base_lock);

	switch (smbios->country_code_flag) {
	case ATH11K_SMBIOS_CC_ISO:
		ab->new_alpha2[0] = (smbios->cc_code >> 8) & 0xff;
		ab->new_alpha2[1] = smbios->cc_code & 0xff;
		ath11k_dbg(ab, ATH11K_DBG_BOOT, "smbios cc_code %c%c\n",
			   ab->new_alpha2[0], ab->new_alpha2[1]);
		break;

Annotation

Implementation Notes