drivers/s390/net/fsm.h
Source file repositories/reference/linux-study-clean/drivers/s390/net/fsm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/s390/net/fsm.h- Extension
.h- Size
- 6443 bytes
- Lines
- 267
- Domain
- Driver Families
- Bucket
- drivers/s390
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/types.hlinux/timer.hlinux/time.hlinux/slab.hlinux/sched.hlinux/string.hlinux/atomic.h
Detected Declarations
struct fsm_instance_tfunction fsm_eventfunction fsm_newstatefunction fsm_getstate
Annotated Snippet
#ifndef _FSM_H_
#define _FSM_H_
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/time.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/atomic.h>
/**
* Define this to get debugging messages.
*/
#define FSM_DEBUG 0
/**
* Define this to get debugging massages for
* timer handling.
*/
#define FSM_TIMER_DEBUG 0
/**
* Define these to record a history of
* Events/Statechanges and print it if a
* action_function is not found.
*/
#define FSM_DEBUG_HISTORY 0
#define FSM_HISTORY_SIZE 40
struct fsm_instance_t;
/**
* Definition of an action function, called by a FSM
*/
typedef void (*fsm_function_t)(struct fsm_instance_t *, int, void *);
/**
* Internal jump table for a FSM
*/
typedef struct {
fsm_function_t *jumpmatrix;
int nr_events;
int nr_states;
const char **event_names;
const char **state_names;
} fsm;
#if FSM_DEBUG_HISTORY
/**
* Element of State/Event history used for debugging.
*/
typedef struct {
int state;
int event;
} fsm_history;
#endif
/**
* Representation of a FSM
*/
typedef struct fsm_instance_t {
fsm *f;
atomic_t state;
char name[16];
void *userdata;
int userint;
wait_queue_head_t wait_q;
#if FSM_DEBUG_HISTORY
int history_index;
int history_size;
fsm_history history[FSM_HISTORY_SIZE];
#endif
} fsm_instance;
/**
* Description of a state-event combination
*/
typedef struct {
int cond_state;
int cond_event;
fsm_function_t function;
} fsm_node;
/**
* Description of a FSM Timer.
*/
typedef struct {
fsm_instance *fi;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/timer.h`, `linux/time.h`, `linux/slab.h`, `linux/sched.h`, `linux/string.h`, `linux/atomic.h`.
- Detected declarations: `struct fsm_instance_t`, `function fsm_event`, `function fsm_newstate`, `function fsm_getstate`.
- Atlas domain: Driver Families / drivers/s390.
- 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.