drivers/net/wwan/t7xx/t7xx_state_monitor.c
Source file repositories/reference/linux-study-clean/drivers/net/wwan/t7xx/t7xx_state_monitor.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wwan/t7xx/t7xx_state_monitor.c- Extension
.c- Size
- 17045 bytes
- Lines
- 650
- 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.
- 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/bits.hlinux/bitfield.hlinux/completion.hlinux/device.hlinux/delay.hlinux/err.hlinux/gfp.hlinux/iopoll.hlinux/jiffies.hlinux/kernel.hlinux/kthread.hlinux/list.hlinux/slab.hlinux/spinlock.hlinux/string.hlinux/types.hlinux/wait.ht7xx_hif_cldma.ht7xx_mhccif.ht7xx_modem_ops.ht7xx_pci.ht7xx_pcie_mac.ht7xx_port_proxy.ht7xx_reg.ht7xx_state_monitor.h
Detected Declarations
function Copyrightfunction t7xx_fsm_notifier_unregisterfunction fsm_state_notifyfunction t7xx_fsm_broadcast_statefunction fsm_release_commandfunction fsm_finish_commandfunction fsm_del_kf_eventfunction fsm_flush_event_cmd_qsfunction fsm_wait_for_eventfunction fsm_routine_exceptionfunction t7xx_lk_stage_event_handlingfunction fsm_stopped_handlerfunction fsm_routine_stoppedfunction fsm_routine_stoppingfunction t7xx_fsm_broadcast_ready_statefunction fsm_routine_readyfunction fsm_routine_startingfunction fsm_routine_startfunction fsm_main_threadfunction t7xx_fsm_append_cmdfunction t7xx_fsm_append_eventfunction t7xx_fsm_clr_eventfunction t7xx_fsm_get_md_statefunction t7xx_fsm_get_ctl_statefunction t7xx_fsm_recv_md_intrfunction t7xx_fsm_resetfunction t7xx_fsm_initfunction t7xx_fsm_uninit
Annotated Snippet
if (event) {
event_received = event->event_id == event_expected;
if (event_received || event->event_id == event_ignore) {
fsm_del_kf_event(event);
sleep_required = false;
}
}
spin_unlock_irqrestore(&ctl->event_lock, flags);
if (sleep_required)
msleep(FSM_EVENT_POLL_INTERVAL_MS);
}
}
static void fsm_routine_exception(struct t7xx_fsm_ctl *ctl, struct t7xx_fsm_command *cmd,
enum t7xx_ex_reason reason)
{
struct device *dev = &ctl->md->t7xx_dev->pdev->dev;
if (ctl->curr_state != FSM_STATE_READY && ctl->curr_state != FSM_STATE_STARTING) {
if (cmd)
fsm_finish_command(ctl, cmd, -EINVAL);
return;
}
ctl->curr_state = FSM_STATE_EXCEPTION;
switch (reason) {
case EXCEPTION_HS_TIMEOUT:
dev_err(dev, "Boot Handshake failure\n");
break;
case EXCEPTION_EVENT:
dev_err(dev, "Exception event\n");
t7xx_fsm_broadcast_state(ctl, MD_STATE_EXCEPTION);
t7xx_pci_pm_exp_detected(ctl->md->t7xx_dev);
t7xx_md_exception_handshake(ctl->md);
fsm_wait_for_event(ctl, FSM_EVENT_MD_EX_REC_OK, FSM_EVENT_MD_EX,
FSM_MD_EX_REC_OK_TIMEOUT_MS / FSM_EVENT_POLL_INTERVAL_MS);
fsm_wait_for_event(ctl, FSM_EVENT_MD_EX_PASS, FSM_EVENT_INVALID,
FSM_MD_EX_PASS_TIMEOUT_MS / FSM_EVENT_POLL_INTERVAL_MS);
break;
default:
dev_err(dev, "Exception %d\n", reason);
break;
}
if (cmd)
fsm_finish_command(ctl, cmd, 0);
}
static void t7xx_lk_stage_event_handling(struct t7xx_fsm_ctl *ctl, unsigned int status)
{
struct t7xx_modem *md = ctl->md;
struct cldma_ctrl *md_ctrl;
enum lk_event_id lk_event;
struct device *dev;
struct t7xx_port *port;
dev = &md->t7xx_dev->pdev->dev;
lk_event = FIELD_GET(MISC_LK_EVENT_MASK, status);
switch (lk_event) {
case LK_EVENT_NORMAL:
case LK_EVENT_RESET:
break;
case LK_EVENT_CREATE_PD_PORT:
case LK_EVENT_CREATE_POST_DL_PORT:
md_ctrl = md->md_ctrl[CLDMA_ID_AP];
t7xx_cldma_hif_hw_init(md_ctrl);
t7xx_cldma_stop(md_ctrl);
t7xx_cldma_switch_cfg(md_ctrl, CLDMA_DEDICATED_Q_CFG);
port = &ctl->md->port_prox->ports[0];
port->port_conf->ops->enable_chl(port);
t7xx_cldma_start(md_ctrl);
if (lk_event == LK_EVENT_CREATE_POST_DL_PORT)
t7xx_mode_update(md->t7xx_dev, T7XX_FASTBOOT_DOWNLOAD);
else
t7xx_mode_update(md->t7xx_dev, T7XX_FASTBOOT_DUMP);
break;
default:
dev_err(dev, "Invalid LK event %d\n", lk_event);
break;
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitfield.h`, `linux/completion.h`, `linux/device.h`, `linux/delay.h`, `linux/err.h`, `linux/gfp.h`, `linux/iopoll.h`.
- Detected declarations: `function Copyright`, `function t7xx_fsm_notifier_unregister`, `function fsm_state_notify`, `function t7xx_fsm_broadcast_state`, `function fsm_release_command`, `function fsm_finish_command`, `function fsm_del_kf_event`, `function fsm_flush_event_cmd_qs`, `function fsm_wait_for_event`, `function fsm_routine_exception`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.