drivers/firmware/iscsi_ibft_find.c

Source file repositories/reference/linux-study-clean/drivers/firmware/iscsi_ibft_find.c

File Facts

System
Linux kernel
Corpus path
drivers/firmware/iscsi_ibft_find.c
Extension
.c
Size
2352 bytes
Lines
101
Domain
Driver Families
Bucket
drivers/firmware
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

if (offset_in_page(pos) == 0) {
			if (virt)
				early_memunmap(virt, PAGE_SIZE);
			virt = early_memremap_ro(pos, PAGE_SIZE);
			virt_pos = pos;
		}

		for (i = 0; i < ARRAY_SIZE(ibft_signs); i++) {
			if (memcmp(virt + (pos - virt_pos), ibft_signs[i].sign,
				   IBFT_SIGN_LEN) == 0) {
				unsigned long *addr =
				    (unsigned long *)(virt + pos - virt_pos + 4);
				len = *addr;
				/* if the length of the table extends past 1M,
				 * the table cannot be valid. */
				if (pos + len <= (IBFT_END-1)) {
					ibft_phys_addr = pos;
					memblock_reserve(ibft_phys_addr, PAGE_ALIGN(len));
					pr_info("iBFT found at %pa.\n", &ibft_phys_addr);
					goto out;
				}
			}
		}
	}

out:
	early_memunmap(virt, PAGE_SIZE);
}

Annotation

Implementation Notes