drivers/net/wireless/ath/ath12k/wow.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath12k/wow.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath12k/wow.c- Extension
.c- Size
- 27165 bytes
- Lines
- 1049
- 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.
- 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/inetdevice.hnet/addrconf.hnet/if_inet6.hnet/ipv6.hmac.hnet/mac80211.hcore.hhif.hdebug.hwmi.hwow.h
Detected Declarations
function ath12k_wow_is_p2p_vdevfunction ath12k_wow_enablefunction ath12k_wow_wakeupfunction ath12k_wow_vif_cleanupfunction ath12k_wow_cleanupfunction list_for_each_entryfunction ath12k_wow_convert_8023_to_80211function ath12k_wow_pno_check_and_convertfunction ath12k_wow_vif_set_wakeupsfunction ath12k_wow_set_wakeupsfunction list_for_each_entryfunction ath12k_wow_vdev_clean_nlofunction ath12k_wow_vif_clean_nlofunction ath12k_wow_nlo_cleanupfunction list_for_each_entryfunction ath12k_wow_set_hw_filterfunction list_for_each_entryfunction ath12k_wow_clear_hw_filterfunction list_for_each_entryfunction ath12k_wow_generate_ns_mc_addrfunction ath12k_wow_prepare_ns_offloadfunction ath12k_wow_prepare_arp_offloadfunction ath12k_wow_arp_ns_offloadfunction list_for_each_entryfunction ath12k_gtk_rekey_offloadfunction list_for_each_entryfunction ath12k_wow_protocol_offloadfunction ath12k_wow_set_keepalivefunction list_for_each_entryfunction ath12k_wow_op_suspendfunction ath12k_wow_op_set_wakeupfunction ath12k_wow_op_resumefunction ath12k_wow_initexport ath12k_wow_op_suspendexport ath12k_wow_op_set_wakeupexport ath12k_wow_op_resume
Annotated Snippet
if (ret) {
ath12k_warn(ab, "failed to issue wow enable: %d\n", ret);
return ret;
}
ret = wait_for_completion_timeout(&ab->htc_suspend, 3 * HZ);
if (ret == 0) {
ath12k_warn(ab,
"timed out while waiting for htc suspend completion\n");
return -ETIMEDOUT;
}
if (test_bit(ATH12K_FLAG_HTC_SUSPEND_COMPLETE, &ab->dev_flags))
/* success, suspend complete received */
return 0;
ath12k_warn(ab, "htc suspend not complete, retrying (try %d)\n",
i);
msleep(ATH12K_WOW_RETRY_WAIT_MS);
}
ath12k_warn(ab, "htc suspend not complete, failing after %d tries\n", i);
return -ETIMEDOUT;
}
int ath12k_wow_wakeup(struct ath12k *ar)
{
struct ath12k_base *ab = ar->ab;
int ret;
reinit_completion(&ab->wow.wakeup_completed);
ret = ath12k_wmi_wow_host_wakeup_ind(ar);
if (ret) {
ath12k_warn(ab, "failed to send wow wakeup indication: %d\n",
ret);
return ret;
}
ret = wait_for_completion_timeout(&ab->wow.wakeup_completed, 3 * HZ);
if (ret == 0) {
ath12k_warn(ab, "timed out while waiting for wow wakeup completion\n");
return -ETIMEDOUT;
}
return 0;
}
static int ath12k_wow_vif_cleanup(struct ath12k_link_vif *arvif)
{
struct ath12k *ar = arvif->ar;
int i, ret;
for (i = 0; i < WOW_EVENT_MAX; i++) {
ret = ath12k_wmi_wow_add_wakeup_event(ar, arvif->vdev_id, i, 0);
if (ret) {
ath12k_warn(ar->ab, "failed to issue wow wakeup for event %s on vdev %i: %d\n",
wow_wakeup_event(i), arvif->vdev_id, ret);
return ret;
}
}
for (i = 0; i < ar->wow.max_num_patterns; i++) {
ret = ath12k_wmi_wow_del_pattern(ar, arvif->vdev_id, i);
if (ret) {
ath12k_warn(ar->ab, "failed to delete wow pattern %d for vdev %i: %d\n",
i, arvif->vdev_id, ret);
return ret;
}
}
return 0;
}
static int ath12k_wow_cleanup(struct ath12k *ar)
{
struct ath12k_link_vif *arvif;
int ret;
lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy);
list_for_each_entry(arvif, &ar->arvifs, list) {
if (arvif != &arvif->ahvif->deflink)
continue;
ret = ath12k_wow_vif_cleanup(arvif);
if (ret) {
ath12k_warn(ar->ab, "failed to clean wow wakeups on vdev %i: %d\n",
arvif->vdev_id, ret);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/inetdevice.h`, `net/addrconf.h`, `net/if_inet6.h`, `net/ipv6.h`, `mac.h`, `net/mac80211.h`, `core.h`.
- Detected declarations: `function ath12k_wow_is_p2p_vdev`, `function ath12k_wow_enable`, `function ath12k_wow_wakeup`, `function ath12k_wow_vif_cleanup`, `function ath12k_wow_cleanup`, `function list_for_each_entry`, `function ath12k_wow_convert_8023_to_80211`, `function ath12k_wow_pno_check_and_convert`, `function ath12k_wow_vif_set_wakeups`, `function ath12k_wow_set_wakeups`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.