소스 검색

[pci] Correct invalid base-class/sub-class/prog-if order in PCIR

PCI Configuration Space contains fields prog-if at the offset 0x09,
sub-class at the offset 0x0a and base-class at the offset 0x0b (it
respects little endian).  PCIR structure uses these fields in the same
order.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Petr Borsodi 6 년 전
부모
커밋
ba0d5aa993
4개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1
    1
      src/arch/x86/prefix/mromprefix.S
  2. 1
    1
      src/arch/x86/prefix/romprefix.S
  3. 2
    2
      src/util/Option/ROM.pm
  4. 1
    1
      src/util/efirom.c

+ 1
- 1
src/arch/x86/prefix/mromprefix.S 파일 보기

500
 	.word	0x0000			/* Device list pointer */
500
 	.word	0x0000			/* Device list pointer */
501
 	.word	mpciheader_len		/* PCI data structure length */
501
 	.word	mpciheader_len		/* PCI data structure length */
502
 	.byte	0x03			/* PCI data structure revision */
502
 	.byte	0x03			/* PCI data structure revision */
503
-	.byte	0x02, 0x00, 0x00	/* Class code */
503
+	.byte	0x00, 0x00, 0x02	/* Class code */
504
 mpciheader_image_length:
504
 mpciheader_image_length:
505
 	.word	0			/* Image length */
505
 	.word	0			/* Image length */
506
 	.word	0x0001			/* Revision level */
506
 	.word	0x0001			/* Revision level */

+ 1
- 1
src/arch/x86/prefix/romprefix.S 파일 보기

96
 	.word	( pci_devlist - pciheader ) /* Device list pointer */
96
 	.word	( pci_devlist - pciheader ) /* Device list pointer */
97
 	.word	pciheader_len		/* PCI data structure length */
97
 	.word	pciheader_len		/* PCI data structure length */
98
 	.byte	0x03			/* PCI data structure revision */
98
 	.byte	0x03			/* PCI data structure revision */
99
-	.byte	0x02, 0x00, 0x00	/* Class code */
99
+	.byte	0x00, 0x00, 0x02	/* Class code */
100
 pciheader_image_length:
100
 pciheader_image_length:
101
 	.word	0			/* Image length */
101
 	.word	0			/* Image length */
102
 	.word	0x0001			/* Revision level */
102
 	.word	0x0001			/* Revision level */

+ 2
- 2
src/util/Option/ROM.pm 파일 보기

508
       device_list =>	{ offset => 0x08, length => 0x02, pack => "S" },
508
       device_list =>	{ offset => 0x08, length => 0x02, pack => "S" },
509
       struct_length =>	{ offset => 0x0a, length => 0x02, pack => "S" },
509
       struct_length =>	{ offset => 0x0a, length => 0x02, pack => "S" },
510
       struct_revision =>{ offset => 0x0c, length => 0x01, pack => "C" },
510
       struct_revision =>{ offset => 0x0c, length => 0x01, pack => "C" },
511
-      base_class => 	{ offset => 0x0d, length => 0x01, pack => "C" },
511
+      prog_intf => 	{ offset => 0x0d, length => 0x01, pack => "C" },
512
       sub_class => 	{ offset => 0x0e, length => 0x01, pack => "C" },
512
       sub_class => 	{ offset => 0x0e, length => 0x01, pack => "C" },
513
-      prog_intf => 	{ offset => 0x0f, length => 0x01, pack => "C" },
513
+      base_class => 	{ offset => 0x0f, length => 0x01, pack => "C" },
514
       image_length =>	{ offset => 0x10, length => 0x02, pack => "S" },
514
       image_length =>	{ offset => 0x10, length => 0x02, pack => "S" },
515
       revision =>	{ offset => 0x12, length => 0x02, pack => "S" },
515
       revision =>	{ offset => 0x12, length => 0x02, pack => "S" },
516
       code_type => 	{ offset => 0x14, length => 0x01, pack => "C" },
516
       code_type => 	{ offset => 0x14, length => 0x01, pack => "C" },

+ 1
- 1
src/util/efirom.c 파일 보기

149
 	headers->pci.VendorId = opts->vendor;
149
 	headers->pci.VendorId = opts->vendor;
150
 	headers->pci.DeviceId = opts->device;
150
 	headers->pci.DeviceId = opts->device;
151
 	headers->pci.Length = sizeof ( headers->pci );
151
 	headers->pci.Length = sizeof ( headers->pci );
152
-	headers->pci.ClassCode[0] = PCI_CLASS_NETWORK;
152
+	headers->pci.ClassCode[2] = PCI_CLASS_NETWORK;
153
 	headers->pci.ImageLength = ( rom_size / 512 );
153
 	headers->pci.ImageLength = ( rom_size / 512 );
154
 	headers->pci.CodeType = 0x03; /* No constant in EFI headers? */
154
 	headers->pci.CodeType = 0x03; /* No constant in EFI headers? */
155
 	headers->pci.Indicator = 0x80; /* No constant in EFI headers? */
155
 	headers->pci.Indicator = 0x80; /* No constant in EFI headers? */

Loading…
취소
저장