Lines Matching defs:rom
68 * Routines to parse the ROM into a tree that's usable. Also verify integrity
77 * NOTE: Rom's are guaranteed per the ISO spec to be contiguous but only the
79 * around the indirect registers to read in the rom. This code only assumes the
80 * buffer passed in represents a total rom regardless of end size. It is the
94 DPRINTF(("Invalid size for ROM: %d\n", (unsigned int)*size));
100 DPRINTF(("ROM not initialized or minimal ROM: Info "
177 * current rom length and it's beyond the
217 * Can't just walk the ROM looking at type
264 struct p1212_rom *rom;
270 DPRINTF(("ROM is not complete\n"));
274 DPRINTF(("ROM is not complete (check != size)\n"));
290 DPRINTF(("Invalid ROM: CRC: 0x%04hx, Calculated "
298 /* Now, walk the ROM. */
302 rom = malloc(sizeof(struct p1212_rom), M_DEVBUF, M_WAITOK);
303 rom->len = P1212_ROMFMT_GET_INFOLEN((ntohl(t[0])));
304 next = rom->len + 1;
306 if ((rom->len < 1) || (rom->len > size)) {
307 DPRINTF(("Invalid ROM info length: %d\n", rom->len));
308 free(rom, M_DEVBUF);
313 rom->len--;
315 if (rom->len) {
316 rom->data = malloc(sizeof(u_int32_t) * rom->len, M_DEVBUF,
319 for (i = 0; i < rom->len; i++)
320 rom->data[i] = t[i + 2];
324 strncpy(rom->name, (char *)&t[1], 4);
325 rom->name[4] = 0;
332 rom->root = malloc(sizeof(*rom->root), M_DEVBUF, M_WAITOK|M_ZERO);
333 rom->root->com.key.key_type = P1212_KEYTYPE_Directory;
334 rom->root->com.key.key_value = 0;
335 rom->root->com.key.key = (u_int8_t)P1212_KEYTYPE_Directory;
336 rom->root->com.key.val = 0;
337 TAILQ_INIT(&rom->root->data_root);
338 TAILQ_INIT(&rom->root->subdir_root);
340 if (p1212_parse_directory(rom->root, &t[next], mask)) {
341 DPRINTF(("Parse error in ROM. Bailing\n"));
342 p1212_free(rom);
345 return rom;
381 DPRINTF(("Invalid ROM: CRC: 0x%04hx, "
425 DPRINTF(("Invalid ROM: %s is not "
434 DPRINTF(("Invalid ROM: %s is "
445 DPRINTF(("Invalid ROM: Can't have an "
447 " used at location 0x%0x in ROM\n",
455 DPRINTF(("Invalid ROM: Can't have "
457 " Used at location 0x%0x in ROM\n",
465 DPRINTF(("Invalid ROM: Can't have a "
467 "used at location 0x%0x in ROM\n",
475 DPRINTF(("Invalid ROM: Can't have a "
477 " used at location 0x%0x in ROM\n",
725 DPRINTF(("Invalid ROM: CRC: 0x%04hx, Calculated CRC: "
768 DPRINTF(("Invalid ROM: CRC: 0x%04hx, Calculated CRC: "
817 DPRINTF(("Invalid ROM: text descriptor too short\n"));
825 DPRINTF(("Invalid ROM: CRC: 0x%04hx, Calculated CRC: "
1115 p1212_free(struct p1212_rom *rom)
1121 dir = rom->root;
1167 if (rom->len)
1168 free(rom->data, M_DEVBUF);
1169 free(rom, M_DEVBUF);
1175 * in calculating their ROM CRC's. To compensate an interface for generating