drivers/net/wireless/ath/ath6kl/recovery.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/ath/ath6kl/recovery.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/ath/ath6kl/recovery.c- Extension
.c- Size
- 4321 bytes
- Lines
- 160
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
core.hcfg80211.hdebug.h
Detected Declarations
function Copyrightfunction ath6kl_recovery_err_notifyfunction ath6kl_recovery_hb_eventfunction ath6kl_recovery_hb_timerfunction ath6kl_recovery_initfunction ath6kl_recovery_cleanupfunction ath6kl_recovery_suspendfunction ath6kl_recovery_resume
Annotated Snippet
#include "core.h"
#include "cfg80211.h"
#include "debug.h"
static void ath6kl_recovery_work(struct work_struct *work)
{
struct ath6kl *ar = container_of(work, struct ath6kl,
fw_recovery.recovery_work);
ar->state = ATH6KL_STATE_RECOVERY;
timer_delete_sync(&ar->fw_recovery.hb_timer);
ath6kl_init_hw_restart(ar);
ar->state = ATH6KL_STATE_ON;
clear_bit(WMI_CTRL_EP_FULL, &ar->flag);
ar->fw_recovery.err_reason = 0;
if (ar->fw_recovery.hb_poll)
mod_timer(&ar->fw_recovery.hb_timer, jiffies +
msecs_to_jiffies(ar->fw_recovery.hb_poll));
}
void ath6kl_recovery_err_notify(struct ath6kl *ar, enum ath6kl_fw_err reason)
{
if (!ar->fw_recovery.enable)
return;
ath6kl_dbg(ATH6KL_DBG_RECOVERY, "Fw error detected, reason:%d\n",
reason);
set_bit(reason, &ar->fw_recovery.err_reason);
if (!test_bit(RECOVERY_CLEANUP, &ar->flag) &&
ar->state != ATH6KL_STATE_RECOVERY)
queue_work(ar->ath6kl_wq, &ar->fw_recovery.recovery_work);
}
void ath6kl_recovery_hb_event(struct ath6kl *ar, u32 cookie)
{
if (cookie == ar->fw_recovery.seq_num)
ar->fw_recovery.hb_pending = false;
}
static void ath6kl_recovery_hb_timer(struct timer_list *t)
{
struct ath6kl *ar = timer_container_of(ar, t, fw_recovery.hb_timer);
int err;
if (test_bit(RECOVERY_CLEANUP, &ar->flag) ||
(ar->state == ATH6KL_STATE_RECOVERY))
return;
if (ar->fw_recovery.hb_pending)
ar->fw_recovery.hb_misscnt++;
else
ar->fw_recovery.hb_misscnt = 0;
if (ar->fw_recovery.hb_misscnt > ATH6KL_HB_RESP_MISS_THRES) {
ar->fw_recovery.hb_misscnt = 0;
ar->fw_recovery.seq_num = 0;
ar->fw_recovery.hb_pending = false;
ath6kl_recovery_err_notify(ar, ATH6KL_FW_HB_RESP_FAILURE);
return;
}
ar->fw_recovery.seq_num++;
ar->fw_recovery.hb_pending = true;
err = ath6kl_wmi_get_challenge_resp_cmd(ar->wmi,
ar->fw_recovery.seq_num, 0);
if (err)
ath6kl_warn("Failed to send hb challenge request, err:%d\n",
err);
mod_timer(&ar->fw_recovery.hb_timer, jiffies +
msecs_to_jiffies(ar->fw_recovery.hb_poll));
}
void ath6kl_recovery_init(struct ath6kl *ar)
{
struct ath6kl_fw_recovery *recovery = &ar->fw_recovery;
clear_bit(RECOVERY_CLEANUP, &ar->flag);
INIT_WORK(&recovery->recovery_work, ath6kl_recovery_work);
recovery->seq_num = 0;
recovery->hb_misscnt = 0;
ar->fw_recovery.hb_pending = false;
Annotation
- Immediate include surface: `core.h`, `cfg80211.h`, `debug.h`.
- Detected declarations: `function Copyright`, `function ath6kl_recovery_err_notify`, `function ath6kl_recovery_hb_event`, `function ath6kl_recovery_hb_timer`, `function ath6kl_recovery_init`, `function ath6kl_recovery_cleanup`, `function ath6kl_recovery_suspend`, `function ath6kl_recovery_resume`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.