drivers/comedi/drivers/mite.h
Source file repositories/reference/linux-study-clean/drivers/comedi/drivers/mite.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/comedi/drivers/mite.h- Extension
.h- Size
- 2462 bytes
- Lines
- 94
- Domain
- Driver Families
- Bucket
- drivers/comedi
- 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/spinlock.h
Detected Declarations
struct comedi_devicestruct comedi_subdevicestruct devicestruct pci_devstruct mite_dma_descstruct mite_ringstruct mite_channelstruct mite
Annotated Snippet
struct mite_dma_desc {
__le32 count;
__le32 addr;
__le32 next;
u32 dar;
};
struct mite_ring {
struct device *hw_dev;
unsigned int n_links;
struct mite_dma_desc *descs;
dma_addr_t dma_addr;
};
struct mite_channel {
struct mite *mite;
unsigned int channel;
int dir;
int done;
struct mite_ring *ring;
};
struct mite {
struct pci_dev *pcidev;
void __iomem *mmio;
struct mite_channel channels[MAX_MITE_DMA_CHANNELS];
int num_channels;
unsigned int fifo_size;
/* protects mite_channel from being released by the driver */
spinlock_t lock;
};
u32 mite_bytes_in_transit(struct mite_channel *mite_chan);
void mite_sync_dma(struct mite_channel *mite_chan, struct comedi_subdevice *s);
void mite_ack_linkc(struct mite_channel *mite_chan, struct comedi_subdevice *s,
bool sync);
int mite_done(struct mite_channel *mite_chan);
void mite_dma_arm(struct mite_channel *mite_chan);
void mite_dma_disarm(struct mite_channel *mite_chan);
void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits);
struct mite_channel *mite_request_channel_in_range(struct mite *mite,
struct mite_ring *ring,
unsigned int min_channel,
unsigned int max_channel);
struct mite_channel *mite_request_channel(struct mite *mite,
struct mite_ring *ring);
void mite_release_channel(struct mite_channel *mite_chan);
int mite_init_ring_descriptors(struct mite_ring *ring,
struct comedi_subdevice *s, unsigned int nbytes);
int mite_buf_change(struct mite_ring *ring, struct comedi_subdevice *s);
struct mite_ring *mite_alloc_ring(struct mite *mite);
void mite_free_ring(struct mite_ring *ring);
struct mite *mite_attach(struct comedi_device *dev, bool use_win1);
void mite_detach(struct mite *mite);
/*
* Mite registers (used outside of the mite driver)
*/
#define MITE_IODWBSR 0xc0 /* IO Device Window Base Size */
#define MITE_IODWBSR_1 0xc4 /* IO Device Window1 Base Size */
#define WENAB BIT(7) /* window enable */
#define MITE_IODWCR_1 0xf4
#endif
Annotation
- Immediate include surface: `linux/spinlock.h`.
- Detected declarations: `struct comedi_device`, `struct comedi_subdevice`, `struct device`, `struct pci_dev`, `struct mite_dma_desc`, `struct mite_ring`, `struct mite_channel`, `struct mite`.
- Atlas domain: Driver Families / drivers/comedi.
- 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.