include/linux/iio/buffer_impl.h
Source file repositories/reference/linux-study-clean/include/linux/iio/buffer_impl.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/iio/buffer_impl.h- Extension
.h- Size
- 7367 bytes
- Lines
- 207
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sysfs.hlinux/kref.huapi/linux/iio/buffer.hlinux/iio/buffer.h
Detected Declarations
struct dma_buf_attachmentstruct dma_fencestruct iio_devstruct iio_dma_buffer_blockstruct iio_bufferstruct sg_tablestruct iio_buffer_access_funcsstruct iio_bufferfunction iio_buffer_get
Annotated Snippet
struct iio_buffer_access_funcs {
int (*store_to)(struct iio_buffer *buffer, const void *data);
int (*read)(struct iio_buffer *buffer, size_t n, char __user *buf);
size_t (*data_available)(struct iio_buffer *buffer);
int (*remove_from)(struct iio_buffer *buffer, void *data);
int (*write)(struct iio_buffer *buffer, size_t n, const char __user *buf);
size_t (*space_available)(struct iio_buffer *buffer);
int (*request_update)(struct iio_buffer *buffer);
int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd);
int (*set_length)(struct iio_buffer *buffer, unsigned int length);
int (*enable)(struct iio_buffer *buffer, struct iio_dev *indio_dev);
int (*disable)(struct iio_buffer *buffer, struct iio_dev *indio_dev);
void (*release)(struct iio_buffer *buffer);
struct iio_dma_buffer_block * (*attach_dmabuf)(struct iio_buffer *buffer,
struct dma_buf_attachment *attach);
void (*detach_dmabuf)(struct iio_buffer *buffer,
struct iio_dma_buffer_block *block);
int (*enqueue_dmabuf)(struct iio_buffer *buffer,
struct iio_dma_buffer_block *block,
struct dma_fence *fence, struct sg_table *sgt,
size_t size, bool cyclic);
struct device * (*get_dma_dev)(struct iio_buffer *buffer);
void (*lock_queue)(struct iio_buffer *buffer);
void (*unlock_queue)(struct iio_buffer *buffer);
unsigned int modes;
unsigned int flags;
};
/**
* struct iio_buffer - general buffer structure
*
* Note that the internals of this structure should only be of interest to
* those writing new buffer implementations.
*/
struct iio_buffer {
/** @length: Number of datums in buffer. */
unsigned int length;
/** @flags: File ops flags including busy flag. */
unsigned long flags;
/** @bytes_per_datum: Size of individual datum including timestamp. */
size_t bytes_per_datum;
/** @direction: Direction of the data stream (in/out). */
enum iio_buffer_direction direction;
/**
* @access: Buffer access functions associated with the
* implementation.
*/
const struct iio_buffer_access_funcs *access;
/** @scan_mask: Bitmask used in masking scan mode elements. */
long *scan_mask;
/** @demux_list: List of operations required to demux the scan. */
struct list_head demux_list;
/** @pollq: Wait queue to allow for polling on the buffer. */
wait_queue_head_t pollq;
/** @watermark: Number of datums to wait for poll/read. */
unsigned int watermark;
/* private: */
/* @scan_timestamp: Does the scan mode include a timestamp. */
bool scan_timestamp;
/* @buffer_attr_list: List of buffer attributes. */
struct list_head buffer_attr_list;
/*
* @buffer_group: Attributes of the new buffer group.
* Includes scan elements attributes.
*/
struct attribute_group buffer_group;
/* @attrs: Standard attributes of the buffer. */
const struct iio_dev_attr **attrs;
/* @demux_bounce: Buffer for doing gather from incoming scan. */
void *demux_bounce;
Annotation
- Immediate include surface: `linux/sysfs.h`, `linux/kref.h`, `uapi/linux/iio/buffer.h`, `linux/iio/buffer.h`.
- Detected declarations: `struct dma_buf_attachment`, `struct dma_fence`, `struct iio_dev`, `struct iio_dma_buffer_block`, `struct iio_buffer`, `struct sg_table`, `struct iio_buffer_access_funcs`, `struct iio_buffer`, `function iio_buffer_get`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.