Parcourir la source

[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 il y a 5 ans
Parent
révision
ba0d5aa993

+ 1
- 1
src/arch/x86/prefix/mromprefix.S Voir le fichier

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

+ 1
- 1
src/arch/x86/prefix/romprefix.S Voir le fichier

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

+ 2
- 2
src/util/Option/ROM.pm Voir le fichier

@@ -508,9 +508,9 @@ sub new {
508 508
       device_list =>	{ offset => 0x08, length => 0x02, pack => "S" },
509 509
       struct_length =>	{ offset => 0x0a, length => 0x02, pack => "S" },
510 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 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 514
       image_length =>	{ offset => 0x10, length => 0x02, pack => "S" },
515 515
       revision =>	{ offset => 0x12, length => 0x02, pack => "S" },
516 516
       code_type => 	{ offset => 0x14, length => 0x01, pack => "C" },

+ 1
- 1
src/util/efirom.c Voir le fichier

@@ -149,7 +149,7 @@ static void make_efi_rom ( FILE *pe, FILE *rom, struct options *opts ) {
149 149
 	headers->pci.VendorId = opts->vendor;
150 150
 	headers->pci.DeviceId = opts->device;
151 151
 	headers->pci.Length = sizeof ( headers->pci );
152
-	headers->pci.ClassCode[0] = PCI_CLASS_NETWORK;
152
+	headers->pci.ClassCode[2] = PCI_CLASS_NETWORK;
153 153
 	headers->pci.ImageLength = ( rom_size / 512 );
154 154
 	headers->pci.CodeType = 0x03; /* No constant in EFI headers? */
155 155
 	headers->pci.Indicator = 0x80; /* No constant in EFI headers? */

Chargement…
Annuler
Enregistrer