drivers/media/pci/ivtv/ivtv-driver.h
Source file repositories/reference/linux-study-clean/drivers/media/pci/ivtv/ivtv-driver.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/ivtv/ivtv-driver.h- Extension
.h- Size
- 29938 bytes
- Lines
- 830
- Domain
- Driver Families
- Bucket
- drivers/media
- 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/module.hlinux/init.hlinux/delay.hlinux/sched/signal.hlinux/fs.hlinux/pci.hlinux/interrupt.hlinux/spinlock.hlinux/i2c.hlinux/i2c-algo-bit.hlinux/list.hlinux/unistd.hlinux/pagemap.hlinux/scatterlist.hlinux/kthread.hlinux/mutex.hlinux/slab.hlinux/uaccess.hasm/byteorder.hmedia/v4l2-common.hmedia/v4l2-ioctl.hmedia/v4l2-ctrls.hmedia/v4l2-device.hmedia/v4l2-fh.hmedia/tuner.hmedia/drv-intf/cx2341x.hmedia/i2c/ir-kbd-i2c.hlinux/ivtv.h
Detected Declarations
struct ivtv_optionsstruct ivtv_mailboxstruct ivtv_api_cachestruct ivtv_mailbox_datastruct ivtv_sg_elementstruct ivtv_sg_host_elementstruct ivtv_user_dmastruct ivtv_dma_page_infostruct ivtv_bufferstruct ivtv_queuestruct ivtvstruct ivtv_open_idstruct ivtv_streamstruct ivtv_open_idstruct yuv_frame_infostruct yuv_playback_infostruct vbi_ccstruct vbi_vpsstruct vbi_infostruct ivtv_cardstruct ivtvstruct tveepromfunction ivtv_raw_vbi
Annotated Snippet
struct ivtv_options {
int kilobytes[IVTV_MAX_STREAMS]; /* size in kilobytes of each stream */
int cardtype; /* force card type on load */
int tuner; /* set tuner on load */
int radio; /* enable/disable radio */
int newi2c; /* new I2C algorithm */
int i2c_clock_period; /* period of SCL for I2C bus */
};
/* ivtv-specific mailbox template */
struct ivtv_mailbox {
u32 flags;
u32 cmd;
u32 retval;
u32 timeout;
u32 data[CX2341X_MBOX_MAX_DATA];
};
struct ivtv_api_cache {
unsigned long last_jiffies; /* when last command was issued */
u32 data[CX2341X_MBOX_MAX_DATA]; /* last sent api data */
};
struct ivtv_mailbox_data {
volatile struct ivtv_mailbox __iomem *mbox;
/* Bits 0-2 are for the encoder mailboxes, 0-1 are for the decoder mailboxes.
If the bit is set, then the corresponding mailbox is in use by the driver. */
unsigned long busy;
u8 max_mbox;
};
/* per-buffer bit flags */
#define IVTV_F_B_NEED_BUF_SWAP (1 << 0) /* this buffer should be byte swapped */
/* per-stream, s_flags */
#define IVTV_F_S_DMA_PENDING 0 /* this stream has pending DMA */
#define IVTV_F_S_DMA_HAS_VBI 1 /* the current DMA request also requests VBI data */
#define IVTV_F_S_NEEDS_DATA 2 /* this decoding stream needs more data */
#define IVTV_F_S_CLAIMED 3 /* this stream is claimed */
#define IVTV_F_S_STREAMING 4 /* the fw is decoding/encoding this stream */
#define IVTV_F_S_INTERNAL_USE 5 /* this stream is used internally (sliced VBI processing) */
#define IVTV_F_S_PASSTHROUGH 6 /* this stream is in passthrough mode */
#define IVTV_F_S_STREAMOFF 7 /* signal end of stream EOS */
#define IVTV_F_S_APPL_IO 8 /* this stream is used read/written by an application */
#define IVTV_F_S_PIO_PENDING 9 /* this stream has pending PIO */
#define IVTV_F_S_PIO_HAS_VBI 1 /* the current PIO request also requests VBI data */
/* per-ivtv, i_flags */
#define IVTV_F_I_DMA 0 /* DMA in progress */
#define IVTV_F_I_UDMA 1 /* UDMA in progress */
#define IVTV_F_I_UDMA_PENDING 2 /* UDMA pending */
#define IVTV_F_I_SPEED_CHANGE 3 /* a speed change is in progress */
#define IVTV_F_I_EOS 4 /* end of encoder stream reached */
#define IVTV_F_I_RADIO_USER 5 /* the radio tuner is selected */
#define IVTV_F_I_DIG_RST 6 /* reset digitizer */
#define IVTV_F_I_DEC_YUV 7 /* YUV instead of MPG is being decoded */
#define IVTV_F_I_UPDATE_CC 9 /* CC should be updated */
#define IVTV_F_I_UPDATE_WSS 10 /* WSS should be updated */
#define IVTV_F_I_UPDATE_VPS 11 /* VPS should be updated */
#define IVTV_F_I_DECODING_YUV 12 /* this stream is YUV frame decoding */
#define IVTV_F_I_ENC_PAUSED 13 /* the encoder is paused */
#define IVTV_F_I_VALID_DEC_TIMINGS 14 /* last_dec_timing is valid */
#define IVTV_F_I_HAVE_WORK 15 /* used in the interrupt handler: there is work to be done */
#define IVTV_F_I_WORK_HANDLER_VBI 16 /* there is work to be done for VBI */
#define IVTV_F_I_WORK_HANDLER_YUV 17 /* there is work to be done for YUV */
#define IVTV_F_I_WORK_HANDLER_PIO 18 /* there is work to be done for PIO */
#define IVTV_F_I_PIO 19 /* PIO in progress */
#define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */
#define IVTV_F_I_INITED 21 /* set after first open */
#define IVTV_F_I_FAILED 22 /* set if first open failed */
#define IVTV_F_I_WORK_HANDLER_PCM 23 /* there is work to be done for PCM */
/* Event notifications */
#define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */
#define IVTV_F_I_EV_VSYNC 29 /* VSYNC event */
#define IVTV_F_I_EV_VSYNC_FIELD 30 /* VSYNC event field (0 = first, 1 = second field) */
#define IVTV_F_I_EV_VSYNC_ENABLED 31 /* VSYNC event enabled */
/* Scatter-Gather array element, used in DMA transfers */
struct ivtv_sg_element {
__le32 src;
__le32 dst;
__le32 size;
};
struct ivtv_sg_host_element {
u32 src;
u32 dst;
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/delay.h`, `linux/sched/signal.h`, `linux/fs.h`, `linux/pci.h`, `linux/interrupt.h`, `linux/spinlock.h`.
- Detected declarations: `struct ivtv_options`, `struct ivtv_mailbox`, `struct ivtv_api_cache`, `struct ivtv_mailbox_data`, `struct ivtv_sg_element`, `struct ivtv_sg_host_element`, `struct ivtv_user_dma`, `struct ivtv_dma_page_info`, `struct ivtv_buffer`, `struct ivtv_queue`.
- Atlas domain: Driver Families / drivers/media.
- 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.