drivers/staging/vme_user/vme_tsi148.c
Source file repositories/reference/linux-study-clean/drivers/staging/vme_user/vme_tsi148.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/vme_user/vme_tsi148.c- Extension
.c- Size
- 71139 bytes
- Lines
- 2635
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/moduleparam.hlinux/mm.hlinux/types.hlinux/errno.hlinux/proc_fs.hlinux/pci.hlinux/poll.hlinux/dma-mapping.hlinux/interrupt.hlinux/spinlock.hlinux/sched.hlinux/slab.hlinux/time.hlinux/io.hlinux/uaccess.hlinux/byteorder/generic.hvme.hvme_bridge.hvme_tsi148.h
Detected Declarations
function reg_joinfunction reg_splitfunction tsi148_DMA_irqhandlerfunction tsi148_LM_irqhandlerfunction tsi148_MB_irqhandlerfunction tsi148_PERR_irqhandlerfunction tsi148_VERR_irqhandlerfunction tsi148_IACK_irqhandlerfunction tsi148_VIRQ_irqhandlerfunction handlerfunction tsi148_irq_initfunction tsi148_irq_exitfunction tsi148_iack_receivedfunction tsi148_irq_setfunction tsi148_irq_generatefunction tsi148_slave_setfunction tsi148_slave_getfunction tsi148_alloc_resourcefunction tsi148_free_resourcefunction tsi148_master_setfunction __tsi148_master_getfunction tsi148_master_getfunction tsi148_master_readfunction tsi148_master_writefunction tsi148_master_rmwfunction tsi148_dma_set_vme_src_attributesfunction tsi148_dma_set_vme_dest_attributesfunction tsi148_dma_list_addfunction tsi148_dma_busyfunction tsi148_dma_list_execfunction tsi148_dma_list_emptyfunction tsi148_lm_setfunction tsi148_lm_getfunction tsi148_lm_attachfunction tsi148_lm_detachfunction tsi148_slot_getfunction tsi148_free_consistentfunction tsi148_crcsr_initfunction tsi148_crcsr_exitfunction tsi148_probefunction tsi148_remove
Annotated Snippet
static struct pci_driver tsi148_driver = {
.name = driver_name,
.id_table = tsi148_ids,
.probe = tsi148_probe,
.remove = tsi148_remove,
};
static void reg_join(unsigned int high, unsigned int low,
unsigned long long *variable)
{
*variable = (unsigned long long)high << 32;
*variable |= (unsigned long long)low;
}
static void reg_split(unsigned long long variable, unsigned int *high,
unsigned int *low)
{
*low = (unsigned int)variable & 0xFFFFFFFF;
*high = (unsigned int)(variable >> 32);
}
/*
* Wakes up DMA queue.
*/
static u32 tsi148_DMA_irqhandler(struct tsi148_driver *bridge,
int channel_mask)
{
u32 serviced = 0;
if (channel_mask & TSI148_LCSR_INTS_DMA0S) {
wake_up(&bridge->dma_queue[0]);
serviced |= TSI148_LCSR_INTC_DMA0C;
}
if (channel_mask & TSI148_LCSR_INTS_DMA1S) {
wake_up(&bridge->dma_queue[1]);
serviced |= TSI148_LCSR_INTC_DMA1C;
}
return serviced;
}
/*
* Wake up location monitor queue
*/
static u32 tsi148_LM_irqhandler(struct tsi148_driver *bridge, u32 stat)
{
int i;
u32 serviced = 0;
for (i = 0; i < 4; i++) {
if (stat & TSI148_LCSR_INTS_LMS[i]) {
/* We only enable interrupts if the callback is set */
bridge->lm_callback[i](bridge->lm_data[i]);
serviced |= TSI148_LCSR_INTC_LMC[i];
}
}
return serviced;
}
/*
* Wake up mail box queue.
*
* XXX This functionality is not exposed up though API.
*/
static u32 tsi148_MB_irqhandler(struct vme_bridge *tsi148_bridge, u32 stat)
{
int i;
u32 val;
u32 serviced = 0;
struct tsi148_driver *bridge;
bridge = tsi148_bridge->driver_priv;
for (i = 0; i < 4; i++) {
if (stat & TSI148_LCSR_INTS_MBS[i]) {
val = ioread32be(bridge->base + TSI148_GCSR_MBOX[i]);
dev_err(tsi148_bridge->parent, "VME Mailbox %d received: 0x%x\n",
i, val);
serviced |= TSI148_LCSR_INTC_MBC[i];
}
}
return serviced;
}
/*
* Display error & status message when PERR (PCI) exception interrupt occurs.
*/
static u32 tsi148_PERR_irqhandler(struct vme_bridge *tsi148_bridge)
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/mm.h`, `linux/types.h`, `linux/errno.h`, `linux/proc_fs.h`, `linux/pci.h`, `linux/poll.h`.
- Detected declarations: `function reg_join`, `function reg_split`, `function tsi148_DMA_irqhandler`, `function tsi148_LM_irqhandler`, `function tsi148_MB_irqhandler`, `function tsi148_PERR_irqhandler`, `function tsi148_VERR_irqhandler`, `function tsi148_IACK_irqhandler`, `function tsi148_VIRQ_irqhandler`, `function handler`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.