drivers/parisc/eisa_enumerator.c
Source file repositories/reference/linux-study-clean/drivers/parisc/eisa_enumerator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/parisc/eisa_enumerator.c- Extension
.c- Size
- 11425 bytes
- Lines
- 517
- Domain
- Driver Families
- Bucket
- drivers/parisc
- 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.
- 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/ioport.hlinux/init.hlinux/kernel.hlinux/slab.hasm/io.hlinux/uaccess.hasm/byteorder.hasm/eisa_bus.hasm/eisa_eeprom.h
Detected Declarations
function Copyrightfunction get_32function get_24function print_eisa_idfunction configure_memoryfunction configure_irqfunction configure_dmafunction configure_portfunction configure_port_initfunction configure_choisefunction configure_type_stringfunction configure_functionfunction parse_slot_configfunction init_slotfunction eisa_enumerator
Annotated Snippet
if (NULL != (res = kzalloc_obj(struct resource))) {
int result;
res->name = name;
res->start = mem_parent->start + get_24(buf+len+2);
res->end = res->start + get_16(buf+len+5)*1024;
res->flags = IORESOURCE_MEM;
pr_cont("memory %pR ", res);
result = request_resource(mem_parent, res);
if (result < 0) {
printk(KERN_ERR "EISA Enumerator: failed to claim EISA Bus address space!\n");
return result;
}
}
len+=7;
if (!(c & HPEE_MEMORY_MORE)) {
break;
}
}
return len;
}
static int configure_irq(const unsigned char *buf)
{
int len;
u_int8_t c;
int i;
len=0;
for (i=0;i<HPEE_IRQ_MAX_ENT;i++) {
c = get_8(buf+len);
pr_cont("IRQ %d ", c & HPEE_IRQ_CHANNEL_MASK);
if (c & HPEE_IRQ_TRIG_LEVEL) {
eisa_make_irq_level(c & HPEE_IRQ_CHANNEL_MASK);
} else {
eisa_make_irq_edge(c & HPEE_IRQ_CHANNEL_MASK);
}
len+=2;
/* hpux seems to allow for
* two bytes of irq data but only defines one of
* them, I think */
if (!(c & HPEE_IRQ_MORE)) {
break;
}
}
return len;
}
static int configure_dma(const unsigned char *buf)
{
int len;
u_int8_t c;
int i;
len=0;
for (i=0;i<HPEE_DMA_MAX_ENT;i++) {
c = get_8(buf+len);
pr_cont("DMA %d ", c&HPEE_DMA_CHANNEL_MASK);
/* fixme: maybe initialize the dma channel withthe timing ? */
len+=2;
if (!(c & HPEE_DMA_MORE)) {
break;
}
}
return len;
}
static int configure_port(const unsigned char *buf, struct resource *io_parent,
char *board)
{
int len;
u_int8_t c;
int i;
struct resource *res;
int result;
len=0;
for (i=0;i<HPEE_PORT_MAX_ENT;i++) {
Annotation
- Immediate include surface: `linux/ioport.h`, `linux/init.h`, `linux/kernel.h`, `linux/slab.h`, `asm/io.h`, `linux/uaccess.h`, `asm/byteorder.h`, `asm/eisa_bus.h`.
- Detected declarations: `function Copyright`, `function get_32`, `function get_24`, `function print_eisa_id`, `function configure_memory`, `function configure_irq`, `function configure_dma`, `function configure_port`, `function configure_port_init`, `function configure_choise`.
- Atlas domain: Driver Families / drivers/parisc.
- 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.