drivers/mcb/mcb-parse.c
Source file repositories/reference/linux-study-clean/drivers/mcb/mcb-parse.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mcb/mcb-parse.c- Extension
.c- Size
- 5296 bytes
- Lines
- 254
- Domain
- Driver Families
- Bucket
- drivers/mcb
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/types.hlinux/ioport.hlinux/slab.hlinux/export.hlinux/io.hlinux/mcb.hmcb-internal.h
Detected Declarations
function get_next_dtypefunction chameleon_parse_bddfunction chameleon_parse_gddfunction chameleon_parse_barfunction chameleon_get_barfunction chameleon_parse_cellsfunction for_each_chameleon_cell
Annotated Snippet
switch (dtype) {
case CHAMELEON_DTYPE_GENERAL:
ret = chameleon_parse_gdd(bus, cb, p, bar_count);
if (ret < 0)
goto free_bar;
p += sizeof(struct chameleon_gdd);
break;
case CHAMELEON_DTYPE_BRIDGE:
chameleon_parse_bdd(bus, cb, p);
p += sizeof(struct chameleon_bdd);
break;
case CHAMELEON_DTYPE_END:
break;
default:
pr_err("Invalid chameleon descriptor type 0x%x\n",
dtype);
ret = -EINVAL;
goto free_bar;
}
num_cells++;
}
if (num_cells == 0) {
ret = -EINVAL;
goto free_bar;
}
table_size = p - base;
pr_debug("%d cell(s) found. Chameleon table size: 0x%04x bytes\n", num_cells, table_size);
kfree(cb);
kfree(header);
return table_size;
free_bar:
kfree(cb);
free_header:
kfree(header);
return ret;
}
EXPORT_SYMBOL_NS_GPL(chameleon_parse_cells, "MCB");
Annotation
- Immediate include surface: `linux/types.h`, `linux/ioport.h`, `linux/slab.h`, `linux/export.h`, `linux/io.h`, `linux/mcb.h`, `mcb-internal.h`.
- Detected declarations: `function get_next_dtype`, `function chameleon_parse_bdd`, `function chameleon_parse_gdd`, `function chameleon_parse_bar`, `function chameleon_get_bar`, `function chameleon_parse_cells`, `function for_each_chameleon_cell`.
- Atlas domain: Driver Families / drivers/mcb.
- Implementation status: integration 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.