Lines Matching refs:ch
245 struct esas2r_component_header *ch = &fi->cmp_hdr[CH_IT_BIOS]; in fix_bios() local
249 pi = (struct esas2r_pc_image *)((u8 *)fi + ch->image_offset); in fix_bios()
272 esas2r_calc_byte_cksum((u8 *)pi, ch->length, 0); in fix_bios()
277 struct esas2r_component_header *ch = &fi->cmp_hdr[CH_IT_EFI]; in fix_efi() local
278 u32 len = ch->length; in fix_efi()
279 u32 offset = ch->image_offset; in fix_efi()
329 struct esas2r_component_header *ch; in fw_download_proc() local
344 ch = &fi->cmp_hdr[fc->comp_typ]; in fw_download_proc()
348 + ch->image_offset /* start of the current image */ in fw_download_proc()
349 + ch->length /* end of the current image */ in fw_download_proc()
379 ch = &fi->cmp_hdr[fc->comp_typ]; in fw_download_proc()
384 ch = &fi->cmp_hdr[CH_IT_BIOS]; in fw_download_proc()
385 if (ch->length == 0) in fw_download_proc()
392 fc->sgc.length = ch->length; in fw_download_proc()
394 ch->image_offset; in fw_download_proc()
405 fc->cmp_len = ch->length; in fw_download_proc()
418 ch->status = CH_STAT_SUCCESS; in fw_download_proc()
421 ch = &fi->cmp_hdr[CH_IT_MAC]; in fw_download_proc()
422 if (ch->length == 0) in fw_download_proc()
430 fc->sgc.length = ch->length; in fw_download_proc()
432 ch->image_offset; in fw_download_proc()
439 fc->flsh_addr -= ch->length; in fw_download_proc()
440 fc->cmp_len = ch->length; in fw_download_proc()
453 ch->status = CH_STAT_SUCCESS; in fw_download_proc()
456 ch = &fi->cmp_hdr[CH_IT_EFI]; in fw_download_proc()
457 if (ch->length == 0) in fw_download_proc()
466 fc->sgc.length = ch->length; in fw_download_proc()
468 ch->image_offset; in fw_download_proc()
475 fc->flsh_addr -= ch->length; in fw_download_proc()
476 fc->cmp_len = ch->length; in fw_download_proc()
489 ch->status = CH_STAT_SUCCESS; in fw_download_proc()
492 ch = &fi->cmp_hdr[CH_IT_CFG]; in fw_download_proc()
494 if (ch->length == 0) in fw_download_proc()
499 fc->flsh_addr = FLS_OFFSET_CPYR - ch->length; in fw_download_proc()
500 fc->sgc.length = ch->length; in fw_download_proc()
502 ch->image_offset; in fw_download_proc()
509 fc->flsh_addr = FLS_OFFSET_CPYR - ch->length; in fw_download_proc()
510 fc->cmp_len = ch->length; in fw_download_proc()
523 ch->status = CH_STAT_SUCCESS; in fw_download_proc()
552 ch = &fi->cmp_hdr[fc->comp_typ]; in fw_download_proc()
553 ch->status = CH_STAT_FAILED; in fw_download_proc()
700 struct esas2r_component_header *ch; in verify_fi() local
725 for (i = 0, len = 0, ch = fi->cmp_hdr; in verify_fi()
727 i++, ch++) { in verify_fi()
734 if (i != ch->img_type) { in verify_fi()
736 ch->status = CH_STAT_INVALID; in verify_fi()
740 switch (ch->img_type) { in verify_fi()
754 switch (ch->img_type) { in verify_fi()
762 if (ch->length & 0x1ff) in verify_fi()
766 if (ch->length == 0) in verify_fi()
770 if (chk_boot((u8 *)fi + ch->image_offset, ch->length) in verify_fi()
779 if (ch->length == 0) { in verify_fi()
785 if (!chk_cfg((u8 *)fi + ch->image_offset + ch->length, in verify_fi()
786 ch->length, NULL)) in verify_fi()
799 ch->status = CH_STAT_INVALID; in verify_fi()
801 ch->status = CH_STAT_PENDING; in verify_fi()
802 len += ch->length; in verify_fi()
1394 struct esas2r_component_header *ch; in esas2r_fm_api() local
1430 ch = &fi->cmp_hdr[CH_IT_BIOS]; in esas2r_fm_api()
1432 if (ch->length) in esas2r_fm_api()
1436 ch = &fi->cmp_hdr[CH_IT_EFI]; in esas2r_fm_api()
1438 if (ch->length) in esas2r_fm_api()
1474 for (j = 0, ch = fi->cmp_hdr; in esas2r_fm_api()
1476 j++, ch++) { in esas2r_fm_api()
1477 ch->img_type = j; in esas2r_fm_api()
1478 ch->status = CH_STAT_PENDING; in esas2r_fm_api()
1479 ch->length = 0; in esas2r_fm_api()
1480 ch->version = 0xffffffff; in esas2r_fm_api()
1481 ch->image_offset = 0; in esas2r_fm_api()
1482 ch->pad[0] = 0; in esas2r_fm_api()
1483 ch->pad[1] = 0; in esas2r_fm_api()