drivers/staging/most/dim2/hal.h
Source file repositories/reference/linux-study-clean/drivers/staging/most/dim2/hal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/most/dim2/hal.h- Extension
.h- Size
- 2548 bytes
- Lines
- 103
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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
linux/types.hreg.h
Detected Declarations
struct dim_ch_statestruct int_ch_statestruct dim_channelenum mlb_clk_speed
Annotated Snippet
struct dim_ch_state {
bool ready; /* Shows readiness to enqueue next buffer */
u16 done_buffers; /* Number of completed buffers */
};
struct int_ch_state {
/* changed only in interrupt context */
volatile int request_counter;
/* changed only in task context */
volatile int service_counter;
u8 idx1;
u8 idx2;
u8 level; /* [0..2], buffering level */
};
struct dim_channel {
struct int_ch_state state;
u8 addr;
u16 dbr_addr;
u16 dbr_size;
u16 packet_length; /*< Isochronous packet length in bytes. */
u16 bytes_per_frame; /*< Synchronous bytes per frame. */
u16 done_sw_buffers_number; /*< Done software buffers number. */
};
u8 dim_startup(struct dim2_regs __iomem *dim_base_address, u32 mlb_clock,
u32 fcnt);
void dim_shutdown(void);
bool dim_get_lock_state(void);
u16 dim_norm_ctrl_async_buffer_size(u16 buf_size);
u16 dim_norm_isoc_buffer_size(u16 buf_size, u16 packet_length);
u16 dim_norm_sync_buffer_size(u16 buf_size, u16 bytes_per_frame);
u8 dim_init_control(struct dim_channel *ch, u8 is_tx, u16 ch_address,
u16 max_buffer_size);
u8 dim_init_async(struct dim_channel *ch, u8 is_tx, u16 ch_address,
u16 max_buffer_size);
u8 dim_init_isoc(struct dim_channel *ch, u8 is_tx, u16 ch_address,
u16 packet_length);
u8 dim_init_sync(struct dim_channel *ch, u8 is_tx, u16 ch_address,
u16 bytes_per_frame);
u8 dim_destroy_channel(struct dim_channel *ch);
void dim_service_mlb_int_irq(void);
void dim_service_ahb_int_irq(struct dim_channel *const *channels);
u8 dim_service_channel(struct dim_channel *ch);
struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch,
struct dim_ch_state *state_ptr);
u16 dim_dbr_space(struct dim_channel *ch);
bool dim_enqueue_buffer(struct dim_channel *ch, u32 buffer_addr,
u16 buffer_size);
bool dim_detach_buffers(struct dim_channel *ch, u16 buffers_number);
void dimcb_on_error(u8 error_id, const char *error_message);
#endif /* _DIM2_HAL_H */
Annotation
- Immediate include surface: `linux/types.h`, `reg.h`.
- Detected declarations: `struct dim_ch_state`, `struct int_ch_state`, `struct dim_channel`, `enum mlb_clk_speed`.
- Atlas domain: Driver Families / drivers/staging.
- 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.