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.

Dependency Surface

Detected Declarations

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

Implementation Notes